chore(deploy): add database maintenance and migration options
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
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
-- 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;
|
||||
Reference in New Issue
Block a user