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:
parent
f170997435
commit
a0cebe3d08
2 changed files with 10 additions and 14 deletions
|
@ -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',
|
||||
},
|
||||
]);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
10
packages/db/test/fixtures/ticketing-example/db/seed.ts
vendored
Normal file
10
packages/db/test/fixtures/ticketing-example/db/seed.ts
vendored
Normal 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',
|
||||
});
|
Loading…
Add table
Reference in a new issue