feat(backend): initial Alembic migration for 4 tables (issue #11) - #132
Merged
Conversation
- Adiciona dependência alembic e configura alembic.ini + migrations/ - env.py consome Base.metadata e a URL via pydantic-settings - Cria core/config.py (Settings) e refatora db/base.py para usar settings - Migration 0c14cfa628c3 cria tenant, application, user e tenant_user - Testes de Settings (default e override via DATABASE_URL) Refs issue #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Contexto
Versionamento do schema do PostgreSQL central via Alembic, tornando-o reprodutível em dev, CI e AWS. Configuração centralizada da URL do banco via
pydantic-settings.Fixes #11
Tipo de Mudança
Critérios de aceite
alembic revision --autogenerategera migration criando as 4 tabelasalembic upgrade headaplica sem erroalembic downgrade -1reverte a migrationComo Testar
docker compose -f infra/docker-compose.base.yml up -d postgrescd saas_backend && poetry installpoetry run alembic upgrade headdocker exec infra-postgres-1 psql -U linx -d linx -c "\dt"(listatenant,application,user,tenant_user)poetry run alembic downgrade -1(reverte)Checklist de Qualidade: