0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-24 22:46:02 -05:00

fix: move ticketing-example to seed file

This commit is contained in:
bholmesdev 2024-02-28 12:49:10 -05:00
parent f170997435
commit a0cebe3d08
2 changed files with 10 additions and 14 deletions

View file

@ -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',
},
]);
}
},
},
});

View file

@ -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',
});