Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: documentation for PostgreSQL users and bug fixes (migration with PostgreSQL). #1914

Merged
merged 9 commits into from
Oct 27, 2018
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ v2.9.0 - 2018-10-14
* Add ability to retrieve all conversations for one contact through the API
* Add all tasks not yet completed on the dashboard
* Fix gravatar not displayed on dashboard view
* Fix errors during PostgreSQL migration
* Better documentation for PostgreSQL users

v2.8.1 - 2018-10-08
-------------------
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ Daniel Pieper @danielpieper <monica@daniel-pieper.com>
Andrew Paul Smith <github@chucklesthebeard.com>
Brian Clemens <brian@tiuxo.com>
Christopher Zentgraf @TheZenti <git@the-zenti.de>
Lorenzo L. Ancora @LorenzoAncora <admin@lorenzoancora.info>
6 changes: 6 additions & 0 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
| PostgreSQL users: insert 'pgsql' and edit the 'pgsql' section below.
|
*/

'default' => env('DB_CONNECTION', 'mysql'),
Expand Down Expand Up @@ -56,6 +58,10 @@
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
| PostgreSQL users: comment out host and port for UNIX domain socket
| connections (local file-based connection without the need to edit the
| firewall settings).
|
*/

'connections' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function up()
$table->increments('id');
$table->unsignedInteger('default_life_event_category_id');
$table->string('translation_key');
$table->text('specific_information_structure');
$table->text('specific_information_structure')->nullable();
$table->boolean('migrated')->default(0);
$table->timestamps();
$table->foreign('default_life_event_category_id')->references('id')->on('default_life_event_categories')->onDelete('cascade');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AddNumberOfViews extends Migration
public function up()
{
Schema::table('contacts', function (Blueprint $table) {
$table->integer('number_of_views')->after('last_consulted_at');
$table->integer('number_of_views')->after('last_consulted_at')->default(0);
});
}
}
23 changes: 22 additions & 1 deletion docs/administrators/tips.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This document lists some tips that developers can use to add new content in Monica.
This document lists some tips that developers can use to add new content in Monica and contains the solution to uncommon problems.

## Add a new changelog entry

Expand All @@ -13,3 +13,24 @@ Note: why jobs and not direct inserts? Because on our hosted version, we have so
### When is it relevant to create a changelog entry

We should not create a changelog entry every single time we make a change to the platform. The rule is to warn users only when we introduce something that they will benefit from. A bug fix is not something they will benefit from and is not worth mentioning. Simple visual changes, unless they drastically change the UI, should not be mentioned. Anything made on the Docker image or a packaging issue should not be mentioned.

## Failed Jobs queue

PostgreSQL users who previously failed Monica's update may receive errors similar to these:

> SQLSTATE[Number]: Duplicate table: 7 ERROR: relation "**failed_jobs**" already exists (SQL: create table "failed_jobs" ("id" bigserial primary key not null, "connection" text not null, "queue" text not null, "payload" text not null, "exception" text not null, "failed_at" timestamp(0) without time zone default CURRENT_TIMESTAMP not null))

> SQLSTATE[Number]: Duplicate table: 7 ERROR: relation "**failed_jobs**" already exists

The problem is solved by running the command:

```
php artisan queue:flush
```
...with the appropriate privileges.

Immediately after (through a tool like `psql`) access the Monica database and run this command:
```
DROP TABLE "failed_jobs";
```
This will ensure that the failed job table has actually been deleted.