aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRan Guin <[email protected]>2021-07-20 14:03:51 -0700
committerRan Guin <[email protected]>2021-07-20 14:03:51 -0700
commitdab8ce27232e48782562419849a227f6cf7edf74 (patch)
treef8fbb258d82487bcf00fb65314b12f021685b596
parente6535ed7eaffa3242665121c8299bd186ada880a (diff)
downloadcoinos-server-dab8ce27232e48782562419849a227f6cf7edf74.tar.gz
coinos-server-dab8ce27232e48782562419849a227f6cf7edf74.zip
remove virtual column from orders
-rw-r--r--db/migrations/20210714123455_data_fixes_merge.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/db/migrations/20210714123455_data_fixes_merge.js b/db/migrations/20210714123455_data_fixes_merge.js
index aed78258..3816920c 100644
--- a/db/migrations/20210714123455_data_fixes_merge.js
+++ b/db/migrations/20210714123455_data_fixes_merge.js
@@ -4,6 +4,11 @@ exports.up = function(knex) {
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");
+
])
}