From 316315afd2c28044e9f3dbd39b85659d53f02937 Mon Sep 17 00:00:00 2001 From: "alvarenga.milton" Date: Wed, 17 Jul 2019 20:49:23 -0300 Subject: [PATCH] Added support to postgresql on components/sql/scripts --- components/sql/scripts/postgresql.sql | 78 +++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 components/sql/scripts/postgresql.sql diff --git a/components/sql/scripts/postgresql.sql b/components/sql/scripts/postgresql.sql new file mode 100644 index 0000000..1a3aea8 --- /dev/null +++ b/components/sql/scripts/postgresql.sql @@ -0,0 +1,78 @@ +-- +-- Table structure for table active +-- + +CREATE TABLE IF NOT EXISTS active ( + "user" integer NOT NULL, + path text NOT NULL, + position varchar(255) DEFAULT NULL, + focused varchar(255) NOT NULL +); + +-- +-- Table structure for table access +-- + +CREATE TABLE IF NOT EXISTS access ( + "user" integer NOT NULL, + project integer NOT NULL, + level integer NOT NULL +); + +-- -------------------------------------------------------- + +-- +-- Table structure for table options +-- + +CREATE TABLE IF NOT EXISTS options ( + id SERIAL PRIMARY KEY, + name varchar(255) UNIQUE NOT NULL, + value text NOT NULL +); + +-- -------------------------------------------------------- + +-- +-- Table structure for table projects +-- + +CREATE TABLE IF NOT EXISTS projects ( + id SERIAL PRIMARY KEY, + name varchar(255) NOT NULL, + path text NOT NULL, + owner integer NOT NULL +); + + +-- -------------------------------------------------------- + +-- +-- Table structure for table users +-- + +CREATE TABLE IF NOT EXISTS users ( + id SERIAL PRIMARY KEY, + first_name varchar(255) DEFAULT NULL, + last_name varchar(255) DEFAULT NULL, + username varchar(255) UNIQUE NOT NULL, + password text NOT NULL, + email varchar(255) DEFAULT NULL, + project integer DEFAULT NULL, + access integer NOT NULL, + token varchar(255) DEFAULT NULL +); + +-- -------------------------------------------------------- + +-- +-- Table structure for table user_options +-- + +CREATE TABLE IF NOT EXISTS user_options ( + id SERIAL PRIMARY KEY, + name varchar(255) NOT NULL, + "user" integer NOT NULL, + value text NOT NULL, + UNIQUE (name,"user") +);