Skip to content

Commit

Permalink
Move subnet_type(s) tables id type to INT
Browse files Browse the repository at this point in the history
  • Loading branch information
nvinuesa committed Nov 29, 2023
1 parent 152e117 commit d02ef2e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions domain/schema/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ CREATE TABLE subnet (
vlan_tag INT,
is_public BOOLEAN,
space_uuid TEXT,
subnet_type_id TEXT,
subnet_type_id INT,
CONSTRAINT fk_subnets_spaces
FOREIGN KEY (space_uuid)
REFERENCES space(uuid),
Expand All @@ -126,7 +126,7 @@ CREATE TABLE subnet (
);
CREATE TABLE subnet_type (
id TEXT PRIMARY KEY,
id INT PRIMARY KEY,
name TEXT NOT NULL,
is_usable BOOLEAN,
is_space_settable BOOLEAN
Expand All @@ -138,17 +138,17 @@ INSERT INTO subnet_type VALUES
(2, 'fan_overlay_segment', true, true);
CREATE TABLE subnet_association_type (
id TEXT PRIMARY KEY,
id INT PRIMARY KEY,
name TEXT NOT NULL
);
INSERT INTO subnet_association_type VALUES
(0, 'overlay_of'); -- The subnet is an overlay of other (an underlay) subnet.
CREATE TABLE subnet_type_association_type (
subject_subnet_type_id TEXT PRIMARY KEY,
associated_subnet_type_id TEXT NOT NULL,
association_type_id TEXT NOT NULL,
subject_subnet_type_id INT PRIMARY KEY,
associated_subnet_type_id INT NOT NULL,
association_type_id INT NOT NULL,
CONSTRAINT fk_subject_subnet_type_id
FOREIGN KEY (subject_subnet_type_id)
REFERENCES subnet_type(id),
Expand All @@ -166,7 +166,7 @@ INSERT INTO subnet_type_association_type VALUES
CREATE TABLE subnet_association (
subject_subnet_uuid TEXT PRIMARY KEY,
associated_subnet_uuid TEXT NOT NULL,
association_type_id TEXT NOT NULL,
association_type_id INT NOT NULL,
CONSTRAINT fk_subject_subnet_uuid
FOREIGN KEY (subject_subnet_uuid)
REFERENCES subnet(uuid),
Expand Down

0 comments on commit d02ef2e

Please sign in to comment.