Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions migrations/versions/817fd86459da_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""empty message

Revision ID: 817fd86459da
Revises: f54fe3d57be0
Create Date: 2026-06-15 18:46:49.450552

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '817fd86459da'
down_revision = 'f54fe3d57be0'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('company', schema=None) as batch_op:
batch_op.add_column(sa.Column('name', sa.String(length=120), nullable=True))
batch_op.add_column(sa.Column('is_active', sa.Boolean(), nullable=True))

with op.batch_alter_table('user', schema=None) as batch_op:
batch_op.add_column(sa.Column('name', sa.String(length=120), nullable=True))
batch_op.alter_column('is_active',
existing_type=sa.BOOLEAN(),
nullable=True)

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('user', schema=None) as batch_op:
batch_op.alter_column('is_active',
existing_type=sa.BOOLEAN(),
nullable=False)
batch_op.drop_column('name')

with op.batch_alter_table('company', schema=None) as batch_op:
batch_op.drop_column('is_active')
batch_op.drop_column('name')

# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"""Añadidos modelos de Company y Event

Revision ID: f54fe3d57be0
Revises: 0763d677d453
Create Date: 2026-06-12 18:01:19.961335

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'f54fe3d57be0'
down_revision = '0763d677d453'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('company',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('email', sa.String(length=120), nullable=False),
sa.Column('password', sa.String(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email')
)
op.create_table('event',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('title', sa.String(length=120), nullable=False),
sa.Column('description', sa.Text(), nullable=False),
sa.Column('date', sa.DateTime(), nullable=False),
sa.Column('location', sa.String(length=250), nullable=False),
sa.Column('price', sa.Float(), nullable=False),
sa.Column('capacity', sa.Integer(), nullable=False),
sa.Column('category', sa.String(length=80), nullable=False),
sa.Column('image_url', sa.String(length=500), nullable=True),
sa.Column('is_active', sa.Boolean(), nullable=False),
sa.Column('company_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['company_id'], ['company.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('event')
op.drop_table('company')
# ### end Alembic commands ###
Loading