diff --git a/CHANGELOG b/CHANGELOG index 9f46a678a05..eda2aacad06 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 ------------------- diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 5b1a5cacf56..0cc143ca8e5 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -35,3 +35,4 @@ Daniel Pieper @danielpieper Andrew Paul Smith Brian Clemens Christopher Zentgraf @TheZenti +Lorenzo L. Ancora @LorenzoAncora diff --git a/config/database.php b/config/database.php index fee2de8ca5c..40ee8f5b295 100644 --- a/config/database.php +++ b/config/database.php @@ -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'), @@ -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' => [ diff --git a/database/migrations/2018_08_31_020908_create_life_events_table.php b/database/migrations/2018_08_31_020908_create_life_events_table.php index 9a791d76c2c..5db6ebee844 100644 --- a/database/migrations/2018_08_31_020908_create_life_events_table.php +++ b/database/migrations/2018_08_31_020908_create_life_events_table.php @@ -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'); diff --git a/database/migrations/2018_10_01_211757_add_number_of_views.php b/database/migrations/2018_10_01_211757_add_number_of_views.php index 9ca457c2ac1..92f67e60ecc 100644 --- a/database/migrations/2018_10_01_211757_add_number_of_views.php +++ b/database/migrations/2018_10_01_211757_add_number_of_views.php @@ -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); }); } } diff --git a/docs/administrators/tips.md b/docs/administrators/tips.md index 7856ec38b30..c24f1fe10d9 100644 --- a/docs/administrators/tips.md +++ b/docs/administrators/tips.md @@ -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 @@ -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.