mattermore/migrations/versions/49d24a3cb696_.py

46 lines
1.3 KiB
Python
Raw Permalink Normal View History

2019-02-13 20:31:21 +01:00
"""Initial migration
Revision ID: 49d24a3cb696
Revises:
Create Date: 2019-02-13 19:22:05.984105
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '49d24a3cb696'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('quote',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('quoter', sa.String(length=255), nullable=False),
sa.Column('quotee', sa.String(length=255), nullable=True),
sa.Column('channel', sa.String(length=255), nullable=False),
2019-02-13 23:29:21 +01:00
sa.Column('quote', sa.String(length=16383), nullable=False),
2019-02-13 20:31:21 +01:00
sa.Column('created_at', sa.DateTime(), nullable=False),
2019-02-13 22:58:19 +01:00
sa.PrimaryKeyConstraint('id')
2019-02-13 20:31:21 +01:00
)
op.create_table('user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('username', sa.String(length=255), nullable=False),
sa.Column('authorized', sa.Boolean(), nullable=True),
sa.Column('admin', sa.Boolean(), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('username')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('user')
op.drop_table('quote')
# ### end Alembic commands ###