DB.rst 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Database(s) structure
  2. =====================
  3. We have a single postgres instance on ``db`` container. ``tt-rss`` has its own
  4. database ``tt-rss`` (?). There will be another one for the app that keeps all
  5. together.
  6. feedati
  7. -------
  8. The db structure is, right now, the following:
  9. ======== ======= ======= =========
  10. Schema Name Type Owner
  11. ======== ======= ======= =========
  12. public users table postgres
  13. ======== ======= ======= =========
  14. The following statements create the db and the table:
  15. .. code:: sql
  16. CREATE DATABASE feedati WITH ENCODING=UTF8 OWNER=postgres;
  17. Then create the table:
  18. .. code:: sql
  19. CREATE EXTENSION IF NOT EXIST "uuid-ossp";
  20. CREATE TABLE users
  21. (
  22. uuid uuid NOT NULL DEFAULT uuid_generate_v1(),
  23. email text NOT NULL,
  24. pass_hash varchar(512) NOT NULL,
  25. CONSTRAINT users_pkey PRIMARY KEY (uuid)
  26. );
  27. Example table content:
  28. ====================================== ============= ==============================================================
  29. uuid email pass_hash
  30. ====================================== ============= ==============================================================
  31. b0abc42e-be71-11e8-a054-0242ac110002 me@domin.io $2a$10$8z35dF9/U6VJzpwDt2.Hm.QT78izNZI.IYSZFYCFQmBykEwWUNajq
  32. cff36cba-be71-11e8-a054-0242ac110002 luke@dom.it $2a$10$J7slNiXjQexMJXNgaEkeAeUtw7ERwNciM1KVMGwM3X.P/GUk8o7.C
  33. ====================================== ============= ==============================================================