Subir todos los cambios recientes a la rama principal
This commit is contained in:
28
backend/alembic/versions/add_clients_table.py
Normal file
28
backend/alembic/versions/add_clients_table.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Add clients table
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import inspect
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "add_clients_table"
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
def upgrade():
|
||||
bind = op.get_bind()
|
||||
inspector = inspect(bind)
|
||||
if 'clients' not in inspector.get_table_names():
|
||||
op.create_table(
|
||||
'clients',
|
||||
sa.Column('id', sa.Integer, primary_key=True, autoincrement=True),
|
||||
sa.Column('name', sa.String, nullable=False),
|
||||
sa.Column('email', sa.String, nullable=False, unique=True),
|
||||
sa.Column('phone', sa.String, nullable=False),
|
||||
)
|
||||
|
||||
def downgrade():
|
||||
op.drop_table('clients')
|
||||
20
backend/alembic/versions/add_system_id_to_tickets.py
Normal file
20
backend/alembic/versions/add_system_id_to_tickets.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
Agregar columna system_id a la tabla tickets
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
# Revisión ID y dependencias
|
||||
revision = 'add_system_id_to_tickets'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
def upgrade():
|
||||
"""Agregar columna system_id a la tabla tickets."""
|
||||
op.add_column('tickets', sa.Column('system_id', sa.UUID, nullable=True))
|
||||
|
||||
def downgrade():
|
||||
"""Eliminar columna system_id de la tabla tickets."""
|
||||
op.drop_column('tickets', 'system_id')
|
||||
18
backend/alembic/versions/add_updated_at_to_category.py
Normal file
18
backend/alembic/versions/add_updated_at_to_category.py
Normal file
@@ -0,0 +1,18 @@
|
||||
"""
|
||||
Add updated_at column to ticket_categories
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "add_updated_at_to_category"
|
||||
down_revision = "add_clients_table"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
def upgrade():
|
||||
op.add_column("ticket_categories", sa.Column("updated_at", sa.DateTime(timezone=True), nullable=True))
|
||||
|
||||
def downgrade():
|
||||
op.drop_column("ticket_categories", "updated_at")
|
||||
Reference in New Issue
Block a user