diff options
| author | Ran Guin <[email protected]> | 2021-08-14 13:51:03 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-08-30 16:04:35 -0700 |
| commit | 8a4dfd6fd0d27090f4368ee916b4b97445bf979c (patch) | |
| tree | 43b4fa852cec21a94ab12ec6d71254f7b2dcfea3 /db/migrations/20210814193811_fix_db_conflicts.js | |
| parent | 58d30e66e2a7d453c2f1fc148c86c1f35e0fe16f (diff) | |
| download | coinos-server-8a4dfd6fd0d27090f4368ee916b4b97445bf979c.tar.gz coinos-server-8a4dfd6fd0d27090f4368ee916b4b97445bf979c.zip | |
fix db conflicts
Diffstat (limited to 'db/migrations/20210814193811_fix_db_conflicts.js')
| -rw-r--r-- | db/migrations/20210814193811_fix_db_conflicts.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrations/20210814193811_fix_db_conflicts.js b/db/migrations/20210814193811_fix_db_conflicts.js new file mode 100644 index 00000000..37ff2bbc --- /dev/null +++ b/db/migrations/20210814193811_fix_db_conflicts.js @@ -0,0 +1,16 @@ + +exports.up = function(knex) { + return Promise.all([ + knex.raw("UPDATE waiting_list set created_at = '2021-01-01', updated_at='2021-01-01' WHERE updated_at IS NULL OR created_at IS NULL"), + knex.raw("ALTER TABLE waiting_list MODIFY created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP"), + knex.raw("ALTER TABLE waiting_list MODIFY updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP"), + + knex.raw("UPDATE referrals set created_at = '2021-01-01', updated_at='2021-01-01' WHERE updated_at IS NULL OR created_at IS NULL"), + knex.raw("ALTER TABLE referrals MODIFY created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP"), + knex.raw("ALTER TABLE referrals MODIFY updated_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP") + ]) +}; + +exports.down = function(knex) { + +}; |
