Skip to content

Commit cdaf928

Browse files
committed
Add DB constraint to prevent empty beamline name
1 parent c2cb6d8 commit cdaf928

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

migrations/0001_init.up.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CREATE TABLE beamline (
22
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
3-
name TEXT UNIQUE NOT NULL,
3+
name TEXT UNIQUE NOT NULL CHECK (length(name) > 0),
44
-- Default to 0 so scan numbering starts at 1
55
scan_number INTEGER NOT NULL DEFAULT 0 CHECK (scan_number >= 0),
66

0 commit comments

Comments
 (0)