Compare commits

..

1 Commits

Author SHA1 Message Date
4e67b8a966
extend language name
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-02 21:44:38 +02:00
2 changed files with 7 additions and 7 deletions

View File

@ -175,7 +175,7 @@ class ProfileSearchtopic(db.Model):
class Language(db.Model): class Language(db.Model):
__tablename__ = "language" __tablename__ = "language"
id = Column(String(4), primary_key=True) id = Column(String(2), primary_key=True)
name = Column(String(100), nullable=False) name = Column(String(100), nullable=False)
profiles = relationship("ProfileLanguage", back_populates="language") profiles = relationship("ProfileLanguage", back_populates="language")
@ -188,7 +188,7 @@ class ProfileLanguage(db.Model):
__tablename__ = "profile_language" __tablename__ = "profile_language"
profile_id = Column(Integer, ForeignKey("profile.id"), primary_key=True) profile_id = Column(Integer, ForeignKey("profile.id"), primary_key=True)
language_id = Column(String(4), ForeignKey("language.id"), primary_key=True) language_id = Column(String(2), ForeignKey("language.id"), primary_key=True)
level = Column(SmallInteger, nullable=False) level = Column(SmallInteger, nullable=False)
profile = relationship("Profile", back_populates="languages") profile = relationship("Profile", back_populates="languages")

View File

@ -1,8 +1,8 @@
"""Initial migration. """Initial migration.
Revision ID: 9183e2335b05 Revision ID: 07fb02e49575
Revises: Revises:
Create Date: 2021-08-02 21:51:30.400680 Create Date: 2021-08-02 21:43:42.035286
""" """
from alembic import op from alembic import op
@ -10,7 +10,7 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = '9183e2335b05' revision = '07fb02e49575'
down_revision = None down_revision = None
branch_labels = None branch_labels = None
depends_on = None depends_on = None
@ -24,7 +24,7 @@ def upgrade():
sa.PrimaryKeyConstraint('id') sa.PrimaryKeyConstraint('id')
) )
op.create_table('language', op.create_table('language',
sa.Column('id', sa.String(length=4), nullable=False), sa.Column('id', sa.String(length=2), nullable=False),
sa.Column('name', sa.String(length=100), nullable=False), sa.Column('name', sa.String(length=100), nullable=False),
sa.PrimaryKeyConstraint('id') sa.PrimaryKeyConstraint('id')
) )
@ -71,7 +71,7 @@ def upgrade():
) )
op.create_table('profile_language', op.create_table('profile_language',
sa.Column('profile_id', sa.Integer(), nullable=False), sa.Column('profile_id', sa.Integer(), nullable=False),
sa.Column('language_id', sa.String(length=4), nullable=False), sa.Column('language_id', sa.String(length=2), nullable=False),
sa.Column('level', sa.SmallInteger(), nullable=False), sa.Column('level', sa.SmallInteger(), nullable=False),
sa.ForeignKeyConstraint(['language_id'], ['language.id'], ), sa.ForeignKeyConstraint(['language_id'], ['language.id'], ),
sa.ForeignKeyConstraint(['profile_id'], ['profile.id'], ), sa.ForeignKeyConstraint(['profile_id'], ['profile.id'], ),