Fix migration for event table
Didn't autogenerate, oops
This commit is contained in:
parent
1432d0d7fb
commit
006f54255f
2 changed files with 46 additions and 24 deletions
46
migrations/versions/858e0d45876f_create_event_table.py
Normal file
46
migrations/versions/858e0d45876f_create_event_table.py
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
"""create_event_table
|
||||||
|
|
||||||
|
Revision ID: 858e0d45876f
|
||||||
|
Revises: 261c004968a4
|
||||||
|
Create Date: 2023-12-01 13:31:00.955470
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '858e0d45876f'
|
||||||
|
down_revision = '261c004968a4'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.create_table('event',
|
||||||
|
sa.Column('id', sa.Integer(), nullable=False),
|
||||||
|
sa.Column('name', sa.String(), nullable=False),
|
||||||
|
sa.Column('description', sa.String(), nullable=True),
|
||||||
|
sa.Column('location', sa.String(), nullable=False),
|
||||||
|
sa.Column('start_time', sa.DateTime(), nullable=False),
|
||||||
|
sa.Column('end_time', sa.DateTime(), nullable=False),
|
||||||
|
sa.Column('category', sa.String(), nullable=True),
|
||||||
|
sa.PrimaryKeyConstraint('id')
|
||||||
|
)
|
||||||
|
op.create_table('event_checkins',
|
||||||
|
sa.Column('id', sa.Integer(), nullable=False),
|
||||||
|
sa.Column('event_id', sa.Integer(), nullable=False),
|
||||||
|
sa.Column('user_id', sa.Integer(), nullable=False),
|
||||||
|
sa.ForeignKeyConstraint(['event_id'], ['event.id'], ),
|
||||||
|
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
|
||||||
|
sa.PrimaryKeyConstraint('id')
|
||||||
|
)
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_table('event_checkins')
|
||||||
|
op.drop_table('event')
|
||||||
|
# ### end Alembic commands ###
|
|
@ -1,24 +0,0 @@
|
||||||
"""create event table
|
|
||||||
|
|
||||||
Revision ID: d6917765911f
|
|
||||||
Revises: 261c004968a4
|
|
||||||
Create Date: 2023-12-01 13:22:41.055221
|
|
||||||
|
|
||||||
"""
|
|
||||||
from alembic import op
|
|
||||||
import sqlalchemy as sa
|
|
||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
|
||||||
revision = 'd6917765911f'
|
|
||||||
down_revision = '261c004968a4'
|
|
||||||
branch_labels = None
|
|
||||||
depends_on = None
|
|
||||||
|
|
||||||
|
|
||||||
def upgrade():
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def downgrade():
|
|
||||||
pass
|
|
Loading…
Add table
Reference in a new issue