feat: convert board router to supabase

This commit is contained in:
Henry
2024-04-13 16:23:47 +01:00
parent e048e243d4
commit 1712a1a41b
7 changed files with 1336 additions and 99 deletions

View File

@@ -1,11 +1,5 @@
import { sql } from '@vercel/postgres'
import { drizzle } from 'drizzle-orm/vercel-postgres'
import { createClient } from '@supabase/supabase-js'
import { type Database } from "~/types/database.types";
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;
const supabaseKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;
export const supabase = createClient<Database>(supabaseUrl!, supabaseKey!);
import * as schema from "./schema";

View File

@@ -0,0 +1 @@
ALTER TABLE "board" ALTER COLUMN "deletedAt" DROP DEFAULT;

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,13 @@
"when": 1711571659259,
"tag": "0000_legal_quicksilver",
"breakpoints": true
},
{
"idx": 1,
"version": "5",
"when": 1713021051974,
"tag": "0001_stale_mattie_franklin",
"breakpoints": true
}
]
}

View File

@@ -27,7 +27,7 @@ export const boards = pgTable(
createdBy: uuid("createdBy").notNull().references(() => users.id),
createdAt: timestamp("createdAt").defaultNow().notNull(),
updatedAt: timestamp("updatedAt"),
deletedAt: timestamp("deletedAt").defaultNow(),
deletedAt: timestamp("deletedAt"),
deletedBy: uuid("deletedBy").references(() => users.id),
importId: bigint("importId", { mode: "number" }).references(() => imports.id),
workspaceId: bigint("workspaceId", { mode: "number" }).notNull().references(() => workspaces.id),