Skip to content

Commit

Permalink
pkp/pkp-lib#2493 Back away from boolean columns (PostgreSQL vs MySQL …
Browse files Browse the repository at this point in the history
…on numeric equivalents)
  • Loading branch information
asmecher committed Aug 27, 2020
1 parent 1cc3fca commit f23a9cc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
38 changes: 19 additions & 19 deletions classes/migration/OJSMigration.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(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->smallInteger('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->unique(['path'], 'journals_path');
});

Expand All @@ -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(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->smallInteger('editor_restricted')->default(0);
$table->smallInteger('meta_indexed')->default(0);
$table->smallInteger('meta_reviewed')->default(1);
$table->smallInteger('abstracts_not_required')->default(0);
$table->smallInteger('hide_title')->default(0);
$table->smallInteger('hide_author')->default(0);
$table->smallInteger('is_inactive')->default(0);
$table->bigInteger('abstract_word_count')->nullable();
$table->index(['journal_id'], 'sections_journal_id');
});
Expand All @@ -78,17 +78,17 @@ public function up() {
$table->smallInteger('volume')->nullable();
$table->string('number', 40)->nullable();
$table->smallInteger('year')->nullable();
$table->boolean('published')->default(false);
$table->boolean('current')->default(false);
$table->smallInteger('published')->default(0);
$table->smallInteger('current')->default(0);
$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(false);
$table->boolean('show_number')->default(false);
$table->boolean('show_year')->default(false);
$table->boolean('show_title')->default(false);
$table->smallInteger('show_volume')->default(0);
$table->smallInteger('show_number')->default(0);
$table->smallInteger('show_year')->default(0);
$table->smallInteger('show_title')->default(0);
$table->string('style_file_name', 90)->nullable();
$table->string('original_style_file_name', 255)->nullable();
$table->string('url_path', 64)->nullable();
Expand Down Expand Up @@ -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(false);
$table->smallInteger('is_approved')->default(0);
$table->string('url_path', 64)->nullable();
$table->index(['publication_id'], 'publication_galleys_publication_id');
$table->index(['url_path'], 'publication_galleys_url_path');
Expand All @@ -234,12 +234,12 @@ public function up() {
$table->bigInteger('journal_id');
$table->float('cost', 8, 2);
$table->string('currency_code_alpha', 3);
$table->boolean('non_expiring')->default(false);
$table->smallInteger('non_expiring')->default(0);
$table->smallInteger('duration')->nullable();
$table->smallInteger('format');
$table->boolean('institutional')->default(false);
$table->boolean('membership')->default(false);
$table->boolean('disable_public_display');
$table->smallInteger('institutional')->default(0);
$table->smallInteger('membership')->default(0);
$table->smallInteger('disable_public_display');
$table->float('seq', 8, 2);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(false);
$table->smallInteger('is_inactive')->default(0);
});
}

Expand Down

0 comments on commit f23a9cc

Please sign in to comment.