extend skill name to 50 chars #58

This commit is contained in:
weeman 2021-11-22 20:11:58 +01:00
parent f0d05bbf22
commit 9dc9761a1a
Signed by: weeman
GPG Key ID: 34F0524D4DA694A1
3 changed files with 26 additions and 2 deletions

2
app.py
View File

@ -38,7 +38,7 @@ app.config["KI_LDAP_BASE_DN"] = os.getenv("KI_LDAP_BASE_DN")
CORS(app) CORS(app)
db = SQLAlchemy(app) db = SQLAlchemy(app)
migrate = Migrate(app, db) migrate = Migrate(app, db, compare_type=True)
logging.debug("Hello from KI") logging.debug("Hello from KI")

View File

@ -149,7 +149,7 @@ class Skill(db.Model):
__tablename__ = "skill" __tablename__ = "skill"
id = Column(Integer, primary_key=True) id = Column(Integer, primary_key=True)
name = Column(String(25), unique=True, nullable=False) name = Column(String(50), unique=True, nullable=False)
profiles = relationship("ProfileSkill", back_populates="skill") profiles = relationship("ProfileSkill", back_populates="skill")
searchtopics = relationship("ProfileSearchtopic", back_populates="skill") searchtopics = relationship("ProfileSearchtopic", back_populates="skill")

View File

@ -0,0 +1,24 @@
"""extend skill length to 50 chars
Revision ID: b5023977cbda
Revises: 459520b01f34
Create Date: 2021-11-22 20:07:19.188217
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b5023977cbda'
down_revision = '459520b01f34'
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table("skill") as batch_op:
batch_op.alter_column('name',
existing_type=sa.VARCHAR(length=25),
type_=sa.String(length=50),
existing_nullable=False)