By the way that's missing a ondelete="SET NULL" on the competition active_season and I'm using postgres 9.2 with web2py 2.0.9
Sexta-feira, 21 de Setembro de 2012 17:14:45 UTC+1, Leonel Câmara escreveu: > > Hey, I can give you an example of the type of tables creating me problems > > > db.define_table('competition', > Field('name', length=256, requires=[IS_NOT_EMPTY(), IS_LOWER()]), > Field('active_season', 'reference season'), > format='%(name)s', > migrate='competition.table' > ) > > > db.define_table('season', > Field('start', 'date', requires=IS_EMPTY_OR(IS_DATE())), > Field('end', 'date', requires=IS_EMPTY_OR(IS_DATE())), > Field('competition', 'reference competition', requires=IS_IN_DB(db, > db.competition.id, '%(name)s', zero=T('choose one'))), > format='%(start)s - %(end)s', > migrate='season.table' > ) > --