diff --git a/docs/developer/database-access.md b/docs/developer/database-access.md index e13f970b3..f77261bbb 100644 --- a/docs/developer/database-access.md +++ b/docs/developer/database-access.md @@ -58,10 +58,10 @@ cf ssh getgov-ENVIRONMENT ## Access certain table in the database 1. `cf connect-to-service getgov-ENVIRONMENT getgov-ENVIRONMENT-database` gets you into whichever environments database you'd like -2. `\c [table name here that starts cgaws];` connects to the [cgaws...etc] table +2. `\c [table name here that starts cgaws...etc];` connects to the [cgaws...etc] table 3. `\dt` retrieves information about that table and displays it 4. Make sure the table you are looking for exists. For this example, we are looking for `django_migrations` -5. Run `SELECT * FROM django_migrations` to see everything that's in it! +5. Run `SELECT * FROM django_migrations;` to see everything that's in it! ## Dropping and re-creating the database diff --git a/docs/developer/migration-troubleshooting.md b/docs/developer/migration-troubleshooting.md index e2208f860..51422d4c4 100644 --- a/docs/developer/migration-troubleshooting.md +++ b/docs/developer/migration-troubleshooting.md @@ -131,7 +131,7 @@ If you see `django.db.migrations.exceptions.InconsistentMigrationHistory` error, 1. Go to `database-access.md` to see the commands on how to access a certain table in the database. 2. In this case, we want to remove the migration "history" from the `django_migrations` table -3. Once you are in the `cgaws....` table, select the `django_migrations` table with the command `SELECT * FROM djangomigrations;` +3. Once you are in the `cgaws....` table, select the `django_migrations` table with the command `SELECT * FROM django_migrations;` 4. Find the id of the "history" you want to delete. In this example, the id would be 58. 5. Run `DELETE FROM django_migrations WHERE id=58;` where 58 is an example id as seen above. 6. Go to your shell and run `./manage.py showmigrations` to make sure your migrations are now back to the right state