Skip to content

Commit

Permalink
Merge pull request #509 from dbca-wa/xzzy-patch-10
Browse files Browse the repository at this point in the history
Create migration_steps.md
  • Loading branch information
xzzy authored Jan 8, 2025
2 parents 25472fd + dd95d38 commit 3364a0d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions migration_steps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

Step 1: Create new database.

#Mooring Licensing Migration (DEV)
CREATE DATABASE mooringlicensing_mig_dev;
CREATE USER mooringlicensing_mig_dev WITH PASSWORD '<password>';
GRANT ALL PRIVILEGES ON DATABASE "mooringlicensing_mig_dev" to mooringlicensing_mig_dev;
\c mooringlicensing_mig_dev
create extension postgis;
GRANT ALL ON ALL TABLES IN SCHEMA public TO mooringlicensing_mig_dev;
GRANT ALL ON SCHEMA public TO mooringlicensing_mig_dev;


Step 2: apply patches
vi venv/lib/python3.12/site-packages/django/contrib/admin/migrations/0001_initial.py (see changes in patch_for_admin_0001_initial.patch)

vi venv/lib/python3.12/site-packages/reversion/migrations/0001_squashed_0004_auto_20160611_1202.py (see changes in patch_for_reversion_0001.patch)

Step 3: Run Migrations

./manage_ml.py migrate auth
./manage_ml.py migrate ledger_api_client
./manage_ml.py migrate admin
./manage_ml.py migrate django_cron
./manage_ml.py migrate sites
./manage_ml.py migrate sessions
./manage_ml.py migrate

Step 4 Apply Fixutures
./manage_ml.py loaddata mooringlicensing/fixtures/mooring_mooring_bay.json

./manage_ml.py loaddata mooringlicensing/fixtures/ml_fixtures.json


Step 5 run migrations script
python ./manage_ml.py ml_migration_script --path ~/datamigration/outpath04122024/ >> ~/datamigration/outpath04122024/migration_run_08012024.log 2>&1

0 comments on commit 3364a0d

Please sign in to comment.