text: """initialize
  
  Revision ID: f3622e20dd86
  Revises: 
  Create Date: 2019-03-18 14:11:22.386217
  
  """
  from alembic import op
  import sqlalchemy as sa
  
  
  # revision identifiers, used by Alembic.
  revision = 'f3622e20dd86'
  down_revision = None
  branch_labels = None
  depends_on = None
  
  
  def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.create_table('dataset',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('name', sa.String(length=128), nullable=False),
      sa.Column('created', sa.DateTime(), nullable=False),
      sa.Column('md5sum', sa.String(length=32), nullable=False),
      sa.PrimaryKeyConstraint('id'),
      sa.UniqueConstraint('md5sum'),
      sa.UniqueConstraint('name')
      )
      op.create_table('user',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('username', sa.String(length=80), nullable=False),
      sa.Column('email', sa.String(length=256), nullable=False),
      sa.Column('password_hash', sa.String(length=128), nullable=False),
      sa.Column('last_active', sa.DateTime(), nullable=False),
      sa.PrimaryKeyConstraint('id'),
      sa.UniqueConstraint('email'),
      sa.UniqueConstraint('username')
      )
      op.create_table('task',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('done', sa.Boolean(), nullable=False),
      sa.Column('annotated_on', sa.DateTime(), nullable=True),
      sa.Column('annotator_id', sa.Integer(), nullable=True),
      sa.Column('dataset_id', sa.Integer(), nullable=True),
      sa.ForeignKeyConstraint(['annotator_id'], ['user.id'], ),
      sa.ForeignKeyConstraint(['dataset_id'], ['dataset.id'], ),
      sa.PrimaryKeyConstraint('id')
      )
      op.create_table('annotation',
      sa.Column('id', sa.Integer(), nullable=False),
      sa.Column('time_start', sa.Integer(), nullable=True),
      sa.Column('time_end', sa.Integer(), nullable=True),
      sa.Column('task_id', sa.Integer(), nullable=True),
      sa.ForeignKeyConstraint(['task_id'], ['task.id'], ),
      sa.PrimaryKeyConstraint('id')
      )
      # ### end Alembic commands ###
  
  
  def downgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_table('annotation')
      op.drop_table('task')
      op.drop_table('user')
      op.drop_table('dataset')
      # ### end Alembic commands ###
  