From 006f54255f56e285e6a563ea86db049084853ff7 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Fri, 1 Dec 2023 13:31:17 -0500 Subject: [PATCH] Fix migration for event table Didn't autogenerate, oops --- .../858e0d45876f_create_event_table.py | 46 +++++++++++++++++++ .../d6917765911f_create_event_table.py | 24 ---------- 2 files changed, 46 insertions(+), 24 deletions(-) create mode 100644 migrations/versions/858e0d45876f_create_event_table.py delete mode 100644 migrations/versions/d6917765911f_create_event_table.py diff --git a/migrations/versions/858e0d45876f_create_event_table.py b/migrations/versions/858e0d45876f_create_event_table.py new file mode 100644 index 0000000..736364a --- /dev/null +++ b/migrations/versions/858e0d45876f_create_event_table.py @@ -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 ### diff --git a/migrations/versions/d6917765911f_create_event_table.py b/migrations/versions/d6917765911f_create_event_table.py deleted file mode 100644 index da2a817..0000000 --- a/migrations/versions/d6917765911f_create_event_table.py +++ /dev/null @@ -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