Feedati/doc/DB.rst
2018-09-22 16:40:56 +02:00

46 baris
1,6 KiB
ReStructuredText

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
====================================== ============= ==============================================================