1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

updated documentation

This commit is contained in:
Sylvain 2020-06-22 11:56:49 +02:00
parent 365c4b56c1
commit 501aed9c33
3 changed files with 15 additions and 90 deletions

View File

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

View File

@ -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;

View File

@ -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.
<a name="using-another-dbms"></a>
## 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.