|
@@ -18,9 +18,9 @@ class Person(db.Model):
|
18
|
18
|
__tablename__ = "people"
|
19
|
19
|
|
20
|
20
|
person_id = db.Column(db.Integer, primary_key=True)
|
21
|
|
- full_name = db.Column(db.String, nullable=False)
|
22
|
|
- display_name = db.Column(db.String, nullable=True)
|
23
|
|
- aardbei_id = db.Column(db.Integer, nullable=True)
|
|
21
|
+ full_name = db.Column(db.String, nullable=False, unique=True)
|
|
22
|
+ display_name = db.Column(db.String, nullable=True, unique=True)
|
|
23
|
+ aardbei_id = db.Column(db.Integer, nullable=True, unique=True)
|
24
|
24
|
active = db.Column(db.Boolean, nullable=False, default=False)
|
25
|
25
|
|
26
|
26
|
consumptions = db.relationship("Consumption", backref="person", lazy=True)
|
|
@@ -194,7 +194,7 @@ class ConsumptionType(db.Model):
|
194
|
194
|
__tablename__ = "consumption_types"
|
195
|
195
|
|
196
|
196
|
consumption_type_id = db.Column(db.Integer, primary_key=True)
|
197
|
|
- name = db.Column(db.String, nullable=False)
|
|
197
|
+ name = db.Column(db.String, nullable=False, unique=True)
|
198
|
198
|
icon = db.Column(db.String)
|
199
|
199
|
active = db.Column(db.Boolean, default=True)
|
200
|
200
|
|