MySQL似乎支持
CREATE TABLE t1 (
ts TIMESTAMP DEFAULT 0
);
我用Liquibase做,
<column name="updated_at" type="TIMESTAMP" defaultValue="0">
</column>
但是当我跑这个时,我看到了
Caused by: liquibase.exception.DatabaseException: Error executing SQL INSERT INTO PUBLIC.network (id, network_id, name, display_name) VALUES (0, 0, 'Yahoo! Ad Network', 'YAN-US'): Cannot parse "TIMESTAMP" constant "0"; SQL statement:
INSERT INTO PUBLIC.network (id, network_id, name, display_name) VALUES (0, 0, 'Yahoo! Ad Network', 'YAN-US') [22007-178]
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:61)