Enhance database management with cleanup and reset scripts

- Added a new database cleanup script to remove all data while preserving the schema, facilitating a clean state before seeding.
- Updated package.json to include new commands for database cleaning and resetting.
- Modified schema definitions to use an array format for index and constraint definitions, improving clarity and consistency.
- Updated product seeding logic to utilize role-based assignments directly from mock data, enhancing flexibility in product-role relationships.
This commit is contained in:
Bastian Masanek
2025-11-02 10:35:07 +01:00
parent ff9960edef
commit 268d91f548
5 changed files with 121 additions and 39 deletions

View File

@@ -15,7 +15,9 @@
"db:migrate": "drizzle-kit migrate",
"db:studio": "drizzle-kit studio",
"db:push": "drizzle-kit push",
"db:seed": "tsx server/database/seed.ts"
"db:clean": "tsx server/database/clean.ts",
"db:seed": "tsx server/database/seed.ts",
"db:reset": "pnpm db:clean && pnpm db:seed"
},
"dependencies": {
"@nuxtjs/i18n": "^10.1.2",