Browse Source

Boilerplate

Andrea Zucchelli 7 years ago
parent
commit
5ed1bfc2cc
3 changed files with 29 additions and 0 deletions
  1. 5 0
      .gitignore
  2. 8 0
      config.sample.json
  3. 16 0
      scripts/db/postgresql/schema.sql

+ 5 - 0
.gitignore

@@ -0,0 +1,5 @@
+.idea/
+config.json
+syntax:glob
+**.pyc
+

+ 8 - 0
config.sample.json

@@ -0,0 +1,8 @@
+/*
+create a db_config.json here's 
+*/
+{
+  "config":{
+    "db_params":{"uri":"postgresql://user:password@host:port/dbname"}
+  }
+}

+ 16 - 0
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
+);
+