Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
louisroyer committed Jul 10, 2024
1 parent 1778e4d commit c580746
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions internal/database/database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CREATE TABLE IF NOT EXISTS uplink_gtp4 (
srgw_ip INET,
gnb_ip INET,
action_uuid UUID NOT NULL,
PRIMARY KEY(uplink_teid, srgw_ip, gnb_ip)
PRIMARY KEY (uplink_teid, srgw_ip, gnb_ip)
);

CREATE TABLE IF NOT EXISTS rule (
Expand All @@ -16,16 +16,20 @@ CREATE TABLE IF NOT EXISTS rule (
match_gnb_ip_prefix CIDR
);

CREATE OR REPLACE PROCEDURE insert_uplink_rule(IN uuid UUID, IN enabled BOOL, IN ue_ip_prefix CIDR,
IN gnb_ip_prefix CIDR, IN next_hop INET, IN srh INET ARRAY)
CREATE OR REPLACE PROCEDURE insert_uplink_rule (
IN uuid UUID, IN enabled BOOL, IN ue_ip_prefix CIDR,
IN gnb_ip_prefix CIDR, IN next_hop INET, IN srh INET ARRAY
)
LANGUAGE plpgsql AS $$
BEGIN
INSERT INTO rule(uuid, type_uplink, enabled, match_ue_ip_prefix, match_gnb_ip_prefix, action_next_hop, action_srh)
VALUES(uuid, TRUE, enabled, ue_ip_prefix, gnb_ip_prefix, next_hop, srh);
END;$$;

CREATE OR REPLACE PROCEDURE insert_downlink_rule(IN uuid UUID, IN enabled BOOL, IN ue_ip_prefix CIDR,
IN next_hop INET, IN srh INET ARRAY)
CREATE OR REPLACE PROCEDURE insert_downlink_rule (
IN uuid UUID, IN enabled BOOL, IN ue_ip_prefix CIDR,
IN next_hop INET, IN srh INET ARRAY
)
LANGUAGE plpgsql AS $$
BEGIN
INSERT INTO rule(uuid, type_uplink, enabled, match_ue_ip_prefix, action_next_hop, action_srh)
Expand Down

0 comments on commit c580746

Please sign in to comment.