Restructure the project for better organization and maintainability:
New structure:
./upgrade.sh - Main entry point (unchanged)
./lib/common.sh - Shared bash functions
./lib/python/ - Python utility scripts
./scripts/ - Workflow scripts (prepare_db, finalize_db)
./config/ - Configuration files (compose.yml)
./versions/{13..18}.0/ - Version-specific migration scripts
File renames:
- pre_migration_view_checking.py -> lib/python/check_views.py
- post_migration_fix_duplicated_views.py -> lib/python/fix_duplicated_views.py
- post_migration_cleanup_obsolete_modules.py -> lib/python/cleanup_modules.py
Benefits:
- Single entry point visible at root level
- Clear separation between shared code, scripts, and config
- Shorter, cleaner Python script names (context given by caller)
- Easier navigation and maintenance
21 lines
495 B
Bash
Executable File
21 lines
495 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
echo "Prepare migration to 18.0..."
|
|
|
|
# Copy database
|
|
copy_database ou17 ou18 ou18 || exit 1
|
|
|
|
# Execute SQL pre-migration commands
|
|
PRE_MIGRATE_SQL=$(cat <<'EOF'
|
|
UPDATE account_analytic_plan SET default_applicability=NULL WHERE default_applicability='optional';
|
|
EOF
|
|
)
|
|
echo "SQL command = $PRE_MIGRATE_SQL"
|
|
query_postgres_container "$PRE_MIGRATE_SQL" ou18 || exit 1
|
|
|
|
# Copy filestores
|
|
copy_filestore ou17 ou17 ou18 ou18 || exit 1
|
|
|
|
echo "Ready for migration to 18.0!"
|