feat: schema change to add github token
This commit is contained in:
parent
f800008487
commit
947f0c6f0d
@ -5,13 +5,7 @@ import { z } from "zod"
|
|||||||
|
|
||||||
import { and, eq, sql } from "drizzle-orm"
|
import { and, eq, sql } from "drizzle-orm"
|
||||||
import * as schema from "./schema"
|
import * as schema from "./schema"
|
||||||
import {
|
import { Sandbox, sandbox, user, usersToSandboxes } from "./schema"
|
||||||
Sandbox,
|
|
||||||
sandbox,
|
|
||||||
sandboxLikes,
|
|
||||||
user,
|
|
||||||
usersToSandboxes,
|
|
||||||
} from "./schema"
|
|
||||||
|
|
||||||
export interface Env {
|
export interface Env {
|
||||||
DB: D1Database
|
DB: D1Database
|
||||||
@ -316,6 +310,7 @@ export default {
|
|||||||
email: z.string().email(),
|
email: z.string().email(),
|
||||||
username: z.string(),
|
username: z.string(),
|
||||||
avatarUrl: z.string().optional(),
|
avatarUrl: z.string().optional(),
|
||||||
|
githubToken: z.string().nullable().optional(),
|
||||||
createdAt: z.string().optional(),
|
createdAt: z.string().optional(),
|
||||||
generations: z.number().optional(),
|
generations: z.number().optional(),
|
||||||
tier: z.enum(["FREE", "PRO", "ENTERPRISE"]).optional(),
|
tier: z.enum(["FREE", "PRO", "ENTERPRISE"]).optional(),
|
||||||
@ -331,6 +326,7 @@ export default {
|
|||||||
email,
|
email,
|
||||||
username,
|
username,
|
||||||
avatarUrl,
|
avatarUrl,
|
||||||
|
githubToken,
|
||||||
createdAt,
|
createdAt,
|
||||||
generations,
|
generations,
|
||||||
tier,
|
tier,
|
||||||
@ -345,6 +341,7 @@ export default {
|
|||||||
email,
|
email,
|
||||||
username,
|
username,
|
||||||
avatarUrl,
|
avatarUrl,
|
||||||
|
githubToken,
|
||||||
createdAt: createdAt ? new Date(createdAt) : new Date(),
|
createdAt: createdAt ? new Date(createdAt) : new Date(),
|
||||||
generations,
|
generations,
|
||||||
tier,
|
tier,
|
||||||
@ -368,6 +365,7 @@ export default {
|
|||||||
email: z.string().email().optional(),
|
email: z.string().email().optional(),
|
||||||
username: z.string().optional(),
|
username: z.string().optional(),
|
||||||
avatarUrl: z.string().optional(),
|
avatarUrl: z.string().optional(),
|
||||||
|
githubToken: z.string().nullable().optional(),
|
||||||
generations: z.number().optional(),
|
generations: z.number().optional(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ export const user = sqliteTable("user", {
|
|||||||
email: text("email").notNull(),
|
email: text("email").notNull(),
|
||||||
username: text("username").notNull().unique(),
|
username: text("username").notNull().unique(),
|
||||||
avatarUrl: text("avatarUrl"),
|
avatarUrl: text("avatarUrl"),
|
||||||
|
githubToken: text("githubToken"),
|
||||||
createdAt: integer("createdAt", { mode: "timestamp_ms" }).default(
|
createdAt: integer("createdAt", { mode: "timestamp_ms" }).default(
|
||||||
sql`CURRENT_TIMESTAMP`
|
sql`CURRENT_TIMESTAMP`
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user