From 7de48a2e281b833fdaa3b0eba81423febf58444f Mon Sep 17 00:00:00 2001 From: Blallo Date: Sat, 22 Sep 2018 16:40:56 +0200 Subject: [PATCH] Addedd doc for the db. --- doc/DB.rst | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 doc/DB.rst diff --git a/doc/DB.rst b/doc/DB.rst new file mode 100644 index 0000000..bcd6ee1 --- /dev/null +++ b/doc/DB.rst @@ -0,0 +1,46 @@ +Database(s) structure +===================== + +We have a single postgres instance on ``db`` container. ``tt-rss`` has its own +database ``tt-rss`` (?). There will be another one for the app that keeps all +together. + +feedati +------- + +The db structure is, right now, the following: + +======== ======= ======= ========= + Schema Name Type Owner +======== ======= ======= ========= + public users table postgres +======== ======= ======= ========= + +The following statements create the db and the table: + +.. code:: sql + + CREATE DATABASE feedati WITH ENCODING=UTF8 OWNER=postgres; + +Then create the table: + +.. code:: sql + + CREATE EXTENSION IF NOT EXIST "uuid-ossp"; + CREATE TABLE users + ( + uuid uuid NOT NULL DEFAULT uuid_generate_v1(), + email text NOT NULL, + pass_hash varchar(512) NOT NULL, + CONSTRAINT users_pkey PRIMARY KEY (uuid) + ); + +Example table content: + +====================================== ============= ============================================================== + uuid email pass_hash +====================================== ============= ============================================================== + b0abc42e-be71-11e8-a054-0242ac110002 me@domin.io $2a$10$8z35dF9/U6VJzpwDt2.Hm.QT78izNZI.IYSZFYCFQmBykEwWUNajq + cff36cba-be71-11e8-a054-0242ac110002 luke@dom.it $2a$10$J7slNiXjQexMJXNgaEkeAeUtw7ERwNciM1KVMGwM3X.P/GUk8o7.C +====================================== ============= ============================================================== +