add:type assigner
This commit is contained in:
@@ -1,18 +1,20 @@
|
||||
import { int, text, sqliteTable } from "drizzle-orm/sqlite-core";
|
||||
|
||||
export const users = sqliteTable("users", {
|
||||
id: text("id").primaryKey(), // internal UUID
|
||||
googleId: text("googleId").notNull().unique(), // Google's `sub` claim
|
||||
username: text("username").notNull().unique(), // generated: "silent-crimson-falcon"
|
||||
avatarUrl: text("avatarUrl"), // Google profile picture
|
||||
createdAt: text("createdAt").notNull(),
|
||||
});
|
||||
|
||||
export const tickets = sqliteTable("tickets", {
|
||||
id: text("id").primaryKey(),
|
||||
userId: text("userId").references(() => users.id, { onDelete: "set null" }),
|
||||
subject: text("subject").notNull(),
|
||||
description: text("description").notNull().default(""),
|
||||
type: text("type", {
|
||||
enum: [
|
||||
"bug",
|
||||
"billing",
|
||||
"account",
|
||||
"feature-request",
|
||||
"feedback",
|
||||
"other",
|
||||
],
|
||||
enum: ["bug", "billing", "account", "feature-request", "feedback", "other"],
|
||||
})
|
||||
.notNull()
|
||||
.default("other"),
|
||||
@@ -24,16 +26,8 @@ export const tickets = sqliteTable("tickets", {
|
||||
createdAt: text("createdAt").notNull(),
|
||||
});
|
||||
|
||||
export const users = sqliteTable('users', {
|
||||
id: text('id').primaryKey(), // internal UUID
|
||||
googleId: text('googleId').notNull().unique(), // Google's `sub` claim
|
||||
username: text('username').notNull().unique(), // generated: "silent-crimson-falcon"
|
||||
avatarUrl: text('avatarUrl'), // Google profile picture
|
||||
createdAt: text('createdAt').notNull(),
|
||||
})
|
||||
|
||||
export const sessions = sqliteTable('sessions', {
|
||||
id: text('id').primaryKey(),
|
||||
data: text('data').notNull(),
|
||||
expiresAt: int('expires_at').notNull(), // unix ms
|
||||
})
|
||||
export const sessions = sqliteTable("sessions", {
|
||||
id: text("id").primaryKey(),
|
||||
data: text("data").notNull(),
|
||||
expiresAt: int("expires_at").notNull(), // unix ms
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user