Update Config local to remote name
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
|
||||
## When to Use
|
||||
|
||||
Run database migrations for ProductionLocal environment, apply pending EF Core migrations, create backups (MANDATORY), and verify connectivity.
|
||||
Run database migrations for ProductionRemote environment, apply pending EF Core migrations, create backups (MANDATORY), and verify connectivity.
|
||||
|
||||
⚠️ **WARNING**: Production environment - exercise extreme caution.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- .NET SDK installed (`dotnet --version`)
|
||||
- PostgreSQL accessible for ProductionLocal
|
||||
- Connection string in `appsettings.ProductionLocal.json`
|
||||
- PostgreSQL accessible for ProductionRemote
|
||||
- Connection string in `appsettings.ProductionRemote.json`
|
||||
- `scripts/safe-migrate.sh` available and executable
|
||||
- ⚠️ Production access permissions required
|
||||
|
||||
@@ -26,7 +26,7 @@ Check: `test -f scripts/safe-migrate.sh`
|
||||
|
||||
### Step 2: Verify Environment Configuration
|
||||
|
||||
Check: `test -f src/Managing.Api/appsettings.ProductionLocal.json`
|
||||
Check: `test -f src/Managing.Api/appsettings.ProductionRemote.json`
|
||||
|
||||
**If missing:** Check `appsettings.Production.json`, else **STOP**
|
||||
|
||||
@@ -34,7 +34,7 @@ Check: `test -f src/Managing.Api/appsettings.ProductionLocal.json`
|
||||
|
||||
⚠️ **CRITICAL**: Verify authorization, reviewed migrations, rollback plan, backup will be created.
|
||||
|
||||
**Ask user:** "⚠️ You are about to run migrations on ProductionLocal. Are you sure? (yes/no)"
|
||||
**Ask user:** "⚠️ You are about to run migrations on ProductionRemote. Are you sure? (yes/no)"
|
||||
|
||||
**If confirmed:** Continue
|
||||
|
||||
@@ -42,7 +42,7 @@ Check: `test -f src/Managing.Api/appsettings.ProductionLocal.json`
|
||||
|
||||
### Step 4: Run Migration Script
|
||||
|
||||
Run: `./scripts/safe-migrate.sh ProductionLocal`
|
||||
Run: `./scripts/safe-migrate.sh ProductionRemote`
|
||||
|
||||
**Script performs:** Build → Check connectivity → Create DB if needed → Prompt backup (always choose 'y') → Check pending changes → Generate script → Show for review → Wait confirmation → Apply → Verify
|
||||
|
||||
@@ -56,7 +56,7 @@ Run: `./scripts/safe-migrate.sh ProductionLocal`
|
||||
|
||||
**Not executable:** `chmod +x scripts/safe-migrate.sh`, retry
|
||||
|
||||
**Database connection fails:** Verify PostgreSQL running, check connection string in `appsettings.ProductionLocal.json`, verify network/firewall/credentials, ⚠️ **WARN** production connectivity issues require immediate attention
|
||||
**Database connection fails:** Verify PostgreSQL running, check connection string in `appsettings.ProductionRemote.json`, verify network/firewall/credentials, ⚠️ **WARN** production connectivity issues require immediate attention
|
||||
|
||||
**Build fails:** Show errors (C# compilation, missing dependencies, config errors), try auto-fix (compilation errors, imports, config), if fixed re-run else **STOP** with ⚠️ **WARN** never deploy broken code
|
||||
|
||||
@@ -73,7 +73,7 @@ Run: `./scripts/safe-migrate.sh ProductionLocal`
|
||||
2. Check executable → ✅
|
||||
3. Verify config → ✅
|
||||
4. Safety check → User confirms
|
||||
5. Run: `./scripts/safe-migrate.sh ProductionLocal`
|
||||
5. Run: `./scripts/safe-migrate.sh ProductionRemote`
|
||||
6. Script: Build → Connect → Backup → Generate → Review → Confirm → Apply → Verify → ✅
|
||||
7. Show backup/log locations, remind to verify functionality
|
||||
|
||||
@@ -88,8 +88,8 @@ Run: `./scripts/safe-migrate.sh ProductionLocal`
|
||||
- ⚠️ ⚠️ ⚠️ **PRODUCTION** - Extreme caution required
|
||||
- ✅ Backup MANDATORY, review script before applying, verify functionality after
|
||||
- ✅ Idempotent migrations - safe to run multiple times
|
||||
- ⚠️ Environment: `ProductionLocal`, Config: `appsettings.ProductionLocal.json`
|
||||
- ⚠️ Backups: `scripts/backups/ProductionLocal/`, Logs: `scripts/logs/`
|
||||
- ⚠️ Environment: `ProductionRemote`, Config: `appsettings.ProductionRemote.json`
|
||||
- ⚠️ Backups: `scripts/backups/ProductionRemote/`, Logs: `scripts/logs/`
|
||||
- 📦 Keeps last 5 backups automatically
|
||||
- 🚨 Have rollback plan, test in non-prod first, monitor after migration
|
||||
|
||||
|
||||
Reference in New Issue
Block a user