sync
This commit is contained in:
@@ -197,7 +197,8 @@ export async function handler(
|
|||||||
if (Array.isArray(v)) return [[k, v]]
|
if (Array.isArray(v)) return [[k, v]]
|
||||||
if (typeof v === "object") return [[k, replacer(v)]]
|
if (typeof v === "object") return [[k, replacer(v)]]
|
||||||
if (typeof v === "string") {
|
if (typeof v === "string") {
|
||||||
if (v === "$workspace") return authInfo?.workspaceID ? [[k, authInfo?.workspaceID]] : []
|
if (v === "$workspace") return authInfo?.workspaceID ? [[k, authInfo.workspaceID]] : []
|
||||||
|
if (v === "$org") return authInfo?.workspaceID ? [[k, authInfo.workspaceID.replace("wrk_", "org_")]] : []
|
||||||
if (v === "$user") return stickyId ? [[k, stickyId]] : []
|
if (v === "$user") return stickyId ? [[k, stickyId]] : []
|
||||||
if (v.startsWith("$header.")) {
|
if (v.startsWith("$header.")) {
|
||||||
const headerValue = input.request.headers.get(v.slice(8))
|
const headerValue = input.request.headers.get(v.slice(8))
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ export const BillingTable = mysqlTable(
|
|||||||
...workspaceIndexes(table),
|
...workspaceIndexes(table),
|
||||||
uniqueIndex("global_customer_id").on(table.customerID),
|
uniqueIndex("global_customer_id").on(table.customerID),
|
||||||
uniqueIndex("global_subscription_id").on(table.subscriptionID),
|
uniqueIndex("global_subscription_id").on(table.subscriptionID),
|
||||||
uniqueIndex("global_lite_subscription_id").on(table.liteSubscriptionID),
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { bigint, index, mysqlTable, primaryKey, uniqueIndex, varchar } from "drizzle-orm/mysql-core"
|
import { bigint, mysqlTable, primaryKey, uniqueIndex, varchar } from "drizzle-orm/mysql-core"
|
||||||
import { timestamps, ulid, utc, workspaceColumns } from "../drizzle/types"
|
import { timestamps, ulid, utc, workspaceColumns } from "../drizzle/types"
|
||||||
import { workspaceIndexes } from "./workspace.sql"
|
import { workspaceIndexes } from "./workspace.sql"
|
||||||
|
|
||||||
@@ -31,8 +31,5 @@ export const ReferralRewardTable = mysqlTable(
|
|||||||
amount: bigint("amount", { mode: "number" }).notNull(),
|
amount: bigint("amount", { mode: "number" }).notNull(),
|
||||||
timeApplied: utc("time_applied"),
|
timeApplied: utc("time_applied"),
|
||||||
},
|
},
|
||||||
(table) => [
|
(table) => [primaryKey({ columns: [table.workspaceID, table.referralID] })],
|
||||||
primaryKey({ columns: [table.workspaceID, table.referralID] }),
|
|
||||||
index("referral_id").on(table.referralID),
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user