From 2d49c70f0f27375c6f8ca18ca45d4649229f0e73 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Mon, 2 Aug 2021 21:22:48 +0200 Subject: [PATCH] fix column type --- ki/models.py | 2 +- ...ial_migration.py => 6269064f6b51_initial_migration.py} | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename migrations/versions/{44b45a772abd_initial_migration.py => 6269064f6b51_initial_migration.py} (96%) diff --git a/ki/models.py b/ki/models.py index 9e80516..c7a89c1 100644 --- a/ki/models.py +++ b/ki/models.py @@ -188,7 +188,7 @@ class ProfileLanguage(db.Model): __tablename__ = "profile_language" profile_id = Column(Integer, ForeignKey("profile.id"), primary_key=True) - language_id = Column(Integer, ForeignKey("language.id"), primary_key=True) + language_id = Column(String(2), ForeignKey("language.id"), primary_key=True) level = Column(SmallInteger, nullable=False) profile = relationship("Profile", back_populates="languages") diff --git a/migrations/versions/44b45a772abd_initial_migration.py b/migrations/versions/6269064f6b51_initial_migration.py similarity index 96% rename from migrations/versions/44b45a772abd_initial_migration.py rename to migrations/versions/6269064f6b51_initial_migration.py index db8552e..012c145 100644 --- a/migrations/versions/44b45a772abd_initial_migration.py +++ b/migrations/versions/6269064f6b51_initial_migration.py @@ -1,8 +1,8 @@ """Initial migration. -Revision ID: 44b45a772abd +Revision ID: 6269064f6b51 Revises: -Create Date: 2021-07-06 21:19:44.217722 +Create Date: 2021-08-02 21:28:50.484098 """ from alembic import op @@ -10,7 +10,7 @@ import sqlalchemy as sa # revision identifiers, used by Alembic. -revision = '44b45a772abd' +revision = '6269064f6b51' down_revision = None branch_labels = None depends_on = None @@ -71,7 +71,7 @@ def upgrade(): ) op.create_table('profile_language', sa.Column('profile_id', sa.Integer(), nullable=False), - sa.Column('language_id', sa.Integer(), nullable=False), + sa.Column('language_id', sa.String(length=2), nullable=False), sa.Column('level', sa.SmallInteger(), nullable=False), sa.ForeignKeyConstraint(['language_id'], ['language.id'], ), sa.ForeignKeyConstraint(['profile_id'], ['profile.id'], ),