feat(billing): record subscription-covered token usage in usage records (#46)
Memind CI / Test, build, and release guards (push) Successful in 2m52s

This commit was merged in pull request #46.
This commit is contained in:
2026-08-06 10:52:55 +00:00
parent 7c18c998bd
commit 49ff7c9bad
4 changed files with 145 additions and 6 deletions
+6
View File
@@ -194,6 +194,12 @@ export async function migrateSchema(pool) {
`ALTER TABLE h5_usage_records ADD UNIQUE KEY uniq_h5_usage_request_id (request_id)`,
);
}
if (!(await columnExists(pool, 'h5_usage_records', 'billing_source'))) {
await pool.query(
`ALTER TABLE h5_usage_records
ADD COLUMN billing_source VARCHAR(16) NOT NULL DEFAULT 'wallet' AFTER balance_after_cents`,
);
}
const assetForeignKeys = [
{