forked from polka_billy/porridger
Alembic installed and activated. Poems table added
This commit is contained in:
34
migrations/versions/18001c2231e3_poems_table_added.py
Normal file
34
migrations/versions/18001c2231e3_poems_table_added.py
Normal file
@ -0,0 +1,34 @@
|
||||
"""Poems table added
|
||||
|
||||
Revision ID: 18001c2231e3
|
||||
Revises: 33c5716276b5
|
||||
Create Date: 2023-07-23 22:50:16.055961
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '18001c2231e3'
|
||||
down_revision = '33c5716276b5'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('poems',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('poem_text', sa.String(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_poems_id'), 'poems', ['id'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_poems_id'), table_name='poems')
|
||||
op.drop_table('poems')
|
||||
# ### end Alembic commands ###
|
Reference in New Issue
Block a user