fix: settle quota and bound compression work
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
This commit is contained in:
11
migrations/010_anonymous_quota_settlement.sql
Normal file
11
migrations/010_anonymous_quota_settlement.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
ALTER TABLE tasks
|
||||
ADD COLUMN IF NOT EXISTS anonymous_quota_date DATE;
|
||||
|
||||
UPDATE tasks
|
||||
SET anonymous_quota_date = (created_at AT TIME ZONE 'Asia/Shanghai')::date
|
||||
WHERE anonymous_units_reserved > 0
|
||||
AND anonymous_quota_date IS NULL;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_tasks_anonymous_reservation_pending
|
||||
ON tasks(id)
|
||||
WHERE anonymous_units_reserved > 0;
|
||||
Reference in New Issue
Block a user