aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrations/20210714123455_data_fixes_merge.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/db/migrations/20210714123455_data_fixes_merge.js b/db/migrations/20210714123455_data_fixes_merge.js
index 3816920c..70740ce8 100644
--- a/db/migrations/20210714123455_data_fixes_merge.js
+++ b/db/migrations/20210714123455_data_fixes_merge.js
@@ -1,14 +1,12 @@
exports.up = function(knex) {
return Promise.all([
knex.raw("delete from invoices where invoices.account_id not in (select id from accounts)"),
- knex.raw("update users set account_id = 10427 where id = 6262 and account_id = 10428");
+ knex.raw("delete from orders where orders.a1_id not in (select id from accounts) or orders.a2_id not in (select id from accounts)"),
+ knex.raw("update users set account_id = 10427 where id = 6262 and account_id = 10428"),
knex.raw("delete from payments where account_id not in (select id from accounts)"),
- knex.raw("delete from orders where a1_id not in (select id from accounts) or a2_id not in (select id from accounts)"),
-
- knex.raw("alter table orders drop rate");
- knex.raw("alter table orders add rate double");
- knex.raw("update orders set rate = v1/v2");
-
+ knex.raw("alter table orders drop rate"),
+ knex.raw("alter table orders add rate double"),
+ knex.raw("update orders set rate = v1/v2"),
])
}