Files
lunarfront-app/packages/backend/src/db/seed.ts
Ryan Moon 9400828f62 Rename Forte to LunarFront, generalize for any small business
Rebrand from Forte (music-store-specific) to LunarFront (any small business):
- Package namespace @forte/* → @lunarfront/*
- Database forte/forte_test → lunarfront/lunarfront_test
- Docker containers, volumes, connection strings
- UI branding, localStorage keys, test emails
- All documentation and planning docs

Generalize music-specific terminology:
- instrumentDescription → itemDescription
- instrumentCount → itemCount
- instrumentType → itemCategory (on service templates)
- New migration 0027_generalize_terminology for column renames
- Seed data updated with generic examples
- RBAC descriptions updated
2026-03-30 08:51:54 -05:00

50 lines
1.2 KiB
TypeScript

import postgres from 'postgres'
import { drizzle } from 'drizzle-orm/postgres-js'
import { companies, locations } from './schema/stores.js'
const DEV_COMPANY_ID = '00000000-0000-0000-0000-000000000001'
const DEV_LOCATION_ID = '00000000-0000-0000-0000-000000000010'
async function seed() {
const connectionString =
process.env.DATABASE_URL ?? 'postgresql://lunarfront:lunarfront@localhost:5432/lunarfront'
const sql = postgres(connectionString)
const db = drizzle(sql)
console.log('Seeding database...')
await db
.insert(companies)
.values({
id: DEV_COMPANY_ID,
name: 'Dev Store',
timezone: 'America/Chicago',
})
.onConflictDoNothing()
await db
.insert(locations)
.values({
id: DEV_LOCATION_ID,
name: 'Main Store',
address: {
street: '123 Main St',
city: 'Austin',
state: 'TX',
zip: '78701',
},
})
.onConflictDoNothing()
console.log(`Seeded dev company: ${DEV_COMPANY_ID}`)
console.log(`Seeded dev location: ${DEV_LOCATION_ID}`)
await sql.end()
console.log('Done.')
}
seed().catch((err) => {
console.error('Seed failed:', err)
process.exit(1)
})