chore(migrations): inicialización de Alembic y migración inicial del esquema#6
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Este PR incorpora el andamiaje de Alembic/Flask-Migrate en el backend para habilitar versionado del esquema y aplicar una migración inicial que materializa los modelos SQLAlchemy en PostgreSQL.
Changes:
- Se agrega el entorno de migraciones de Alembic (
backend/migrations/) con configuración, template y entorno de ejecución. - Se incluye una migración inicial (
9decfc36853f) que crea las tablas base del dominio (categorías, ciudades, usuarios, vacantes, habilidades, relaciones, snapshots, alertas y backups). - Se fuerza la importación de
app.modelsdurante elcreate_apppara asegurar que elmetadataincluya todas las tablas al generar migraciones.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| backend/migrations/versions/9decfc36853f_initial_database_migration.py | Migra el esquema inicial creando todas las tablas y constraints. |
| backend/migrations/script.py.mako | Template para generar nuevos scripts de migración. |
| backend/migrations/README | README default de Alembic/Flask-Migrate para single DB. |
| backend/migrations/env.py | Configura el runtime de Alembic para Flask-Migrate (online/offline, metadata, autogenerate). |
| backend/migrations/alembic.ini | Configuración base de logging de Alembic. |
| backend/migrations/.gitkeep | Remueve placeholder ya innecesario tras agregar archivos reales. |
| backend/app/init.py | Importa modelos en el factory para que Alembic detecte el metadata completo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3
to
+5
| Revision ID: 9decfc36853f | ||
| Revises: Elias Ochoa | ||
| Create Date: 2026-06-09 17:38:16 p.m. |
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.
feature/alembic-migrations
Descripción
Se integra Flask-Migrate (Alembic) para establecer el control de versiones de la base de datos y se materializan los modelos de SQLAlchemy en el motor físico de PostgreSQL.
Fases de ejecución integradas:
flask db init), estableciendo la configuración estructural en el directoriomigrations/.9decfc36853f) validando la lectura de los 9 modelos expuestos en la capa de datos (Category,City,Skill,Job,JobSkill,User,Alert,TrendSnapshot,Backup).upgradehacia la base de datos, inyectando las entidades estructuradas y la tabla de rastreo de versiones (alembic_version) sin colisiones de restricciones o dependencias.Tipo de cambio
Cómo probar
git checkout develop && git pull origin developcd backendskillstat_dev) esté corriendo y conectado en tu archivo.env.flask db upgrade\dtChecklist