Rename user table from auth_user
to users_user
#2016
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: #2015 should be reviewed first
What are the relevant tickets?
Part of https://github.com/mitodl/hq/issues/6679
Description (What does it do?)
This renames the table as described. Additionally a Postgres view is created so the table is still accessible under the previous name so we don't see errors during deployment.
How can this be tested?
docker compose exec db pg_dump --file=/mnt/backups/dump.sql -U postgres -W -d postgres
auth_user
table should be renamed tousers_user
.SELECT * from django_content_type WHERE model = 'user';
should show that theapp_label
has been updated to"users"
Be sure to
./manage.py migrate users 0001
before switching back to other branches