From c871f9e7a4913faf8278cedcefc1dd479262c6b7 Mon Sep 17 00:00:00 2001 From: Alec Smecher Date: Thu, 27 Aug 2020 12:56:01 -0700 Subject: [PATCH] pkp/pkp-lib#2493 Clean up defaults --- classes/migration/OJSMigration.inc.php | 36 +++++++++---------- .../upgrade/OJSv3_3_0UpgradeMigration.inc.php | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/classes/migration/OJSMigration.inc.php b/classes/migration/OJSMigration.inc.php index 244e34c951c..234490735e3 100644 --- a/classes/migration/OJSMigration.inc.php +++ b/classes/migration/OJSMigration.inc.php @@ -28,7 +28,7 @@ public function up() { $table->string('path', 32); $table->float('seq', 8, 2)->default(0)->comment('Used to order lists of journals'); $table->string('primary_locale', 14); - $table->boolean('enabled')->default(1)->comment('Controls whether or not the journal is considered "live" and will appear on the website. (Note that disabled journals may still be accessible, but only if the user knows the URL.)'); + $table->boolean('enabled')->default(true)->comment('Controls whether or not the journal is considered "live" and will appear on the website. (Note that disabled journals may still be accessible, but only if the user knows the URL.)'); $table->unique(['path'], 'journals_path'); }); @@ -49,13 +49,13 @@ public function up() { $table->bigInteger('journal_id'); $table->bigInteger('review_form_id')->nullable(); $table->float('seq', 8, 2)->default(0); - $table->boolean('editor_restricted')->default(0); - $table->boolean('meta_indexed')->default(0); - $table->boolean('meta_reviewed')->default(1); - $table->boolean('abstracts_not_required')->default(0); - $table->boolean('hide_title')->default(0); - $table->boolean('hide_author')->default(0); - $table->boolean('is_inactive')->default(0); + $table->boolean('editor_restricted')->default(false); + $table->boolean('meta_indexed')->default(false); + $table->boolean('meta_reviewed')->default(true); + $table->boolean('abstracts_not_required')->default(false); + $table->boolean('hide_title')->default(false); + $table->boolean('hide_author')->default(false); + $table->boolean('is_inactive')->default(false); $table->bigInteger('abstract_word_count')->nullable(); $table->index(['journal_id'], 'sections_journal_id'); }); @@ -78,17 +78,17 @@ public function up() { $table->smallInteger('volume')->nullable(); $table->string('number', 40)->nullable(); $table->smallInteger('year')->nullable(); - $table->boolean('published')->default(0); - $table->boolean('current')->default(0); + $table->boolean('published')->default(false); + $table->boolean('current')->default(false); $table->datetime('date_published')->nullable(); $table->datetime('date_notified')->nullable(); $table->datetime('last_modified')->nullable(); $table->smallInteger('access_status')->default(1); $table->datetime('open_access_date')->nullable(); - $table->boolean('show_volume')->default(0); - $table->boolean('show_number')->default(0); - $table->boolean('show_year')->default(0); - $table->boolean('show_title')->default(0); + $table->boolean('show_volume')->default(false); + $table->boolean('show_number')->default(false); + $table->boolean('show_year')->default(false); + $table->boolean('show_title')->default(false); $table->string('style_file_name', 90)->nullable(); $table->string('original_style_file_name', 255)->nullable(); $table->string('url_path', 64)->nullable(); @@ -207,7 +207,7 @@ public function up() { $table->bigInteger('file_id')->nullable(); $table->float('seq', 8, 2)->default(0); $table->string('remote_url', 2047)->nullable(); - $table->boolean('is_approved')->default(0); + $table->boolean('is_approved')->default(false); $table->string('url_path', 64)->nullable(); $table->index(['publication_id'], 'publication_galleys_publication_id'); $table->index(['url_path'], 'publication_galleys_url_path'); @@ -234,11 +234,11 @@ public function up() { $table->bigInteger('journal_id'); $table->float('cost', 8, 2); $table->string('currency_code_alpha', 3); - $table->boolean('non_expiring')->default(0); + $table->boolean('non_expiring')->default(false); $table->smallInteger('duration')->nullable(); $table->smallInteger('format'); - $table->boolean('institutional')->default(0); - $table->boolean('membership')->default(0); + $table->boolean('institutional')->default(false); + $table->boolean('membership')->default(false); $table->boolean('disable_public_display'); $table->float('seq', 8, 2); }); diff --git a/classes/migration/upgrade/OJSv3_3_0UpgradeMigration.inc.php b/classes/migration/upgrade/OJSv3_3_0UpgradeMigration.inc.php index 530f2638d22..f05f9eb3785 100644 --- a/classes/migration/upgrade/OJSv3_3_0UpgradeMigration.inc.php +++ b/classes/migration/upgrade/OJSv3_3_0UpgradeMigration.inc.php @@ -27,7 +27,7 @@ public function up() { $table->mediumText('setting_value')->nullable()->change(); }); Capsule::schema()->table('sections', function (Blueprint $table) { - $table->boolean('is_inactive')->default(0); + $table->boolean('is_inactive')->default(false); }); }