diff options
author | 2016-12-04 07:24:45 +0200 | |
---|---|---|
committer | 2016-12-04 07:25:29 +0200 | |
commit | a46c779bf33cf558d287f8bcf11a5e483046bb17 (patch) | |
tree | 7b4862f4bf30dbf41a2bdece5347cce3694267be /backend | |
parent | models: Use sqlalchemy Unicode columns instead of String (diff) | |
download | grumpy-a46c779bf33cf558d287f8bcf11a5e483046bb17.tar.gz grumpy-a46c779bf33cf558d287f8bcf11a5e483046bb17.tar.bz2 grumpy-a46c779bf33cf558d287f8bcf11a5e483046bb17.zip |
models: Add Maintainer model
As this is a new table, just re-doing "./manage.py init" should add it to db,
while keeping old data.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/lib/models.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/backend/lib/models.py b/backend/lib/models.py index 57f3e64..bc6cd20 100644 --- a/backend/lib/models.py +++ b/backend/lib/models.py @@ -30,3 +30,14 @@ class PackageVersion(db.Model): def __repr__(self): return "<PackageVersion '%s/%s-%s'>" % (self.package.category.name, self.package.name, self.version) + +class Maintainer(db.Model): + id = db.Column(db.Integer, primary_key=True) + email = db.Column(db.Unicode(50), nullable=False, unique=True) + is_project = db.Column(db.Boolean, nullable=False, server_default='f', default=False) + name = db.Column(db.Unicode(128)) + url = db.Column(db.Unicode()) + description = db.Column(db.Unicode(500)) + + def __repr__(self): + return "<Maintainer %s '%s'>" % ("project" if self.is_project else "individual", self.email) |