sync
This commit is contained in:
@@ -53,6 +53,7 @@ export const BillingTable = mysqlTable(
|
||||
...workspaceIndexes(table),
|
||||
uniqueIndex("global_customer_id").on(table.customerID),
|
||||
uniqueIndex("global_subscription_id").on(table.subscriptionID),
|
||||
uniqueIndex("global_lite_subscription_id").on(table.liteSubscriptionID),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { bigint, mysqlTable, primaryKey, uniqueIndex, varchar } from "drizzle-orm/mysql-core"
|
||||
import { bigint, index, mysqlTable, primaryKey, uniqueIndex, varchar } from "drizzle-orm/mysql-core"
|
||||
import { timestamps, ulid, utc, workspaceColumns } from "../drizzle/types"
|
||||
import { workspaceIndexes } from "./workspace.sql"
|
||||
|
||||
@@ -31,5 +31,5 @@ export const ReferralRewardTable = mysqlTable(
|
||||
amount: bigint("amount", { mode: "number" }).notNull(),
|
||||
timeApplied: utc("time_applied"),
|
||||
},
|
||||
(table) => [primaryKey({ columns: [table.workspaceID, table.referralID] })],
|
||||
(table) => [primaryKey({ columns: [table.workspaceID, table.referralID] }), index("referral_id").on(table.referralID)],
|
||||
)
|
||||
|
||||
@@ -8,6 +8,7 @@ export const WorkspaceTable = mysqlTable(
|
||||
slug: varchar("slug", { length: 255 }),
|
||||
name: varchar("name", { length: 255 }).notNull(),
|
||||
region: json("region").$type<("us" | "eu" | "sg" | "cn")[]>(),
|
||||
allow_non_zdr: boolean(),
|
||||
is_blocked: boolean(),
|
||||
is_flagged_by_anthropic: boolean(),
|
||||
is_flagged_by_openai: boolean(),
|
||||
|
||||
@@ -62,6 +62,7 @@ export namespace Workspace {
|
||||
z.object({
|
||||
name: z.string().min(1).max(255).optional(),
|
||||
region: z.array(Region).min(1).optional(),
|
||||
allow_non_zdr: z.boolean().optional(),
|
||||
}),
|
||||
async (input) => {
|
||||
Actor.assertAdmin()
|
||||
@@ -72,6 +73,7 @@ export namespace Workspace {
|
||||
.set({
|
||||
...("name" in input ? { name: input.name } : {}),
|
||||
...("region" in input ? { region: input.region } : {}),
|
||||
...("allow_non_zdr" in input ? { allow_non_zdr: input.allow_non_zdr } : {}),
|
||||
})
|
||||
.where(eq(WorkspaceTable.id, workspaceID)),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user