Addedd doc for the db.
This commit is contained in:
parent
40b853d71a
commit
7de48a2e28
1 changed files with 46 additions and 0 deletions
46
doc/DB.rst
Normal file
46
doc/DB.rst
Normal file
|
@ -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
|
||||
====================================== ============= ==============================================================
|
||||
|
Loading…
Reference in a new issue