g1t/services/billing/migrations/0010_month_close.sql
| 1 | -- Closing each month: what a workspace with a card on file owed when the |
| 2 | -- month ended, charged to that card. Once per workspace per month. See |
| 3 | -- `close_months` in src/limits.rs. |
| 4 | CREATE TABLE month_closes ( |
| 5 | workspace TEXT NOT NULL, |
| 6 | -- YYYY-MM, the month that closed. |
| 7 | month TEXT NOT NULL, |
| 8 | -- paid, failed, nothing (owed nothing) or skipped (comped, or on an |
| 9 | -- enterprise, which is invoiced). |
| 10 | status TEXT NOT NULL, |
| 11 | amount_micros INTEGER NOT NULL DEFAULT 0, |
| 12 | payment_id TEXT, |
| 13 | error TEXT, |
| 14 | closed_at TEXT NOT NULL, |
| 15 | PRIMARY KEY (workspace, month) |
| 16 | ); |