From 88905a3910dd24b84f44d69cb483b70bbe0f1bd3 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 1 Feb 2016 10:54:32 +0100 Subject: [PATCH] Added new tables in the PostgreSQL and Oracle. --- pandora_console/pandoradb.oracle.sql | 60 ++++++++++++++++++++++++ pandora_console/pandoradb.postgreSQL.sql | 54 +++++++++++++++++++++ 2 files changed, 114 insertions(+) diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index 31fe97ca18..1ecb8617af 100755 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -2055,3 +2055,63 @@ CREATE TABLE tsessions_php ( ); -- This sequence will not work with the 'insert_id' procedure + +-- --------------------------------------------------------------------- +-- Table `tmap` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS tmap ( + id NUMBER(10, 0) PRIMARY KEY, + id_group NUMBER(10, 0) DEFAULT 0, + type NUMBER(5, 0) DEFAULT 0, + subtype NUMBER(5, 0) DEFAULT 0, + name VARCHAR2(100) DEFAULT '', + description CLOB DEFAULT '', + height NUMBER(10, 0) DEFAULT 0, + width NUMBER(10, 0) DEFAULT 0, + center_x NUMBER(10, 0) DEFAULT 0, + center_y NUMBER(10, 0) DEFAULT 0, + background VARCHAR2(100) DEFAULT '', + background_options NUMBER(10, 0) DEFAULT 0, + source_period NUMBER(10, 0) DEFAULT 0, + source NUMBER(10, 0) DEFAULT 0, + source_data VARCHAR2(250) DEFAULT '', + filter CLOB DEFAULT '', +); + +CREATE SEQUENCE tmap_s INCREMENT BY 1 START WITH 1; +CREATE OR REPLACE TRIGGER tmap_inc BEFORE INSERT ON tmap REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tmap_s.nextval INTO :NEW.id FROM dual; END tmap_inc;; + +-- --------------------------------------------------------------------- +-- Table titem +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS titem ( + id NUMBER(10, 0) PRIMARY KEY, + id_map NUMBER(10, 0) DEFAULT 0, + x NUMBER(10, 0) DEFAULT 0, + y NUMBER(10, 0) DEFAULT 0, + z NUMBER(10, 0) DEFAULT 0, + deleted NUMBER(1, 0) DEFAULT 0, + type NUMBER(5, 0) DEFAULT 0, + refresh NUMBER(10, 0) DEFAULT 0, + source NUMBER(10, 0) DEFAULT 0, + source_data VARCHAR2(250) DEFAULT '', + options CLOB DEFAULT '', + style CLOB DEFAULT '' +); +CREATE SEQUENCE titem_s INCREMENT BY 1 START WITH 1; +CREATE OR REPLACE TRIGGER titem_inc BEFORE INSERT ON titem REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT titem_s.nextval INTO :NEW.id FROM dual; END titem_inc;; + +-- --------------------------------------------------------------------- +-- Table trel_item +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS trel_item ( + id NUMBER(10, 0) PRIMARY KEY, + id_parent NUMBER(10, 0) DEFAULT 0, + id_child NUMBER(10, 0) DEFAULT 0, + parent_type NUMBER(5, 0) DEFAULT 0, + child_type NUMBER(5, 0) DEFAULT 0, + id_item NUMBER(10, 0) DEFAULT 0, + deleted NUMBER(1, 0) DEFAULT 0 +); +CREATE SEQUENCE trel_item_s INCREMENT BY 1 START WITH 1; +CREATE OR REPLACE TRIGGER trel_item_inc BEFORE INSERT ON trel_item REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT trel_item_s.nextval INTO :NEW.id FROM dual; END trel_item_inc;; \ No newline at end of file diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index c054a648db..38c5e0b0b7 100755 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -1715,3 +1715,57 @@ CREATE TABLE "tsessions_php" ( "last_active" INTEGER NOT NULL, "data" TEXT default '' ); + +-- --------------------------------------------------------------------- +-- Table "tmap" +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS "tmap" ( + "id" SERIAL NOT NULL PRIMARY KEY, + "id_group" INTEGER default 0, + "type" SMALLINT NOT NULL default 0, + "subtype" SMALLINT NOT NULL default 0, + "name" varchar(250) default '', + "description" TEXT, + "height" INTEGER UNSIGNED NOT NULL default 0, + "width" INTEGER UNSIGNED NOT NULL default 0, + "center_x" INTEGER NOT NULL default 0, + "center_y" INTEGER NOT NULL default 0, + "background" varchar(250) default '', + "background_options" INTEGER UNSIGNED NOT NULL default 0, + "source_period" INTEGER UNSIGNED NOT NULL default 0, + "source" SMALLINT NOT NULL default 0, + "source_data" varchar(250) default '', + "filter" TEXT +); + +-- --------------------------------------------------------------------- +-- Table "titem" +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS "titem" ( + "id" SERIAL NOT NULL PRIMARY KEY, + "id_map" INTEGER default 0, + "x" INTEGER UNSIGNED NOT NULL default 0, + "y" INTEGER UNSIGNED NOT NULL default 0, + "z" INTEGER UNSIGNED NOT NULL default 0, + "deleted" INTEGER(1) unsigned NOT NULL default 0, + "type" SMALLINT NOT NULL default 0, + "refresh" INTEGER UNSIGNED NOT NULL default 0, + "source" SMALLINT NOT NULL default 0, + "source_data" varchar(250) default '', + "options" TEXT, + "style" TEXT, + PRIMARY KEY("id") +); + +-- --------------------------------------------------------------------- +-- Table "trel_item" +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS "trel_item" ( + "id" SERIAL NOT NULL PRIMARY KEY, + "id_parent" INTEGER default 0, + "id_child" INTEGER default 0, + "parent_type" SMALLINT NOT NULL default 0, + "child_type" SMALLINT NOT NULL default 0, + "id_item" INTEGER default 0, + "deleted" SMALLINT NOT NULL default 0 +); \ No newline at end of file