55 lines
2.1 KiB
Python
55 lines
2.1 KiB
Python
"""empty message
|
|
|
|
Revision ID: c3faafd828ad
|
|
Revises:
|
|
Create Date: 2017-07-27 01:16:34.114238
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'c3faafd828ad'
|
|
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),
|
|
sa.Column('remote_id', sa.String(), nullable=False),
|
|
sa.Column('remote_display_name', sa.String(), nullable=True),
|
|
sa.Column('remote_avatar_url', sa.String(), nullable=True),
|
|
sa.PrimaryKeyConstraint('remote_id', name=op.f('pk_accounts'))
|
|
)
|
|
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),
|
|
sa.Column('remote_id', sa.String(), nullable=True),
|
|
sa.ForeignKeyConstraint(['remote_id'], ['accounts.remote_id'], name=op.f('fk_oauth_tokens_remote_id_accounts')),
|
|
sa.PrimaryKeyConstraint('token', name=op.f('pk_oauth_tokens'))
|
|
)
|
|
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),
|
|
sa.Column('remote_id', sa.String(), nullable=True),
|
|
sa.ForeignKeyConstraint(['remote_id'], ['accounts.remote_id'], name=op.f('fk_sessions_remote_id_accounts')),
|
|
sa.PrimaryKeyConstraint('id', name=op.f('pk_sessions'))
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table('sessions')
|
|
op.drop_table('oauth_tokens')
|
|
op.drop_table('accounts')
|
|
# ### end Alembic commands ###
|