CREATE TABLE MyTable(
id INTEGER PRIMARY KEY,
name TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
cf. MySQL的語法是 created_at TIMESTAMP
------
Source:
http://stackoverflow.com/questions/14461851/sqlite-how-to-have-an-automatic-timestamp
沒有留言:
張貼留言