Implement compression quota refunds and admin manual subscription
This commit is contained in:
11
migrations/004_add_bonus_units.sql
Normal file
11
migrations/004_add_bonus_units.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE usage_periods
|
||||
ADD COLUMN IF NOT EXISTS bonus_units INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
UPDATE usage_periods
|
||||
SET bonus_units = bonus_units + ABS(used_units),
|
||||
used_units = 0
|
||||
WHERE used_units < 0;
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user