From 501aed9c33acdd5977e04207ebea985fca75405e Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 22 Jun 2020 11:56:49 +0200 Subject: [PATCH] updated documentation --- doc/elasticsearch.md | 70 ---------------------------------------- doc/known-issues.md | 2 +- doc/postgresql_readme.md | 33 ++++++++----------- 3 files changed, 15 insertions(+), 90 deletions(-) diff --git a/doc/elasticsearch.md b/doc/elasticsearch.md index 32275f8be..e64199074 100644 --- a/doc/elasticsearch.md +++ b/doc/elasticsearch.md @@ -1,75 +1,5 @@ # ELASTICSEARCH -## Projects - -http://localhost:9200/fablab/_mapping?pretty - - { - "fablab" : { - "mappings" : { - "projects" : { - "dynamic" : "true", - "properties" : { - "author_id" : { - "type" : "long" - }, - "component_ids" : { - "type" : "long" - }, - "created_at" : { - "type" : "date", - "format" : "dateOptionalTime" - }, - "description" : { - "type" : "string", - "analyzer" : "french" - }, - "id" : { - "type" : "long" - }, - "machine_ids" : { - "type" : "long" - }, - "name" : { - "type" : "string", - "analyzer" : "french" - }, - "project_steps" : { - "properties" : { - "description" : { - "type" : "string", - "analyzer" : "french" - }, - "title" : { - "type" : "string", - "analyzer" : "french" - } - } - }, - "state" : { - "type" : "string", - "analyzer" : "simple" - }, - "tags" : { - "type" : "string", - "analyzer" : "french" - }, - "theme_ids" : { - "type" : "long" - }, - "updated_at" : { - "type" : "date", - "format" : "dateOptionalTime" - }, - "user_ids" : { - "type" : "long" - } - } - } - } - } - } - ## Statistics http://localhost:9200/stats/_mapping?pretty diff --git a/doc/known-issues.md b/doc/known-issues.md index af031dc91..91f5f6bff 100644 --- a/doc/known-issues.md +++ b/doc/known-issues.md @@ -37,7 +37,7 @@ This document is listing common known issues. This is due to an ActiveRecord behavior witch disable referential integrity in PostgreSQL to load the fixtures. PostgreSQL will prevent any users to disable referential integrity on the fly if they doesn't have the `SUPERUSER` role. - To fix that, logon as the `postgres` user and run the PostgreSQL shell (see [the dedicated section](#run-postgresql-cli) for instructions). + To fix that, logon as the `postgres` user and run the PostgreSQL shell (see [the postgresql documentation](postgresql_readme.md#run-postgresql-cli) for instructions). Then, run the following command (replace `sleede` with your test database user, as specified in your database.yml): ALTER ROLE sleede WITH SUPERUSER; diff --git a/doc/postgresql_readme.md b/doc/postgresql_readme.md index 43e4f4cd2..60ad2672c 100644 --- a/doc/postgresql_readme.md +++ b/doc/postgresql_readme.md @@ -6,16 +6,9 @@ You may want to access the psql command line tool to check the content of the database, or to run some maintenance routines. This can be achieved doing the following: -1. Enter into the PostgreSQL container ```bash - docker exec -it fabmanager-postgres bash - ``` - -2. Run the PostgreSQL administration command line interface, logged as the postgres user - - ```bash - su postgres - psql + cd /apps/fabmanager + docker-compose exec postgres psql -Upostgres ``` ## Dumping the database @@ -64,19 +57,21 @@ docker-compose up -d Please follow the instructions detailed on the extension website to whitelist `unaccent` and `trigram` for the user configured in `config/database.yml`. - If you intend to contribute to the project code, you will need to run the test suite with `scripts/run-tests.sh`. This also requires your user to have the _SUPERUSER_ role. - Please see the [known issues](../README.md#known-issues) section for more information about this. + Please see the [known issues](known-issues.md) documentation for more information about this. ## Using another DBMS Some users may want to use another DBMS than PostgreSQL. This is currently not supported, because of some PostgreSQL specific instructions that cannot be efficiently handled with the ActiveRecord ORM: - - `app/services/members/list_service.rb@list` is using `ILIKE`, `now()::date` and `OFFSET`. - - `app/services/invoices_service.rb@list` is using `ILIKE` and `date_trunc()` - - `db/migrate/20160613093842_create_unaccent_function.rb` is using [unaccent](https://www.postgresql.org/docs/current/static/unaccent.html) and [trigram](https://www.postgresql.org/docs/current/static/pgtrgm.html) modules and defines a PL/pgSQL function (`f_unaccent()`) - - `app/controllers/api/members_controllers.rb@search` is using `f_unaccent()` (see above) and `regexp_replace()` - - `db/migrate/20150604131525_add_meta_data_to_notifications.rb` is using [jsonb](https://www.postgresql.org/docs/9.4/static/datatype-json.html), a PostgreSQL 9.4+ datatype. - - `db/migrate/20160915105234_add_transformation_to_o_auth2_mapping.rb` is using [jsonb](https://www.postgresql.org/docs/9.4/static/datatype-json.html), a PostgreSQL 9.4+ datatype. - - `db/migrate/20181217103441_migrate_settings_value_to_history_values.rb` is using `SELECT DISTINCT ON`. - - `db/migrate/20190107111749_protect_accounting_periods.rb` is using `CREATE RULE` and `DROP RULE`. - - `db/migrate/20190522115230_migrate_user_to_invoicing_profile.rb` is using `CREATE RULE` and `DROP RULE`. + - `app/services/members/list_service.rb@list` is using `ILIKE`, `now()::date` and `OFFSET`; + - `app/services/invoices_service.rb@list` is using `ILIKE` and `date_trunc()`; + - `db/migrate/20160613093842_create_unaccent_function.rb` is using [unaccent](https://www.postgresql.org/docs/current/static/unaccent.html) and [trigram](https://www.postgresql.org/docs/current/static/pgtrgm.html) modules and defines a PL/pgSQL function (`f_unaccent()`); + - `app/controllers/api/members_controllers.rb@search` is using `f_unaccent()` (see above) and `regexp_replace()`; + - `db/migrate/20150604131525_add_meta_data_to_notifications.rb` is using [jsonb](https://www.postgresql.org/docs/9.4/static/datatype-json.html), a PostgreSQL 9.4+ datatype; + - `db/migrate/20160915105234_add_transformation_to_o_auth2_mapping.rb` is using [jsonb](https://www.postgresql.org/docs/9.4/static/datatype-json.html), a PostgreSQL 9.4+ datatype; + - `db/migrate/20181217103441_migrate_settings_value_to_history_values.rb` is using `SELECT DISTINCT ON`; + - `db/migrate/20190107111749_protect_accounting_periods.rb` is using `CREATE RULE` and `DROP RULE`; + - `db/migrate/20190522115230_migrate_user_to_invoicing_profile.rb` is using `CREATE RULE` and `DROP RULE`; + - `db/migrate/20200511075933_fix_accounting_periods.rb` is using `CREATE RULE` and `DROP RULE`; + - `app/models/project.rb` is using the `pg_search` gem.