mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 08:45:38 +02:00
Merging this prematurely to make sure the team is on the same boat... like dang! We need to find a better way to do this. Plus it has become too big
23 lines
815 B
Plaintext
23 lines
815 B
Plaintext
import { timestamps, teamID } from "../drizzle/types";
|
|
import { teamIndexes, teamTable } from "../team/team.sql";
|
|
import { pgTable, text, varchar } from "drizzle-orm/pg-core";
|
|
|
|
// FIXME: This is causing errors while trying to db push
|
|
export const Standing = ["new", "good", "overdue"] as const;
|
|
|
|
export const polarTable = pgTable(
|
|
"polar",
|
|
{
|
|
teamID: teamID.teamID.primaryKey().references(() => teamTable.id),
|
|
...timestamps,
|
|
customerID: varchar("customer_id", { length: 255 }).notNull(),
|
|
subscriptionID: varchar("subscription_id", { length: 255 }),
|
|
subscriptionItemID: varchar("subscription_item_id", {
|
|
length: 255,
|
|
}),
|
|
standing: text("standing", { enum: Standing }).notNull(),
|
|
},
|
|
(table) => [
|
|
...teamIndexes(table),
|
|
]
|
|
) |