Skip to content

Commit a576598

Browse files
authored
Table changes for inserting flow with group (#183)
* Table changes for inserting flow with group * Formatting changes for PR
1 parent f586984 commit a576598

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/resources/db/migration/V8__cfe_18.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ create table capture_def_group
205205
capture_type varchar(64) not null check (capture_type in
206206
('aws', 'manual', 'cfe', 'windows', 'hec', 'azure',
207207
'relp')),
208+
flow_id int not null,
209+
unique (id, flow_id),
208210
unique (id, capture_type),
209211
start_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW START INVISIBLE,
210212
end_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW END INVISIBLE,
@@ -221,6 +223,9 @@ create table capture_def_group_x_capture_def
221223
capture_type varchar(64) not null check (capture_type in
222224
('aws', 'manual', 'cfe', 'windows', 'hec',
223225
'azure', 'relp')),
226+
flow_id int not null,
227+
constraint sameFlowCapture FOREIGN KEY (capture_def_id, flow_id) REFERENCES cfe_18.capture_definition(id, flow_id),
228+
constraint sameFlowGroup FOREIGN KEY (capture_def_group_id, flow_id) REFERENCES cfe_18.capture_def_group(id, flow_id),
224229
constraint captureToCaptureGroupType foreign key (capture_def_id, capture_type) references cfe_18.capture_definition (id, capture_type) on delete cascade,
225230
constraint captureTypeToCaptureGroup foreign key (capture_def_group_id, capture_type) references cfe_18.capture_def_group (id, capture_type) on delete cascade,
226231
unique key (capture_def_group_id, capture_def_id),

0 commit comments

Comments
 (0)