Skip to content

Commit

Permalink
Add constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris7 committed Sep 18, 2024
1 parent a7486e7 commit 2116ba6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion migrations/operations/01-initial/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ CREATE TABLE branch (
db_uuid TEXT NOT NULL,
name TEXT NOT NULL,
start_operation_id INTEGER,
current_operation_id INTEGER
current_operation_id INTEGER,
FOREIGN KEY(start_operation_id) REFERENCES operation(id),
FOREIGN KEY(current_operation_id) REFERENCES operation(id)
) STRICT;
CREATE UNIQUE INDEX branch_uidx ON branch(db_uuid, name);
1 change: 0 additions & 1 deletion src/models/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ impl OperationState {
UPDATE SET branch_id=excluded.branch_id;",
)
.unwrap();
println!("setting branc to {branch_name}");
stmt.execute(params_from_iter(vec![
Value::from(db_uuid.to_string()),
Value::from(branch.id),
Expand Down

0 comments on commit 2116ba6

Please sign in to comment.