From 8f3750060b225aea58ef808974f4a55632519000 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Mon, 30 May 2022 18:50:46 +0200 Subject: [PATCH] VARCHAR requires a length in mysql --- app/migrations/versions/f6a6004bf4b9_add_user_associations.py | 2 +- app/models/user.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/migrations/versions/f6a6004bf4b9_add_user_associations.py b/app/migrations/versions/f6a6004bf4b9_add_user_associations.py index e084687..44c0c9c 100644 --- a/app/migrations/versions/f6a6004bf4b9_add_user_associations.py +++ b/app/migrations/versions/f6a6004bf4b9_add_user_associations.py @@ -17,7 +17,7 @@ import sqlalchemy as sa def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('order', sa.Column('association', sa.String(length=120), server_default='', nullable=False)) - op.add_column('user', sa.Column('associations', sa.String(), server_default='', nullable=False)) + op.add_column('user', sa.Column('associations', sa.String(length=255), server_default='', nullable=False)) # ### end Alembic commands ### diff --git a/app/models/user.py b/app/models/user.py index 6f6a372..974fb81 100644 --- a/app/models/user.py +++ b/app/models/user.py @@ -11,7 +11,7 @@ class User(db.Model): admin = db.Column(db.Boolean) bias = db.Column(db.Integer) # Assocation logic - associations = db.Column(db.String(), nullable=False, server_default="") + associations = db.Column(db.String(255), nullable=False, server_default="") # Relations runs = db.relation(