Looking sql.py I found:
'notnull': 'NOT NULL DEFAULT %(default)s'
If I understand it well, that could be yor solution.
SQL_DIALECTS = { 'sqlite': { 'boolean': 'CHAR(1)',
'string': 'CHAR(%(length)s)', 'text': 'TEXT',
'password': 'CHAR(%(length)s)', 'blob': 'BLOB',
'upload': 'CHAR(%(length)s)', 'integer': 'INTEGER',
'double': 'DOUBLE', 'decimal': 'DOUBLE', 'date': 'DATE',
'time': 'TIME', 'datetime': 'TIMESTAMP', 'id':
'INTEGER PRIMARY KEY AUTOINCREMENT', 'reference': 'INTEGER
REFERENCES %(foreign_key)s ON DELETE %(on_delete_action)s',
'lower': 'LOWER(%(field)s)', 'upper': 'UPPER(%(field)s)',
'is null': 'IS NULL', 'is not null': 'IS NOT NULL',
'extract': "web2py_extract('%(name)s',%(field)s)", 'left join':
'LEFT JOIN', 'random': 'Random()', 'notnull': 'NOT NULL
DEFAULT %(default)s', 'substring':
'SUBSTR(%(field)s,%(pos)s,%(length)s)', 'primarykey': 'PRIMARY
KEY (%s)' },
2010/8/27 Bruno Rocha <[email protected]>
> may be I am wrong .
>
> Wait for Massimo's response
>
> 2010/8/27 Adrian Klaver <[email protected]>
>
> On Friday 27 August 2010 5:05:40 pm Bruno Rocha wrote:
>> > Ok, now I got it.
>> >
>> > But, I dont think DAL has a method for doing that.
>> >
>> > I know just "notnull", "unique" and "ondelete" that are enforced at the
>> > level of the database.
>> >
>> > I think you should use raw SQL for that
>> >
>> > db.executesql('ALTER TABLE......;)
>> >
>> >
>>
>>
>> That is a possibility, though it means the model no longer represents the
>> reality :<. Also in the particular case of SQLite the ALTER TABLE syntax
>> does
>> not support adding a DEFAULT to an existing column. What it comes down to
>> is
>> whether I stick with DAL managing everything for the benefit of the
>> migrate
>> feature or manage the schema in the background myself and give up on
>> migrate.
>> That is something that remains to be determined.
>>
>> Thanks,
>> --
>> Adrian Klaver
>> [email protected]
>>
>
>
>
> --
>
> http://rochacbruno.com.br
>
--
http://rochacbruno.com.br