14 use Illuminate\Database\Migrations\Migration;
15 use Illuminate\Database\Schema\Builder;
16 use Illuminate\Database\Schema\Blueprint;
17 use Illuminate\Database\Capsule\Manager as Capsule;
24 public function up() {
26 Capsule::schema()->create(
'genres',
function (Blueprint $table) {
27 $table->bigInteger(
'genre_id')->autoIncrement();
28 $table->bigInteger(
'context_id');
29 $table->bigInteger(
'seq');
30 $table->smallInteger(
'enabled')->
default(1);
32 import(
'lib.pkp.classes.submission.Genre');
33 $table->bigInteger(
'category')->default(GENRE_CATEGORY_DOCUMENT);
35 $table->smallInteger(
'dependent')->default(0);
36 $table->smallInteger(
'supplementary')->default(0);
37 $table->string(
'entry_key', 30)->nullable();
41 Capsule::schema()->create(
'genre_settings',
function (Blueprint $table) {
42 $table->bigInteger(
'genre_id');
43 $table->string(
'locale', 14)->
default(
'');
44 $table->string(
'setting_name', 255);
45 $table->text(
'setting_value')->nullable();
46 $table->string(
'setting_type', 6)->comment(
'(bool|int|float|string|object)');
47 $table->index([
'genre_id'],
'genre_settings_genre_id');
48 $table->unique([
'genre_id',
'locale',
'setting_name'],
'genre_settings_pkey');
58 Capsule::schema()->drop(
'genre_settings');
59 Capsule::schema()->drop(
'genres');