
# revision identifiers, used by Alembic.
revision = '19b8969073ab'
down_revision = '2b7153fe25af'

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.create_table(
        'latest_green_build',
        sa.Column('id', sa.GUID(), nullable=False),
        sa.Column('project_id', sa.GUID(), nullable=False),
        sa.Column('branch', sa.String(length=128), nullable=False),
        sa.Column('build_id', sa.GUID(), nullable=False),
        sa.PrimaryKeyConstraint('id'),
        sa.ForeignKeyConstraint(['project_id'], ['project.id'], ),
        sa.ForeignKeyConstraint(['build_id'], ['build.id'], ),
        sa.UniqueConstraint('project_id', 'branch', name='unq_project_branch')
    )


def downgrade():
    op.drop_table('latest_green_build')


# revision identifiers, used by Alembic.
revision = '19b8969073ab'
down_revision = '4d235d421320'

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.create_table(
        'latest_green_build',
        sa.Column('id', sa.GUID(), nullable=False),
        sa.Column('project_id', sa.GUID(), nullable=False),
        sa.Column('branch', sa.String(length=128), nullable=False),
        sa.Column('build_id', sa.GUID(), nullable=False),
        sa.PrimaryKeyConstraint('id'),
        sa.ForeignKeyConstraint(['project_id'], ['project.id'], ),
        sa.ForeignKeyConstraint(['build_id'], ['build.id'], ),
        sa.UniqueConstraint('project_id', 'branch', name='unq_project_branch')
    )


def downgrade():
    op.drop_table('latest_green_build')

Update latest green build migration
Update latest green build migration

  
  # revision identifiers, used by Alembic.
  revision = '19b8969073ab'
- down_revision = '2b7153fe25af'
+ down_revision = '4d235d421320'
  
  from alembic import op
  import sqlalchemy as sa
  
  
  def upgrade():
      op.create_table(
          'latest_green_build',
          sa.Column('id', sa.GUID(), nullable=False),
          sa.Column('project_id', sa.GUID(), nullable=False),
          sa.Column('branch', sa.String(length=128), nullable=False),
          sa.Column('build_id', sa.GUID(), nullable=False),
          sa.PrimaryKeyConstraint('id'),
          sa.ForeignKeyConstraint(['project_id'], ['project.id'], ),
          sa.ForeignKeyConstraint(['build_id'], ['build.id'], ),
          sa.UniqueConstraint('project_id', 'branch', name='unq_project_branch')
      )
  
  
  def downgrade():
      op.drop_table('latest_green_build')
  
Update latest green build migration
## Code Before:

# revision identifiers, used by Alembic.
revision = '19b8969073ab'
down_revision = '2b7153fe25af'

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.create_table(
        'latest_green_build',
        sa.Column('id', sa.GUID(), nullable=False),
        sa.Column('project_id', sa.GUID(), nullable=False),
        sa.Column('branch', sa.String(length=128), nullable=False),
        sa.Column('build_id', sa.GUID(), nullable=False),
        sa.PrimaryKeyConstraint('id'),
        sa.ForeignKeyConstraint(['project_id'], ['project.id'], ),
        sa.ForeignKeyConstraint(['build_id'], ['build.id'], ),
        sa.UniqueConstraint('project_id', 'branch', name='unq_project_branch')
    )


def downgrade():
    op.drop_table('latest_green_build')

## Instruction:
Update latest green build migration
## Code After:

# revision identifiers, used by Alembic.
revision = '19b8969073ab'
down_revision = '4d235d421320'

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.create_table(
        'latest_green_build',
        sa.Column('id', sa.GUID(), nullable=False),
        sa.Column('project_id', sa.GUID(), nullable=False),
        sa.Column('branch', sa.String(length=128), nullable=False),
        sa.Column('build_id', sa.GUID(), nullable=False),
        sa.PrimaryKeyConstraint('id'),
        sa.ForeignKeyConstraint(['project_id'], ['project.id'], ),
        sa.ForeignKeyConstraint(['build_id'], ['build.id'], ),
        sa.UniqueConstraint('project_id', 'branch', name='unq_project_branch')
    )


def downgrade():
    op.drop_table('latest_green_build')
