From 22f6f2201201ce6a65a78814227106b8381d81a6 Mon Sep 17 00:00:00 2001 From: Gianluca Arbezzano Date: Thu, 10 Dec 2020 14:41:08 +0100 Subject: [PATCH] Cleanup not required cleanup sql script Since we introduced migration the init file is not required and it is a leftover. Signed-off-by: Gianluca Arbezzano --- deploy/db/tinkerbell-init.sql | 76 ----------------------------------- deploy/docker-compose.yml | 1 - 2 files changed, 77 deletions(-) delete mode 100644 deploy/db/tinkerbell-init.sql diff --git a/deploy/db/tinkerbell-init.sql b/deploy/db/tinkerbell-init.sql deleted file mode 100644 index 9b27c81..0000000 --- a/deploy/db/tinkerbell-init.sql +++ /dev/null @@ -1,76 +0,0 @@ -SET ROLE tinkerbell; - -CREATE TABLE IF NOT EXISTS hardware ( - id UUID UNIQUE - , inserted_at TIMESTAMPTZ - , deleted_at TIMESTAMPTZ - , data JSONB -); - -CREATE INDEX IF NOT EXISTS idx_id ON hardware (id); -CREATE INDEX IF NOT EXISTS idx_deleted_at ON hardware (deleted_at NULLS FIRST); -CREATE INDEX IF NOT EXISTS idxgin_type ON hardware USING GIN (data JSONB_PATH_OPS); - -CREATE TABLE IF NOT EXISTS template ( - id UUID UNIQUE NOT NULL - , name VARCHAR(200) NOT NULL - , created_at TIMESTAMPTZ - , updated_at TIMESTAMPTZ - , deleted_at TIMESTAMPTZ - , data BYTEA - - CONSTRAINT CK_name CHECK (name ~ '^[a-zA-Z0-9_-]*$') -); - -CREATE INDEX IF NOT EXISTS idx_tid ON template (id); -CREATE INDEX IF NOT EXISTS idx_tdeleted_at ON template (deleted_at NULLS FIRST); - -CREATE TABLE IF NOT EXISTS workflow ( - id UUID UNIQUE NOT NULL - , template UUID NOT NULL - , devices JSONB NOT NULL - , created_at TIMESTAMPTZ - , updated_at TIMESTAMPTZ - , deleted_at TIMESTAMPTZ -); - -CREATE INDEX IF NOT EXISTS idx_wid ON workflow (id); -CREATE INDEX IF NOT EXISTS idx_wdeleted_at ON workflow (deleted_at NULLS FIRST); - -CREATE TABLE IF NOT EXISTS workflow_state ( - workflow_id UUID UNIQUE NOT NULL - , current_task_name VARCHAR(200) - , current_action_name VARCHAR(200) - , current_action_state SMALLINT - , current_worker VARCHAR(200) - , action_list JSONB - , current_action_index int - , total_number_of_actions INT -); - -CREATE INDEX IF NOT EXISTS idx_wfid ON workflow_state (workflow_id); - -CREATE TABLE IF NOT EXISTS workflow_event ( - workflow_id UUID NOT NULL - , worker_id UUID NOT NULL - , task_name VARCHAR(200) - , action_name VARCHAR(200) - , execution_time int - , message VARCHAR(200) - , status SMALLINT - , created_at TIMESTAMPTZ -); - -CREATE INDEX IF NOT EXISTS idx_event ON workflow_event (created_at); - -CREATE TABLE IF NOT EXISTS workflow_worker_map ( - workflow_id UUID NOT NULL - , worker_id UUID NOT NULL -); - -CREATE TABLE IF NOT EXISTS workflow_data ( - workflow_id UUID NOT NULL - , version INT - , metadata JSONB - , data JSONB -); diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 2953d49..0c6f34d 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -65,7 +65,6 @@ services: POSTGRES_PASSWORD: tinkerbell POSTGRES_USER: tinkerbell volumes: - - ./db/tinkerbell-init.sql:/docker-entrypoint-initdb.d/tinkerbell-init.sql:ro - postgres_data:/var/lib/postgresql/data:rw ports: - 5432:5432