db tools: Rename do-destroy-*database.

The new tools now have more concise, more parallel names:

    - rebuild-dev-database
    - rebuild-test-database

The actual implementations are still pretty different:

rebuild-dev-database:
    mostly delegates to 5 management scripts

rebuild-test-database:
    is a very thin wrapper for generate-fixtures

We'll try to clean that up a bit soon.
This commit is contained in:
Steve Howell
2020-04-21 20:03:12 +00:00
committed by Tim Abbott
parent 67d0349239
commit 54151bb548
7 changed files with 15 additions and 12 deletions

View File

@@ -242,9 +242,9 @@ else
fi
./scripts/setup/configure-rabbitmq
./tools/setup/postgres-init-dev-db
./tools/do-destroy-rebuild-database
./tools/rebuild-dev-database
./tools/setup/postgres-init-test-db
./tools/do-destroy-rebuild-test-database
./tools/rebuild-test-database
./manage.py compilemessages
```

View File

@@ -32,7 +32,7 @@ the development environment][authentication-dev-server].
database with different test data, are documented in-app at
`https://localhost:9991/devtools`.
* If you want to restore your development environment's database to a
pristine state, you can use `./tools/do-destroy-rebuild-database`.
pristine state, you can use `./tools/rebuild-dev-database`.
## Server

View File

@@ -246,7 +246,7 @@ extension is handled by `tools/postgres-init-dev-db` (invoked by
`tools/provision`). That file also manages setting up the
development postgresql user.
`tools/provision` also invokes `tools/do-destroy-rebuild-database`
`tools/provision` also invokes `tools/rebuild-dev-database`
to create the actual database with its schema.
### Thumbor and thumbnailing

View File

@@ -149,9 +149,12 @@ If you follow the processes described above, `tools/provision` and
migrations and run migrations on (`./manage.py migrate`) or rebuild
the relevant database automatically as appropriate.
Developing migrations can result in manual fiddling that leads to a
broken database state, however. For those situations, we have
`tools/do-destroy-rebuild-test-database` and
`tools/do-destroy-rebuild-database` available to rebuild the databases
used for `test-backend` and [manual testing](../development/using.md),
respectively.
While developing migrations, you may accidentally corrupt
your databases while debugging your new code.
You can always rebuild these databases from scratch.
Use `tools/rebuild-test-database` to rebuild the database
used for `test-backend` and other automated tests.
Use `tools/rebuild-dev-database` to rebuild the database
used in [manual testing](../development/using.md).

View File

@@ -213,7 +213,7 @@ def main(options: argparse.Namespace) -> int:
dev_template_db_status = DEV_DATABASE.template_status()
if options.is_force or dev_template_db_status == 'needs_rebuild':
run(["tools/setup/postgres-init-dev-db"])
run(["tools/do-destroy-rebuild-database"])
run(["tools/rebuild-dev-database"])
elif dev_template_db_status == 'run_migrations':
DEV_DATABASE.run_db_migrations()
elif dev_template_db_status == 'current':
@@ -222,7 +222,7 @@ def main(options: argparse.Namespace) -> int:
test_template_db_status = TEST_DATABASE.template_status()
if options.is_force or test_template_db_status == 'needs_rebuild':
run(["tools/setup/postgres-init-test-db"])
run(["tools/do-destroy-rebuild-test-database"])
run(["tools/rebuild-test-database"])
elif test_template_db_status == 'run_migrations':
TEST_DATABASE.run_db_migrations()
elif test_template_db_status == 'current':