diff --git a/migrations/versions/19d198151caf_add_shoe_size.py b/migrations/versions/19d198151caf_add_shoe_size.py deleted file mode 100644 index 674b620..0000000 --- a/migrations/versions/19d198151caf_add_shoe_size.py +++ /dev/null @@ -1,29 +0,0 @@ -"""add shoe size - -Revision ID: 19d198151caf -Revises: 20da26039edf -Create Date: 2023-05-19 13:41:45.070918 - -""" -from alembic import op -import sqlalchemy as sa -import sqlmodel - - -# revision identifiers, used by Alembic. -revision = '19d198151caf' -down_revision = '20da26039edf' -branch_labels = None -depends_on = None - - -def upgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('hero', sa.Column('shoe_size', sa.Integer(), nullable=True)) - # ### end Alembic commands ### - - -def downgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.drop_column('hero', 'shoe_size') - # ### end Alembic commands ### diff --git a/migrations/versions/20da26039edf_name_the_pet.py b/migrations/versions/20da26039edf_name_the_pet.py deleted file mode 100644 index 168f8ce..0000000 --- a/migrations/versions/20da26039edf_name_the_pet.py +++ /dev/null @@ -1,31 +0,0 @@ -"""name the pet - -Revision ID: 20da26039edf -Revises: 44fbe5f1a689 -Create Date: 2023-05-18 11:18:35.748333 - -""" -from alembic import op -import sqlalchemy as sa -import sqlmodel - - -# revision identifiers, used by Alembic. -revision = '20da26039edf' -down_revision = '44fbe5f1a689' -branch_labels = None -depends_on = None - - -def upgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.drop_column('hero', 'new_attribute') - op.add_column('pet', sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=False)) - # ### end Alembic commands ### - - -def downgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.drop_column('pet', 'name') - op.add_column('hero', sa.Column('new_attribute', sa.VARCHAR(), nullable=True)) - # ### end Alembic commands ### diff --git a/migrations/versions/29ab77485a4d_new_attribute.py b/migrations/versions/29ab77485a4d_new_attribute.py deleted file mode 100644 index fda8f79..0000000 --- a/migrations/versions/29ab77485a4d_new_attribute.py +++ /dev/null @@ -1,29 +0,0 @@ -"""New Attribute - -Revision ID: 29ab77485a4d -Revises: fe841f5746e5 -Create Date: 2023-05-18 11:09:53.112601 - -""" -from alembic import op -import sqlalchemy as sa -import sqlmodel - - -# revision identifiers, used by Alembic. -revision = '29ab77485a4d' -down_revision = 'fe841f5746e5' -branch_labels = None -depends_on = None - - -def upgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('hero', sa.Column('new_attribute', sqlmodel.sql.sqltypes.AutoString(), nullable=True)) - # ### end Alembic commands ### - - -def downgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.drop_column('hero', 'new_attribute') - # ### end Alembic commands ### diff --git a/migrations/versions/2a221363b5f8_init.py b/migrations/versions/2a221363b5f8_init.py new file mode 100644 index 0000000..278cb31 --- /dev/null +++ b/migrations/versions/2a221363b5f8_init.py @@ -0,0 +1,44 @@ +"""init + +Revision ID: 2a221363b5f8 +Revises: +Create Date: 2023-05-21 20:52:12.693194 + +""" +from alembic import op +import sqlalchemy as sa +import sqlmodel + + +# revision identifiers, used by Alembic. +revision = '2a221363b5f8' +down_revision = None +branch_labels = None +depends_on = None + + +def upgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('pet', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=False), + sa.PrimaryKeyConstraint('id') + ) + op.create_table('hero', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=False), + sa.Column('secret_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False), + sa.Column('age', sa.Integer(), nullable=True), + sa.Column('shoe_size', sa.Integer(), nullable=True), + sa.Column('pet_id', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['pet_id'], ['pet.id'], ), + sa.PrimaryKeyConstraint('id') + ) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('hero') + op.drop_table('pet') + # ### end Alembic commands ### diff --git a/migrations/versions/44fbe5f1a689_new.py b/migrations/versions/44fbe5f1a689_new.py deleted file mode 100644 index fc337dd..0000000 --- a/migrations/versions/44fbe5f1a689_new.py +++ /dev/null @@ -1,29 +0,0 @@ -"""new - -Revision ID: 44fbe5f1a689 -Revises: 29ab77485a4d -Create Date: 2023-05-18 11:17:08.071058 - -""" -from alembic import op -import sqlalchemy as sa -import sqlmodel - - -# revision identifiers, used by Alembic. -revision = '44fbe5f1a689' -down_revision = '29ab77485a4d' -branch_labels = None -depends_on = None - - -def upgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - pass - # ### end Alembic commands ### - - -def downgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - pass - # ### end Alembic commands ### diff --git a/migrations/versions/fe841f5746e5_initial_migration.py b/migrations/versions/fe841f5746e5_initial_migration.py deleted file mode 100644 index 4323ae9..0000000 --- a/migrations/versions/fe841f5746e5_initial_migration.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Initial Migration - -Revision ID: fe841f5746e5 -Revises: -Create Date: 2023-05-18 11:07:41.700265 - -""" -from alembic import op -import sqlalchemy as sa -import sqlmodel - -# revision identifiers, used by Alembic. -revision = "fe841f5746e5" -down_revision = None -branch_labels = None -depends_on = None - - -def upgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.create_table( - "hero", - sa.Column("id", sa.Integer(), nullable=False), - sa.Column("name", sqlmodel.sql.sqltypes.AutoString(), nullable=False), - sa.Column("secret_name", sqlmodel.sql.sqltypes.AutoString(), nullable=False), - sa.Column("age", sa.Integer(), nullable=True), - sa.PrimaryKeyConstraint("id"), - ) - op.create_table( - "pet", - sa.Column("id", sa.Integer(), nullable=False), - sa.PrimaryKeyConstraint("id"), - ) - # ### end Alembic commands ### - - -def downgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.drop_table("pet") - op.drop_table("hero") - # ### end Alembic commands ###