I am trying to create a table named company
in the default sqlite3 database in web2py:
db.define_table('company',
Field('company_name', notnull=True, unique=True),
Field('email'),
Field('phone', notnull=True),
Field('url3'),
format = '%(company_name)s'
)
db.company.email.requires = IS_EMAIL()
db.company.url3.requires = IS_EMPTY_OR(IS_URL())
I get an error:
<class 'sqlite3.OperationalError'> Cannot add a NOT NULL column with default value NULL
It comes from this line:
format = '%(company_name)s'
How to solve this error?