Skip to content

Commit

Permalink
Merge pull request #333 from internxt/feat/fix-migration-script
Browse files Browse the repository at this point in the history
[_]: fix/sql-creation_time-migration-script
  • Loading branch information
sg-gs authored Jun 17, 2024
2 parents 0ef69e2 + f09c13c commit 60168d4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions migrations/20240614091229-add-creationTime-to-files-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ module.exports = {
});

await queryInterface.sequelize.query(`
UPDATE files
SET "creation_time" = created_at,
"created_at" = CASE
WHEN created_at > NOW() THEN NOW()
ELSE created_at
END;
ALTER TABLE files RENAME COLUMN creation_time TO creation_time_temp;
ALTER TABLE files RENAME COLUMN created_at TO creation_time;
ALTER TABLE files RENAME COLUMN creation_time_temp TO created_at;
`);
},

Expand Down

0 comments on commit 60168d4

Please sign in to comment.