From 9a1f3f842ad819963dd83c946cf610b965bae68a Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Mon, 2 Aug 2021 21:44:38 +0200 Subject: [PATCH] extend language name --- ki/models.py | 6 +++--- ...igration.py => 9183e2335b05_initial_migration.py} | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) rename migrations/versions/{6269064f6b51_initial_migration.py => 9183e2335b05_initial_migration.py} (94%) diff --git a/ki/models.py b/ki/models.py index c7a89c1..c8409ba 100644 --- a/ki/models.py +++ b/ki/models.py @@ -175,8 +175,8 @@ class ProfileSearchtopic(db.Model): class Language(db.Model): __tablename__ = "language" - id = Column(String(2), primary_key=True) - name = Column(String(25), nullable=False) + id = Column(String(4), primary_key=True) + name = Column(String(100), nullable=False) profiles = relationship("ProfileLanguage", back_populates="language") @@ -188,7 +188,7 @@ class ProfileLanguage(db.Model): __tablename__ = "profile_language" profile_id = Column(Integer, ForeignKey("profile.id"), primary_key=True) - language_id = Column(String(2), ForeignKey("language.id"), primary_key=True) + language_id = Column(String(4), ForeignKey("language.id"), primary_key=True) level = Column(SmallInteger, nullable=False) profile = relationship("Profile", back_populates="languages") diff --git a/migrations/versions/6269064f6b51_initial_migration.py b/migrations/versions/9183e2335b05_initial_migration.py similarity index 94% rename from migrations/versions/6269064f6b51_initial_migration.py rename to migrations/versions/9183e2335b05_initial_migration.py index 012c145..6c366c8 100644 --- a/migrations/versions/6269064f6b51_initial_migration.py +++ b/migrations/versions/9183e2335b05_initial_migration.py @@ -1,8 +1,8 @@ """Initial migration. -Revision ID: 6269064f6b51 +Revision ID: 9183e2335b05 Revises: -Create Date: 2021-08-02 21:28:50.484098 +Create Date: 2021-08-02 21:51:30.400680 """ from alembic import op @@ -10,7 +10,7 @@ import sqlalchemy as sa # revision identifiers, used by Alembic. -revision = '6269064f6b51' +revision = '9183e2335b05' down_revision = None branch_labels = None depends_on = None @@ -24,8 +24,8 @@ def upgrade(): sa.PrimaryKeyConstraint('id') ) op.create_table('language', - sa.Column('id', sa.String(length=2), nullable=False), - sa.Column('name', sa.String(length=25), nullable=False), + sa.Column('id', sa.String(length=4), nullable=False), + sa.Column('name', sa.String(length=100), nullable=False), sa.PrimaryKeyConstraint('id') ) op.create_table('profile', @@ -71,7 +71,7 @@ def upgrade(): ) op.create_table('profile_language', sa.Column('profile_id', sa.Integer(), nullable=False), - sa.Column('language_id', sa.String(length=2), nullable=False), + sa.Column('language_id', sa.String(length=4), nullable=False), sa.Column('level', sa.SmallInteger(), nullable=False), sa.ForeignKeyConstraint(['language_id'], ['language.id'], ), sa.ForeignKeyConstraint(['profile_id'], ['profile.id'], ),