mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
fix: don't use hardcoded timestamps as default values (#745)
fixes: #741
This commit is contained in:
parent
8e0bae7352
commit
31082e5227
@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
exports.up = function(db, cb) {
|
||||
db.runSql(
|
||||
`
|
||||
ALTER TABLE client_applications ALTER COLUMN created_at SET DEFAULT now();
|
||||
ALTER TABLE client_applications ALTER COLUMN updated_at SET DEFAULT now();
|
||||
ALTER TABLE context_fields ALTER COLUMN created_at SET DEFAULT now();
|
||||
ALTER TABLE context_fields ALTER COLUMN updated_at SET DEFAULT now();
|
||||
ALTER TABLE projects ALTER COLUMN created_at SET DEFAULT now();
|
||||
ALTER TABLE users ALTER COLUMN created_at SET DEFAULT now();
|
||||
`,
|
||||
cb,
|
||||
);
|
||||
};
|
||||
|
||||
exports.down = function(db, cb) {
|
||||
db.runSql(
|
||||
`
|
||||
ALTER TABLE client_applications ALTER COLUMN created_at SET DEFAULT 'now()';
|
||||
ALTER TABLE client_applications ALTER COLUMN updated_at SET DEFAULT 'now()';
|
||||
ALTER TABLE context_fields ALTER COLUMN created_at SET DEFAULT 'now()';
|
||||
ALTER TABLE context_fields ALTER COLUMN updated_at SET DEFAULT 'now()';
|
||||
ALTER TABLE projects ALTER COLUMN created_at SET DEFAULT 'now()';
|
||||
ALTER TABLE users ALTER COLUMN created_at SET DEFAULT 'now()';
|
||||
|
||||
`,
|
||||
cb,
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue
Block a user