Support old version of MySQL

This commit is contained in:
Michel Roux 2020-03-21 19:03:57 +01:00
parent 0d6ca75487
commit c6e5bb1bdd

View File

@ -8,13 +8,13 @@ from config import db
class AnimeFolder(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.Text(collation='utf8mb4_general_ci'), unique=True, nullable=False)
name = db.Column(db.String(length=100, collation='utf8mb4_general_ci'), unique=True, nullable=False)
titles = db.relationship("AnimeTitle", backref="folder")
class AnimeTitle(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.Text(collation='utf8mb4_general_ci'), unique=True, nullable=False)
name = db.Column(db.String(length=100, collation='utf8mb4_general_ci'), unique=True, nullable=False)
keyword = db.Column(db.Text(collation='utf8mb4_general_ci'), nullable=False)
folder_id = db.Column(db.Integer, db.ForeignKey('anime_folder.id'))
links = db.relationship('AnimeLink', backref="title")