<reponame>SBRG/lifelike
"""Create table for saving user imported worksheets

Revision ID: 09f100e842ad
Revises: <PASSWORD>
Create Date: 2020-07-29 22:41:17.703489

"""
from alembic import context
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '09f100e842ad'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('worksheets',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('filename', sa.String(length=200), nullable=False),
    sa.Column('sheetname', sa.String(length=200), nullable=False),
    sa.Column('neo4j_node_id', sa.Integer(), nullable=False),
    sa.Column('creation_date', sa.DateTime(), nullable=True),
    sa.Column('content_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['content_id'], ['files_content.id'], name=op.f('fk_worksheets_content_id_files_content'), ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_worksheets'))
    )
    # ### end Alembic commands ###
    if context.get_x_argument(as_dictionary=True).get('data_migrate', None):
        data_upgrades()


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('worksheets')
    # ### end Alembic commands ###
    # NOTE: In practice perfect downgrades are difficult and in some cases
    # impossible! It is more practical to use database backups/snapshots to
    # "downgrade" the database. Changes to the database that we intend to
    # push to production should always be added to a NEW migration.
    # (i.e. "downgrade forward"!)


def data_upgrades():
    """Add optional data upgrade migrations here"""
    pass


def data_downgrades():
    """Add optional data downgrade migrations here"""
    pass

"""Create table for saving user imported worksheets

Revision ID: 09f100e842ad
Revises: <PASSWORD>
Create Date: 2020-07-29 22:41:17.703489

"""
from alembic import context
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '09f100e842ad'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('worksheets',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('filename', sa.String(length=200), nullable=False),
    sa.Column('sheetname', sa.String(length=200), nullable=False),
    sa.Column('neo4j_node_id', sa.Integer(), nullable=False),
    sa.Column('creation_date', sa.DateTime(), nullable=True),
    sa.Column('content_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['content_id'], ['files_content.id'], name=op.f('fk_worksheets_content_id_files_content'), ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_worksheets'))
    )
    # ### end Alembic commands ###
    if context.get_x_argument(as_dictionary=True).get('data_migrate', None):
        data_upgrades()


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('worksheets')
    # ### end Alembic commands ###
    # NOTE: In practice perfect downgrades are difficult and in some cases
    # impossible! It is more practical to use database backups/snapshots to
    # "downgrade" the database. Changes to the database that we intend to
    # push to production should always be added to a NEW migration.
    # (i.e. "downgrade forward"!)


def data_upgrades():
    """Add optional data upgrade migrations here"""
    pass


def data_downgrades():
    """Add optional data downgrade migrations here"""
    pass
Create table for saving user imported worksheets  Revision ID: 09f100e842ad Revises: <PASSWORD> Create Date: 2020-07-29 22:41:17.703489 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # NOTE: In practice perfect downgrades are difficult and in some cases # impossible! It is more practical to use database backups/snapshots to # "downgrade" the database. Changes to the database that we intend to # push to production should always be added to a NEW migration. # (i.e. "downgrade forward"!) Add optional data upgrade migrations here Add optional data downgrade migrations here