🎉 initial commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import 'dotenv/config'
|
||||
|
||||
import { db } from './index'
|
||||
import { restaurantTables } from './schema'
|
||||
|
||||
async function seed() {
|
||||
const tables = await db
|
||||
.insert(restaurantTables)
|
||||
.values([
|
||||
{ name: 'Tisch 1', seats: 2 },
|
||||
{ name: 'Tisch 2', seats: 2 },
|
||||
{ name: 'Tisch 3', seats: 4 },
|
||||
{ name: 'Tisch 4', seats: 4 },
|
||||
{ name: 'Tisch 5', seats: 6 },
|
||||
{ name: 'Tisch 6', seats: 8 },
|
||||
])
|
||||
.returning()
|
||||
|
||||
console.log(`Seeded ${tables.length} tables.`)
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
seed().catch((error) => {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
})
|
||||
Reference in New Issue
Block a user