cabotage / cabotage-app

MIT License
28 stars 8 forks source link

infra: add migration generation target #104

Closed JacobCoffee closed 1 month ago

JacobCoffee commented 2 months ago

Description

Adds Make target to generate new migrations with an arbitrary message

Details ``` cabotage-app on  roll [πŸ“βœ“] via πŸ‹ orbstack via  pyenv (cabotage-app) on ☁️ (us-east-2) βœ— make migrations "cool migration" docker-compose exec cabotage-app python3 -m flask db revision --autogenerate -m "cool migration" patching kubernetes.watch.watch.iter_resp_lines patched kubernetes.watch.watch.iter_resp_lines πŸ™ˆ INFO [alembic.runtime.migration] Context impl PostgresqlImpl. INFO [alembic.runtime.migration] Will assume transactional DDL. INFO [alembic.autogenerate.compare] Detected removed table 'resources_certificate' INFO [alembic.autogenerate.compare] Detected removed table 'resources_postgres' INFO [alembic.autogenerate.compare] Detected removed table 'resources_redis' INFO [alembic.autogenerate.compare] Detected removed table 'resources_ingress' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_certificate_version_end_transaction_id' on 'resources_certificate_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_certificate_version_operation_type' on 'resources_certificate_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_certificate_version_transaction_id' on 'resources_certificate_version' INFO [alembic.autogenerate.compare] Detected removed table 'resources_certificate_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_version_end_transaction_id' on 'resources_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_version_operation_type' on 'resources_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_version_transaction_id' on 'resources_version' INFO [alembic.autogenerate.compare] Detected removed table 'resources_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_redis_version_end_transaction_id' on 'resources_redis_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_redis_version_operation_type' on 'resources_redis_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_redis_version_transaction_id' on 'resources_redis_version' INFO [alembic.autogenerate.compare] Detected removed table 'resources_redis_version' INFO [alembic.autogenerate.compare] Detected removed table 'resources' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_ingress_version_end_transaction_id' on 'resources_ingress_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_ingress_version_operation_type' on 'resources_ingress_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_ingress_version_transaction_id' on 'resources_ingress_version' INFO [alembic.autogenerate.compare] Detected removed table 'resources_ingress_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_postgres_version_end_transaction_id' on 'resources_postgres_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_postgres_version_operation_type' on 'resources_postgres_version' INFO [alembic.autogenerate.compare] Detected removed index 'ix_resources_postgres_version_transaction_id' on 'resources_postgres_version' INFO [alembic.autogenerate.compare] Detected removed table 'resources_postgres_version' INFO [alembic.ddl.postgresql] Detected sequence named 'activity_id_seq' as owned by integer column 'activity(id)', assuming SERIAL and omitting INFO [alembic.ddl.postgresql] Detected sequence named 'transaction_id_seq' as owned by integer column 'transaction(id)', assuming SERIAL and omitting Generating /opt/cabotage-app/src/migrations/versions/c84a45cbb991_cool_migration.py ... done ```

Reference to issue

Closes #103 ### Review request

Breaking changes