浏览代码

Boilerplate

Andrea Zucchelli 7 年之前
父节点
当前提交
5ed1bfc2cc
共有 3 个文件被更改,包括 29 次插入0 次删除
  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
+);
+