
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = '11890f58b1df'
down_revision = '4d4b95748173'


def upgrade():
    op.create_table(
        'tracks',
        sa.Column('id', sa.Integer(), nullable=False, index=True),
        sa.Column('title', sa.String(), nullable=False),
        sa.Column('event_id', sa.Integer(), nullable=False),
        sa.Column('position', sa.Integer(), nullable=False),
        sa.Column('description', sa.Text(), nullable=False),
        sa.ForeignKeyConstraint(['event_id'], ['events.events.id']),
        sa.PrimaryKeyConstraint('id'),
        schema='events'
    )


def downgrade():
    op.drop_table('tracks', schema='events')


import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = '11890f58b1df'
down_revision = '4d4b95748173'


def upgrade():
    op.create_table(
        'tracks',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('title', sa.String(), nullable=False),
        sa.Column('event_id', sa.Integer(), nullable=False, index=True),
        sa.Column('position', sa.Integer(), nullable=False),
        sa.Column('description', sa.Text(), nullable=False),
        sa.ForeignKeyConstraint(['event_id'], ['events.events.id']),
        sa.PrimaryKeyConstraint('id'),
        schema='events'
    )


def downgrade():
    op.drop_table('tracks', schema='events')

Fix incorrect indexes in alembic revision
Fix incorrect indexes in alembic revision

  
  import sqlalchemy as sa
  from alembic import op
  
  
  # revision identifiers, used by Alembic.
  revision = '11890f58b1df'
  down_revision = '4d4b95748173'
  
  
  def upgrade():
      op.create_table(
          'tracks',
-         sa.Column('id', sa.Integer(), nullable=False, index=True),
+         sa.Column('id', sa.Integer(), nullable=False),
          sa.Column('title', sa.String(), nullable=False),
-         sa.Column('event_id', sa.Integer(), nullable=False),
+         sa.Column('event_id', sa.Integer(), nullable=False, index=True),
          sa.Column('position', sa.Integer(), nullable=False),
          sa.Column('description', sa.Text(), nullable=False),
          sa.ForeignKeyConstraint(['event_id'], ['events.events.id']),
          sa.PrimaryKeyConstraint('id'),
          schema='events'
      )
  
  
  def downgrade():
      op.drop_table('tracks', schema='events')
  
Fix incorrect indexes in alembic revision
## Code Before:

import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = '11890f58b1df'
down_revision = '4d4b95748173'


def upgrade():
    op.create_table(
        'tracks',
        sa.Column('id', sa.Integer(), nullable=False, index=True),
        sa.Column('title', sa.String(), nullable=False),
        sa.Column('event_id', sa.Integer(), nullable=False),
        sa.Column('position', sa.Integer(), nullable=False),
        sa.Column('description', sa.Text(), nullable=False),
        sa.ForeignKeyConstraint(['event_id'], ['events.events.id']),
        sa.PrimaryKeyConstraint('id'),
        schema='events'
    )


def downgrade():
    op.drop_table('tracks', schema='events')

## Instruction:
Fix incorrect indexes in alembic revision
## Code After:

import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = '11890f58b1df'
down_revision = '4d4b95748173'


def upgrade():
    op.create_table(
        'tracks',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('title', sa.String(), nullable=False),
        sa.Column('event_id', sa.Integer(), nullable=False, index=True),
        sa.Column('position', sa.Integer(), nullable=False),
        sa.Column('description', sa.Text(), nullable=False),
        sa.ForeignKeyConstraint(['event_id'], ['events.events.id']),
        sa.PrimaryKeyConstraint('id'),
        schema='events'
    )


def downgrade():
    op.drop_table('tracks', schema='events')
