Skip to content

Commit

Permalink
🗃️ Add migration for uuids
Browse files Browse the repository at this point in the history
  • Loading branch information
dankolbman committed Feb 17, 2018
1 parent 16b57ff commit c2386e8
Showing 1 changed file with 115 additions and 0 deletions.
115 changes: 115 additions & 0 deletions migrations/versions/9ff025c8ba49_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
"""
Change to pg UUID type for uuid fields
Revision ID: 9ff025c8ba49
Revises: 44b3990e821e
Create Date: 2018-02-17 09:35:18.574246
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '9ff025c8ba49'
down_revision = '44b3990e821e'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('aliquot', 'uuid',
existing_type=sa.VARCHAR(length=36),
type_=postgresql.UUID(),
existing_nullable=True)
op.alter_column('demographic', 'uuid',
existing_type=sa.VARCHAR(length=36),
type_=postgresql.UUID(),
existing_nullable=True)
op.alter_column('diagnosis', 'uuid',
existing_type=sa.VARCHAR(length=36),
type_=postgresql.UUID(),
existing_nullable=True)
op.alter_column('genomic_file', 'md5sum',
existing_type=sa.VARCHAR(length=36),
type_=postgresql.UUID(),
existing_nullable=True)
op.alter_column('genomic_file', 'uuid',
existing_type=sa.VARCHAR(length=36),
type_=postgresql.UUID(),
existing_nullable=True)
op.alter_column('outcome', 'uuid',
existing_type=sa.VARCHAR(length=36),
type_=postgresql.UUID(),
existing_nullable=True)
op.alter_column('participant', 'uuid',
existing_type=sa.VARCHAR(length=36),
type_=postgresql.UUID(),
existing_nullable=True)
op.alter_column('phenotype', 'uuid',
existing_type=sa.VARCHAR(length=36),
type_=postgresql.UUID(),
existing_nullable=True)
op.alter_column('sample', 'uuid',
existing_type=sa.VARCHAR(length=36),
type_=postgresql.UUID(),
existing_nullable=True)
op.alter_column('sequencing_experiment', 'uuid',
existing_type=sa.VARCHAR(length=36),
type_=postgresql.UUID(),
existing_nullable=True)
op.alter_column('study', 'uuid',
existing_type=sa.VARCHAR(length=36),
type_=postgresql.UUID(),
existing_nullable=True)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('study', 'uuid',
existing_type=postgresql.UUID(),
type_=sa.VARCHAR(length=36),
existing_nullable=True)
op.alter_column('sequencing_experiment', 'uuid',
existing_type=postgresql.UUID(),
type_=sa.VARCHAR(length=36),
existing_nullable=True)
op.alter_column('sample', 'uuid',
existing_type=postgresql.UUID(),
type_=sa.VARCHAR(length=36),
existing_nullable=True)
op.alter_column('phenotype', 'uuid',
existing_type=postgresql.UUID(),
type_=sa.VARCHAR(length=36),
existing_nullable=True)
op.alter_column('participant', 'uuid',
existing_type=postgresql.UUID(),
type_=sa.VARCHAR(length=36),
existing_nullable=True)
op.alter_column('outcome', 'uuid',
existing_type=postgresql.UUID(),
type_=sa.VARCHAR(length=36),
existing_nullable=True)
op.alter_column('genomic_file', 'uuid',
existing_type=postgresql.UUID(),
type_=sa.VARCHAR(length=36),
existing_nullable=True)
op.alter_column('genomic_file', 'md5sum',
existing_type=postgresql.UUID(),
type_=sa.VARCHAR(length=36),
existing_nullable=True)
op.alter_column('diagnosis', 'uuid',
existing_type=postgresql.UUID(),
type_=sa.VARCHAR(length=36),
existing_nullable=True)
op.alter_column('demographic', 'uuid',
existing_type=postgresql.UUID(),
type_=sa.VARCHAR(length=36),
existing_nullable=True)
op.alter_column('aliquot', 'uuid',
existing_type=postgresql.UUID(),
type_=sa.VARCHAR(length=36),
existing_nullable=True)
# ### end Alembic commands ###

0 comments on commit c2386e8

Please sign in to comment.