lucyparsons / OpenOversight

Police oversight and accountability through public data 👮
https://openoversight.com
GNU General Public License v3.0
240 stars 79 forks source link

Use Flask-Migrate in `Makefile` #1132

Closed michplunkett closed 1 week ago

michplunkett commented 2 weeks ago

Description of Changes

If we are using Flask-Migrate commands everywhere else, we shouldn't make an exception for the Makefile.

Tests and Linting

(env) michaelp@MacBook-Air-18 OpenOversight % make create_db
docker compose build
WARN[0000] The "AWS_DEFAULT_REGION" variable is not set. Defaulting to a blank string.
WARN[0000] The "AWS_SECRET_ACCESS_KEY" variable is not set. Defaulting to a blank string.
WARN[0000] The "AWS_ACCESS_KEY_ID" variable is not set. Defaulting to a blank string.
WARN[0000] The "S3_BUCKET_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "APPROVE_REGISTRATIONS" variable is not set. Defaulting to a blank string.
[+] Building 0.6s (25/25) FINISHED                                                                                                                                                         docker:desktop-linux
 ...
Postgres is up
## Creating database
docker compose run --rm web flask db stamp head
...
INFO  [sqlalchemy.engine.Engine] COMMIT
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
(env) michaelp@MacBook-Air-18 OpenOversight %
michplunkett commented 1 week ago

I'll take a look and see what that looks like for Make.

michplunkett commented 1 week ago

Looks like that functionality is a little more complicated with Makefiles: https://stackoverflow.com/a/45003119