Some comments

This commit is contained in:
Stephan Porada 2020-04-27 10:30:38 +02:00
parent a879558ec4
commit 76e7d65017

View File

@ -28,6 +28,7 @@ class Role(db.Model):
__tablename__ = 'roles' __tablename__ = 'roles'
# Primary key # Primary key
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
# Fields
default = db.Column(db.Boolean, default=False, index=True) default = db.Column(db.Boolean, default=False, index=True)
name = db.Column(db.String(64), unique=True) name = db.Column(db.String(64), unique=True)
permissions = db.Column(db.Integer) permissions = db.Column(db.Integer)
@ -103,12 +104,14 @@ class User(UserMixin, db.Model):
__tablename__ = 'users' __tablename__ = 'users'
# Primary key # Primary key
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
# Fields
confirmed = db.Column(db.Boolean, default=False) confirmed = db.Column(db.Boolean, default=False)
email = db.Column(db.String(254), unique=True, index=True) email = db.Column(db.String(254), unique=True, index=True)
password_hash = db.Column(db.String(128)) password_hash = db.Column(db.String(128))
registration_date = db.Column(db.DateTime(), default=datetime.utcnow) registration_date = db.Column(db.DateTime(), default=datetime.utcnow)
role_id = db.Column(db.Integer, db.ForeignKey('roles.id')) role_id = db.Column(db.Integer, db.ForeignKey('roles.id'))
username = db.Column(db.String(64), unique=True, index=True) username = db.Column(db.String(64), unique=True, index=True)
# Setting Fields
setting_dark_mode = db.Column(db.Boolean, default=False) setting_dark_mode = db.Column(db.Boolean, default=False)
# Relationships # Relationships
corpora = db.relationship('Corpus', backref='creator', lazy='dynamic', corpora = db.relationship('Corpus', backref='creator', lazy='dynamic',
@ -233,6 +236,7 @@ class JobInput(db.Model):
__tablename__ = 'job_inputs' __tablename__ = 'job_inputs'
# Primary key # Primary key
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
# Fields
filename = db.Column(db.String(255)) filename = db.Column(db.String(255))
dir = db.Column(db.String(255)) dir = db.Column(db.String(255))
job_id = db.Column(db.Integer, db.ForeignKey('jobs.id')) job_id = db.Column(db.Integer, db.ForeignKey('jobs.id'))
@ -256,6 +260,7 @@ class JobResult(db.Model):
__tablename__ = 'job_results' __tablename__ = 'job_results'
# Primary key # Primary key
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
# Fields
filename = db.Column(db.String(255)) filename = db.Column(db.String(255))
dir = db.Column(db.String(255)) dir = db.Column(db.String(255))
job_id = db.Column(db.Integer, db.ForeignKey('jobs.id')) job_id = db.Column(db.Integer, db.ForeignKey('jobs.id'))
@ -279,6 +284,7 @@ class Job(db.Model):
__tablename__ = 'jobs' __tablename__ = 'jobs'
# Primary key # Primary key
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
# Fields
creation_date = db.Column(db.DateTime(), default=datetime.utcnow) creation_date = db.Column(db.DateTime(), default=datetime.utcnow)
description = db.Column(db.String(255)) description = db.Column(db.String(255))
end_date = db.Column(db.DateTime()) end_date = db.Column(db.DateTime())
@ -349,6 +355,7 @@ class CorpusFile(db.Model):
__tablename__ = 'corpus_files' __tablename__ = 'corpus_files'
# Primary key # Primary key
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
# Fields
address = db.Column(db.String(255)) address = db.Column(db.String(255))
author = db.Column(db.String(255)) author = db.Column(db.String(255))
booktitle = db.Column(db.String(255)) booktitle = db.Column(db.String(255))
@ -395,6 +402,7 @@ class Corpus(db.Model):
__tablename__ = 'corpora' __tablename__ = 'corpora'
# Primary key # Primary key
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
# Fields
creation_date = db.Column(db.DateTime(), default=datetime.utcnow) creation_date = db.Column(db.DateTime(), default=datetime.utcnow)
description = db.Column(db.String(255)) description = db.Column(db.String(255))
status = db.Column(db.String(16)) status = db.Column(db.String(16))