summaryrefslogtreecommitdiffhomepage
path: root/packages/console/core/src/schema/billing.sql.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/console/core/src/schema/billing.sql.ts')
-rw-r--r--packages/console/core/src/schema/billing.sql.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/console/core/src/schema/billing.sql.ts b/packages/console/core/src/schema/billing.sql.ts
index 42da13776..f56cf4182 100644
--- a/packages/console/core/src/schema/billing.sql.ts
+++ b/packages/console/core/src/schema/billing.sql.ts
@@ -30,6 +30,20 @@ export const BillingTable = mysqlTable(
],
)
+export const SubscriptionTable = mysqlTable(
+ "subscription",
+ {
+ ...workspaceColumns,
+ ...timestamps,
+ userID: ulid("user_id").notNull(),
+ rollingUsage: bigint("rolling_usage", { mode: "number" }),
+ fixedUsage: bigint("fixed_usage", { mode: "number" }),
+ timeRollingUpdated: utc("time_rolling_updated"),
+ timeFixedUpdated: utc("time_fixed_updated"),
+ },
+ (table) => [...workspaceIndexes(table), uniqueIndex("workspace_user_id").on(table.workspaceID, table.userID)],
+)
+
export const PaymentTable = mysqlTable(
"payment",
{