diff options
author | 2016-12-04 06:48:07 +0200 | |
---|---|---|
committer | 2016-12-04 06:48:07 +0200 | |
commit | 20275e6f354929fe3d702fb9b296f828704eb5a1 (patch) | |
tree | 41b5c041e22d7a08967cf3d93a1e7cea27b7e1a8 | |
parent | Turn off flask-sqlalchemy modification tracking to silence a warning and save... (diff) | |
download | grumpy-20275e6f354929fe3d702fb9b296f828704eb5a1.tar.gz grumpy-20275e6f354929fe3d702fb9b296f828704eb5a1.tar.bz2 grumpy-20275e6f354929fe3d702fb9b296f828704eb5a1.zip |
models: Use sqlalchemy Unicode columns instead of String
-rw-r--r-- | backend/lib/models.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backend/lib/models.py b/backend/lib/models.py index 8f7637d..57f3e64 100644 --- a/backend/lib/models.py +++ b/backend/lib/models.py @@ -3,15 +3,15 @@ from .. import db class Category(db.Model): id = db.Column(db.Integer, primary_key=True) - name = db.Column(db.String(30), unique=True, nullable=False) - description = db.Column(db.String(500)) + name = db.Column(db.Unicode(30), unique=True, nullable=False) + description = db.Column(db.Unicode(500)) def __repr__(self): return "<Category %r>" % self.name class Package(db.Model): id = db.Column(db.Integer, primary_key=True) - name = db.Column(db.String(128), nullable=False) + name = db.Column(db.Unicode(128), nullable=False) category_id = db.Column(db.Integer, db.ForeignKey('category.id'), nullable=False) category = db.relationship('Category', backref=db.backref('packages', lazy='dynamic')) @@ -24,7 +24,7 @@ class Package(db.Model): class PackageVersion(db.Model): id = db.Column(db.Integer, primary_key=True) - version = db.Column(db.String(128), nullable=False) + version = db.Column(db.Unicode(128), nullable=False) package_id = db.Column(db.Integer, db.ForeignKey('package.id'), nullable=False) package = db.relationship('Package', backref=db.backref('versions', lazy='dynamic')) |