From a0cebe3d08419c88afbd5c3e9441931e24066055 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Wed, 28 Feb 2024 12:49:10 -0500 Subject: [PATCH] fix: move ticketing-example to seed file --- .../fixtures/ticketing-example/astro.config.ts | 14 -------------- .../db/test/fixtures/ticketing-example/db/seed.ts | 10 ++++++++++ 2 files changed, 10 insertions(+), 14 deletions(-) create mode 100644 packages/db/test/fixtures/ticketing-example/db/seed.ts diff --git a/packages/db/test/fixtures/ticketing-example/astro.config.ts b/packages/db/test/fixtures/ticketing-example/astro.config.ts index aa8fa54a41..e653b10c3a 100644 --- a/packages/db/test/fixtures/ticketing-example/astro.config.ts +++ b/packages/db/test/fixtures/ticketing-example/astro.config.ts @@ -39,19 +39,5 @@ export default defineConfig({ Event, Ticket, }, - data({ seed, mode }) { - if (mode === 'dev') { - seed(Event, [ - { - name: 'Sampha LIVE in Brooklyn', - description: - 'Sampha is on tour with his new, flawless album Lahai. Come see the live performance outdoors in Prospect Park. Yes, there will be a grand piano 🎹', - date: new Date('2024-01-01'), - ticketPrice: 10000, - location: 'Brooklyn, NY', - }, - ]); - } - }, }, }); diff --git a/packages/db/test/fixtures/ticketing-example/db/seed.ts b/packages/db/test/fixtures/ticketing-example/db/seed.ts new file mode 100644 index 0000000000..c9789cbd66 --- /dev/null +++ b/packages/db/test/fixtures/ticketing-example/db/seed.ts @@ -0,0 +1,10 @@ +import { Event, db } from 'astro:db'; + +await db.insert(Event).values({ + name: 'Sampha LIVE in Brooklyn', + description: + 'Sampha is on tour with his new, flawless album Lahai. Come see the live performance outdoors in Prospect Park. Yes, there will be a grand piano 🎹', + date: new Date('2024-01-01'), + ticketPrice: 10000, + location: 'Brooklyn, NY', +});