2017-07-27 01:17:28 +02:00
|
|
|
"""empty message
|
|
|
|
|
2017-07-29 17:43:09 +02:00
|
|
|
Revision ID: 92ffc9941fd9
|
2017-07-27 01:17:28 +02:00
|
|
|
Revises:
|
2017-07-29 17:43:09 +02:00
|
|
|
Create Date: 2017-07-29 12:31:47.687234
|
2017-07-27 01:17:28 +02:00
|
|
|
|
|
|
|
"""
|
|
|
|
from alembic import op
|
|
|
|
import sqlalchemy as sa
|
|
|
|
|
|
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
2017-07-29 17:43:09 +02:00
|
|
|
revision = '92ffc9941fd9'
|
2017-07-27 01:17:28 +02:00
|
|
|
down_revision = None
|
|
|
|
branch_labels = None
|
|
|
|
depends_on = None
|
|
|
|
|
|
|
|
|
|
|
|
def upgrade():
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
|
|
op.create_table('accounts',
|
|
|
|
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
|
|
|
|
sa.Column('updated_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
|
2017-07-29 17:43:09 +02:00
|
|
|
sa.Column('id', sa.String(), nullable=False),
|
2017-07-27 01:17:28 +02:00
|
|
|
sa.Column('remote_display_name', sa.String(), nullable=True),
|
2017-07-29 17:43:09 +02:00
|
|
|
sa.Column('remote_screen_name', sa.String(), nullable=True),
|
2017-07-27 01:17:28 +02:00
|
|
|
sa.Column('remote_avatar_url', sa.String(), nullable=True),
|
2017-07-29 17:43:09 +02:00
|
|
|
sa.Column('last_fetch', sa.DateTime(), server_default='epoch', nullable=True),
|
|
|
|
sa.PrimaryKeyConstraint('id', name=op.f('pk_accounts'))
|
2017-07-27 01:17:28 +02:00
|
|
|
)
|
|
|
|
op.create_table('oauth_tokens',
|
|
|
|
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
|
|
|
|
sa.Column('updated_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
|
|
|
|
sa.Column('token', sa.String(), nullable=False),
|
|
|
|
sa.Column('token_secret', sa.String(), nullable=False),
|
2017-07-29 17:43:09 +02:00
|
|
|
sa.Column('account_id', sa.String(), nullable=True),
|
|
|
|
sa.ForeignKeyConstraint(['account_id'], ['accounts.id'], name=op.f('fk_oauth_tokens_account_id_accounts')),
|
2017-07-27 01:17:28 +02:00
|
|
|
sa.PrimaryKeyConstraint('token', name=op.f('pk_oauth_tokens'))
|
|
|
|
)
|
2017-07-27 20:20:59 +02:00
|
|
|
op.create_table('posts',
|
|
|
|
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
|
|
|
|
sa.Column('updated_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
|
2017-07-29 17:43:09 +02:00
|
|
|
sa.Column('id', sa.String(), nullable=False),
|
2017-07-27 20:20:59 +02:00
|
|
|
sa.Column('body', sa.String(), nullable=True),
|
2017-07-29 17:43:09 +02:00
|
|
|
sa.Column('author_id', sa.String(), nullable=True),
|
|
|
|
sa.ForeignKeyConstraint(['author_id'], ['accounts.id'], name=op.f('fk_posts_author_id_accounts')),
|
|
|
|
sa.PrimaryKeyConstraint('id', name=op.f('pk_posts'))
|
2017-07-27 20:20:59 +02:00
|
|
|
)
|
2017-07-27 01:17:28 +02:00
|
|
|
op.create_table('sessions',
|
|
|
|
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
|
|
|
|
sa.Column('updated_at', sa.DateTime(), server_default=sa.text('now()'), nullable=True),
|
|
|
|
sa.Column('id', sa.String(), nullable=False),
|
2017-07-27 20:20:59 +02:00
|
|
|
sa.Column('account_id', sa.String(), nullable=True),
|
2017-07-29 17:43:09 +02:00
|
|
|
sa.ForeignKeyConstraint(['account_id'], ['accounts.id'], name=op.f('fk_sessions_account_id_accounts')),
|
2017-07-27 01:17:28 +02:00
|
|
|
sa.PrimaryKeyConstraint('id', name=op.f('pk_sessions'))
|
|
|
|
)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
|
|
|
|
|
|
def downgrade():
|
|
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
|
|
op.drop_table('sessions')
|
2017-07-27 20:20:59 +02:00
|
|
|
op.drop_table('posts')
|
2017-07-27 01:17:28 +02:00
|
|
|
op.drop_table('oauth_tokens')
|
|
|
|
op.drop_table('accounts')
|
|
|
|
# ### end Alembic commands ###
|