Skip to content

Commit

Permalink
Change logging_preference to be NOT NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-Dickinson committed Apr 13, 2020
1 parent a536369 commit 576da30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ihatemoney/migrations/versions/2dcb0c0048dc_autologger.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def upgrade():
sa.Column(
"logging_preference",
sa.Enum("DISABLED", "ENABLED", "RECORD_IP", name="loggingmode"),
server_default="ENABLED",
autoincrement=False,
nullable=True,
),
Expand Down Expand Up @@ -169,6 +170,7 @@ def upgrade():
sa.Column(
"logging_preference",
sa.Enum("DISABLED", "ENABLED", "RECORD_IP", name="loggingmode"),
server_default="ENABLED",
nullable=False,
),
)
Expand Down
5 changes: 4 additions & 1 deletion ihatemoney/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ def get_by_name(self, name):
password = db.Column(db.String(128))
contact_email = db.Column(db.String(128))
logging_preference = db.Column(
db.Enum(LoggingMode), default=LoggingMode.default(), nullable=False
db.Enum(LoggingMode),
default=LoggingMode.default(),
nullable=False,
server_default=LoggingMode.default().name,
)
members = db.relationship("Person", backref="project")

Expand Down

0 comments on commit 576da30

Please sign in to comment.