Skip to content

Commit

Permalink
feat: add checks to database
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Dec 19, 2022
1 parent bc948aa commit a1fbe97
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src-tauri/src/db/init_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ CREATE TABLE IF NOT EXISTS error (

CREATE TABLE IF NOT EXISTS settings (
settings_id INTEGER PRIMARY KEY AUTOINCREMENT CHECK (settings_id = 1),
short_break_as_sec INTEGER NOT NULL,
long_break_as_sec INTEGER NOT NULL,
session_as_sec INTEGER NOT NULL,
number_session_before_break INTEGER NOT NULL,
short_break_as_sec INTEGER CHECK(short_break_as_sec >= 10 AND short_break_as_sec <= 120) NOT NULL,
long_break_as_sec INTEGER CHECK(long_break_as_sec>= 60 AND long_break_as_sec <= 600) NOT NULL,
session_as_sec INTEGER CHECK(session_as_sec >= 60 AND session_as_sec <= 3540) NOT NULL,
number_session_before_break INTEGER CHECK(number_session_before_break >= 2 AND number_session_before_break <= 10) NOT NULL,
fullscreen BOOLEAN NOT NULL
);

Expand Down

0 comments on commit a1fbe97

Please sign in to comment.