6c38101e5c
Added new deployment options to deploy.sh: - --migrate: Runs Prisma migration deploy command - --clean-database: Executes maintenance SQL to clean data while preserving categories Added new maintenance directory backend/prisma/maintenance/ containing: - clean-database.sql: SQL script for database cleaning operations Updated deployment script to: - Include new command-line flags in help text - Add conditional blocks for running migrations and database cleaning - Implement container readiness checks before running Prisma commands - Preserve existing seed functionality while adding new maintenance features
25 lines
527 B
SQL
25 lines
527 B
SQL
-- Rensar applikationsdata men behaller kategorier.
|
|
-- Uppdatera den har filen nar nya tabeller tillkommer i schema.prisma.
|
|
|
|
SET FOREIGN_KEY_CHECKS = 0;
|
|
|
|
DELETE FROM `FlyerSelection`;
|
|
DELETE FROM `FlyerItem`;
|
|
DELETE FROM `FlyerSession`;
|
|
|
|
DELETE FROM `ShoppingListItem`;
|
|
DELETE FROM `ShoppingList`;
|
|
|
|
DELETE FROM `InventoryTransaction`;
|
|
DELETE FROM `InventoryItem`;
|
|
|
|
DELETE FROM `RecipeIngredient`;
|
|
DELETE FROM `Recipe`;
|
|
|
|
DELETE FROM `PantryItem`;
|
|
DELETE FROM `MealPlanItem`;
|
|
|
|
DELETE FROM `Product`;
|
|
|
|
SET FOREIGN_KEY_CHECKS = 1;
|