feat: premium workspace usernames

This commit is contained in:
Henry
2025-01-02 20:40:29 +00:00
parent b5dc9433db
commit 67e714b8b0
41 changed files with 1767 additions and 9088 deletions

View File

@@ -1,15 +1,15 @@
import { relations } from "drizzle-orm";
import {
integer,
bigint,
bigserial,
uuid,
integer,
pgEnum,
pgTable,
primaryKey,
text,
timestamp,
uuid,
varchar,
bigint,
} from "drizzle-orm/pg-core";
export const importSourceEnum = pgEnum("source", ["trello"]);
@@ -39,6 +39,7 @@ export const activityTypeEnum = pgEnum("card_activity_type", [
"card.updated.comment.deleted",
"card.archived",
]);
export const slugTypeEnum = pgEnum("slug_type", ["reserved", "premium"]);
export const boards = pgTable("board", {
id: bigserial("id", { mode: "number" }).primaryKey(),
@@ -272,6 +273,7 @@ export const users = pgTable("user", {
email: varchar("email", { length: 255 }).notNull().unique(),
emailVerified: timestamp("emailVerified", { mode: "date" }),
image: varchar("image", { length: 255 }),
stripeCustomerId: varchar("stripeCustomerId", { length: 255 }),
});
export const usersRelations = relations(users, ({ many }) => ({
@@ -430,3 +432,8 @@ export const commentsRelations = relations(comments, ({ one }) => ({
references: [users.id],
}),
}));
export const slugs = pgTable("workspace_slugs", {
slug: varchar("slug", { length: 255 }).notNull().unique(),
type: slugTypeEnum("type").notNull(),
});