def downgrade():
op.drop_table('inpatientlocation')
op.drop_table('inpatientadmission')
op.create_table('inpatientepisode',
sa.Column('id', sa.INTEGER(), nullable=False),
sa.Column('updated', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('datetime_of_admission', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
sa.Column('datetime_of_discharge', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('visit_number', sa.VARCHAR(length=250), autoincrement=False, nullable=False),
sa.Column('admission_diagnosis', sa.VARCHAR(length=250), autoincrement=False, nullable=True),
sa.Column('gloss_reference_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['gloss_reference_id'], [u'glossolaliareference.id'], name=u'inpatientepisode_gloss_reference_id_fkey'),
sa.PrimaryKeyConstraint('id', name=u'inpatientepisode_pkey')
)
op.create_table('inpatientlocation',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('updated', sa.DateTime(), nullable=True),
sa.Column('created', sa.DateTime(), nullable=True),
sa.Column('inpatient_episode_id', sa.Integer(), nullable=True),
sa.Column('datetime_of_transfer', sa.DateTime(), nullable=True),
sa.Column('ward_code', sa.String(length=250), nullable=True),
sa.Column('room_code', sa.String(length=250), nullable=True),
sa.Column('bed_code', sa.String(length=250), nullable=True),
sa.ForeignKeyConstraint(['inpatient_episode_id'], ['inpatientepisode.id'], ),
sa.PrimaryKeyConstraint('id')
)
### end Alembic commands ###
评论列表
文章目录