Skip to content

Commit

Permalink
Merge pull request #479 from getAlby/fix/migration-service-fee-db
Browse files Browse the repository at this point in the history
fix: enable data migration
  • Loading branch information
bumi committed Jun 17, 2024
2 parents 15ecc97 + 12cbcec commit 75c3f5e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions db/migrations/20231229091800_add_service_fee.up.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
alter table invoices ALTER COLUMN fee SET DEFAULT 0;
alter table invoices ADD COLUMN IF NOT EXISTS service_fee bigint default 0;
alter table invoices ADD COLUMN IF NOT EXISTS routing_fee bigint default 0;

-- maybe manually migrate existing data?
-- alter table invoices ALTER COLUMN fee SET DEFAULT 0;
-- update invoices set fee = 0 where fee IS NULL;
-- update invoices set routing_fee = fee where routing_fee=0;
-- migrate existing data
update invoices set fee = 0 where fee IS NULL;
update invoices set routing_fee = fee where fee > 0;

0 comments on commit 75c3f5e

Please sign in to comment.