Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete create_db.py #1000

Merged
merged 18 commits into from
Aug 1, 2023
Merged

Delete create_db.py #1000

merged 18 commits into from
Aug 1, 2023

Conversation

michplunkett
Copy link
Collaborator

@michplunkett michplunkett commented Jul 31, 2023

Fixes issue

#675

Description of Changes

Removed create_db.py file, moved the logic to the Alembic file, and created constants for the code around my changes.

Notes for Deployment

If it works in development, it SHOULD work in production.

Tests and linting

  • This branch is up-to-date with the develop branch.
  • pytest passes on my local development environment.
  • pre-commit passes on my local development environment.
  • Ran the make default command and there were not any issues.
make dev output
% make dev
docker-compose build
...
WARN[0000] The "APPROVE_REGISTRATIONS" variable is not set. Defaulting to a blank string. 
[+] Running 2/0
 ✔ Container openoversight-postgres-1  Running                                                                                                                                                             0.0s 
 ✔ Container openoversight-web-1       Running                                                                                                                                                             0.0s 
Postgres is up
## Creating database
docker-compose run --rm web alembic --config=./OpenOversight/migrations/alembic.ini stamp head
...
Postgres is up
## Populate database with test data
docker-compose run --rm web python ./test_data.py -p
...
2023-08-01 21:43:54,796 INFO sqlalchemy.engine.Engine [generated in 0.00006s] {'pk_1': 1}
[*] Completed successfully!
% 

@michplunkett michplunkett self-assigned this Jul 31, 2023
@michplunkett michplunkett linked an issue Jul 31, 2023 that may be closed by this pull request
@michplunkett michplunkett marked this pull request as ready for review July 31, 2023 20:19
@null-space-0 null-space-0 self-requested a review August 1, 2023 20:38
Copy link

@null-space-0 null-space-0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anything that raises concerns. The checks look good, and I trust it working in dev will mean it'll likely work once moved into production.

@michplunkett
Copy link
Collaborator Author

I'll run make dev one more time just to confirm everything is 💯!

@michplunkett
Copy link
Collaborator Author

Ran it twice and we're g2g!

@michplunkett michplunkett merged commit 495a9a0 into develop Aug 1, 2023
2 checks passed
@michplunkett michplunkett deleted the create_db_script branch August 1, 2023 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

replace create_db.py with alembic upgrade head
2 participants