Skip to content

Commit 0f69092

Browse files
committed
migration fix
1 parent aee8108 commit 0f69092

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: migrations/20241011063712-datasources.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ exports.setup = function(options, seedLink) {
1616

1717
exports.up = async function(db) {
1818
await db.runSql(
19-
"ALTER TABLE datasource_fields DROP CONSTRAINT ds_fields;" +
20-
"DROP TABLE IF EXISTS datasource;" +
21-
"DELETE FROM datasource_fields;"+
2219
"CREATE TABLE datasource (" +
2320
"id bigserial primary key," +
2421
"account_id int NOT NULL REFERENCES accounts(id) ON DELETE NO ACTION ON UPDATE CASCADE,"+
@@ -204,7 +201,11 @@ const getFields = async(db) => {
204201
}
205202

206203
exports.down = async function(db) {
207-
await db.runSql("ALTER TABLE datasource_fields RENAME COLUMN nullable TO required;")
204+
await db.runSql(
205+
"ALTER TABLE datasource_fields RENAME COLUMN nullable TO required;" +
206+
"ALTER TABLE datasource_fields DROP CONSTRAINT ds_fields;" +
207+
"DROP TABLE IF EXISTS datasource;" +
208+
"DELETE FROM datasource_fields;")
208209
};
209210

210211
exports._meta = {

0 commit comments

Comments
 (0)