From 5ed1bfc2ccfb8bbf82ebd8cab0fb8ef7be7ddb6a Mon Sep 17 00:00:00 2001 From: Andrea Zucchelli Date: Thu, 9 Feb 2017 22:55:29 +0100 Subject: [PATCH] Boilerplate --- .gitignore | 5 +++++ config.sample.json | 8 ++++++++ scripts/db/postgresql/schema.sql | 16 ++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 .gitignore create mode 100644 config.sample.json create mode 100644 scripts/db/postgresql/schema.sql diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f32118b --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.idea/ +config.json +syntax:glob +**.pyc + diff --git a/config.sample.json b/config.sample.json new file mode 100644 index 0000000..de7e198 --- /dev/null +++ b/config.sample.json @@ -0,0 +1,8 @@ +/* +create a db_config.json here's +*/ +{ + "config":{ + "db_params":{"uri":"postgresql://user:password@host:port/dbname"} + } +} \ No newline at end of file diff --git a/scripts/db/postgresql/schema.sql b/scripts/db/postgresql/schema.sql new file mode 100644 index 0000000..0ac9ffe --- /dev/null +++ b/scripts/db/postgresql/schema.sql @@ -0,0 +1,16 @@ +create type user_role as enum ('USER','ADMIN','EDITOR'); + +create table users( +id serial primary key, +username text unique not null, +name text, +surname text, +email text, +createts timestamptz not null default now(), +password text, +salt text, +updatets timestamptz not null default now(), +role_list user_role[] not null default ARRAY['USER'::user_role], +user_data jsonb +); +