improved database models

projects
Domeniko Gentner 4 years ago
parent fdec8f74c8
commit f20873ab0f
  1. 2
      labertasche/models/t_comments.py
  2. 2
      labertasche/models/t_emails.py
  3. 2
      labertasche/models/t_location.py
  4. 14
      labertasche/models/t_projects.py

@ -16,7 +16,7 @@ class TComments(db.Model):
__table_args__ = {'useexisting': True}
# primary key
comments_id = db.Column(db.Integer, primary_key=True)
comments_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
# foreign keys
location_id = db.Column(db.Integer, ForeignKey('t_location.id_location'), nullable=False)

@ -16,7 +16,7 @@ class TEmail(db.Model):
__table_args__ = {'useexisting': True}
# primary key
id_email = db.Column(db.Integer, primary_key=True)
id_email = db.Column(db.Integer, primary_key=True, autoincrement=True)
# data
email = db.Column(db.Integer, unique=True)

@ -16,7 +16,7 @@ class TLocation(db.Model):
__table_args__ = {'useexisting': True}
# primary key
id_location = db.Column(db.Integer, primary_key=True)
id_location = db.Column(db.Integer, primary_key=True, autoincrement=True)
# data
location = db.Column(db.Text, nullable=False, unique=True)

@ -15,7 +15,17 @@ class TProjects(db.Model):
__table_args__ = {'useexisting': True}
# primary key
id_project = db.Column(db.Integer, primary_key=True)
id_project = db.Column(db.Integer, primary_key=True, autoincrement=True)
# data
name = db.Column(db.Text, nullable=True, unique=True)
name = db.Column(db.Text, nullable=False, unique=True)
weburl = db.Column(db.Text, nullable=False)
blogurl = db.Column(db.Text, nullable=False)
output = db.Column(db.Text, nullable=False)
sendotp = db.Column(db.Boolean, nullable=False)
gravatar_cache = db.Column(db.Boolean, nullable=False)
gravatar_cache_dir = db.Column(db.Text, nullable=True)
gravatar_size = db.Column(db.Integer, nullable=True)
addon_smileys = db.Column(db.Boolean, nullable=False, default=True)

Loading…
Cancel
Save