diff --git a/dashboard/starter-example/app/seed/route.ts b/dashboard/starter-example/app/seed/route.ts index c6428b27..a38bc533 100644 --- a/dashboard/starter-example/app/seed/route.ts +++ b/dashboard/starter-example/app/seed/route.ts @@ -5,7 +5,7 @@ import { invoices, customers, revenue, users } from '../lib/placeholder-data'; const sql = postgres(process.env.POSTGRES_URL!, { ssl: 'require' }); async function seedUsers() { - await sql`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`; + await sql` CREATE TABLE IF NOT EXISTS users ( id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, @@ -30,7 +30,6 @@ async function seedUsers() { } async function seedInvoices() { - await sql`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`; await sql` CREATE TABLE IF NOT EXISTS invoices ( @@ -56,7 +55,6 @@ async function seedInvoices() { } async function seedCustomers() { - await sql`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`; await sql` CREATE TABLE IF NOT EXISTS customers ( @@ -103,6 +101,9 @@ async function seedRevenue() { export async function GET() { try { + + await sql`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`; + const result = await sql.begin((sql) => [ seedUsers(), seedCustomers(),