How to add a date column to a table with current date as default value?

Viewed 10994

Where I can see which default columns SQLite table will have after creating? I need a column with datetime which has default value of time when data added to the table.\

Now I'm trying:

ALTER TABLE recipes ADD COLUMN timestamp DATE DEFAULT (datetime('now','localtime'));

And I'm obtaining the following message:

SQLiteManager: Likely SQL syntax error: ALTER TABLE recipes ADD COLUMN timestamp DATE DEFAULT (datetime('now','localtime')); [ Cannot add a column with non-constant default ]
Exception Name: NS_ERROR_FAILURE
 Exception Message: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)         [mozIStorageConnection.createStatement]
1 Answers
Related