Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions scripts/sql/129_git_sensor_node_sharding.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Git Sensor node details table
DROP TABLE IF EXISTS "public"."git_sensor_node" CASCADE;

---- DROP sequence
DROP SEQUENCE IF EXISTS public.id_seq_git_sensor_node;

-- Git Sensor node mapping table
DROP TABLE IF EXISTS "public"."git_sensor_node_mapping" CASCADE;

---- DROP sequence
DROP SEQUENCE IF EXISTS public.id_seq_git_sensor_node_mapping;
27 changes: 27 additions & 0 deletions scripts/sql/129_git_sensor_node_sharding.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-- Sequence and defined type
CREATE SEQUENCE IF NOT EXISTS id_seq_git_sensor_node;

-- Create GitSensor node details table
CREATE TABLE git_sensor_node(
"id" INTEGER PRIMARY KEY DEFAULT nextval('id_seq_git_sensor_node'::regclass),
"host" VARCHAR NOT NULL,
"port" INTEGER NOT NULL,
"created_on" TIMESTAMPTZ,
"created_by" INTEGER,
"updated_on" TIMESTAMPTZ,
"updated_by" INTEGER
);

-- Sequence and defined type
CREATE SEQUENCE IF NOT EXISTS id_seq_git_sensor_node_mapping;

-- Create GitSensorNode mapping table
CREATE TABLE git_sensor_node_mapping(
"id" INTEGER PRIMARY KEY DEFAULT nextval('id_seq_git_sensor_node_mapping'::regclass),
"app_id" INTEGER NOT NULL,
"node_id" INTEGER NOT NULL,
"created_on" TIMESTAMPTZ,
"created_by" INTEGER,
"updated_on" TIMESTAMPTZ,
"updated_by" INTEGER
);