university-final-iot-backend/migrations/versions/5aa58dcd7a2c_.py

37 lines
1.0 KiB
Python

"""empty message
Revision ID: 5aa58dcd7a2c
Revises: efbd47fca2fd
Create Date: 2018-09-20 01:29:06.797906
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '5aa58dcd7a2c'
down_revision = 'efbd47fca2fd'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('dashboards',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('dashboard_data', postgresql.JSON(astext_type=sa.Text()), nullable=False),
sa.Column('account_id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.Column('modified_at', sa.DateTime(), nullable=False),
sa.ForeignKeyConstraint(['account_id'], ['accounts.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('dashboards')
# ### end Alembic commands ###