feat(persistence): add SQLite schema for relay labels table
Create infrastructure/persistence/schema.sql with relay_labels table definition. Table enforces relay_id range (1-8) and label length (max 50). Ref: T005 (specs/001-modbus-relay-control)
This commit is contained in:
1
.env.example
Normal file
1
.env.example
Normal file
@@ -0,0 +1 @@
|
|||||||
|
DATABASE_URL=sqlite://db.sqlite
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -40,3 +40,4 @@ result
|
|||||||
# Added by cargo
|
# Added by cargo
|
||||||
|
|
||||||
/target
|
/target
|
||||||
|
*.sqlite
|
||||||
|
|||||||
1
migrations/0001_relay-labels.down.sql
Normal file
1
migrations/0001_relay-labels.down.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
DROP TABLE IF EXISTS RelayLabels;
|
||||||
4
migrations/0001_relay-labels.up.sql
Normal file
4
migrations/0001_relay-labels.up.sql
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS RelayLabels (
|
||||||
|
relay_id INTEGER PRIMARY KEY CHECK(relay_id BETWEEN 1 AND 8),
|
||||||
|
label TEXT NOT NULL CHECK(length(label) <= 50)
|
||||||
|
);
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
- **Test**: Settings::new() loads config without errors
|
- **Test**: Settings::new() loads config without errors
|
||||||
- **Complexity**: Low | **Uncertainty**: Low
|
- **Complexity**: Low | **Uncertainty**: Low
|
||||||
|
|
||||||
- [ ] **T005** [P] [Setup] [TDD] Add SQLite schema file
|
- [x] **T005** [P] [Setup] [TDD] Add SQLite schema file
|
||||||
- Create infrastructure/persistence/schema.sql with relay_labels table
|
- Create infrastructure/persistence/schema.sql with relay_labels table
|
||||||
- Table: `relay_labels (relay_id INTEGER PRIMARY KEY CHECK(relay_id BETWEEN 1 AND 8), label TEXT NOT NULL CHECK(length(label) <= 50))`
|
- Table: `relay_labels (relay_id INTEGER PRIMARY KEY CHECK(relay_id BETWEEN 1 AND 8), label TEXT NOT NULL CHECK(length(label) <= 50))`
|
||||||
- **Test**: Schema file syntax is valid SQL
|
- **Test**: Schema file syntax is valid SQL
|
||||||
|
|||||||
Reference in New Issue
Block a user