Open Journal Systems  3.3.0
TombstoneMigration.inc.php
1 <?php
2 
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;
18 
19 class TombstoneMigration extends Migration {
24  public function up() {
25  // Unnavailable data object tombstones.
26  Capsule::schema()->create('data_object_tombstones', function (Blueprint $table) {
27  $table->bigInteger('tombstone_id')->autoIncrement();
28  $table->bigInteger('data_object_id');
29  $table->datetime('date_deleted');
30  $table->string('set_spec', 255);
31  $table->string('set_name', 255);
32  $table->string('oai_identifier', 255);
33  $table->index(['data_object_id'], 'data_object_tombstones_data_object_id');
34  });
35 
36  // Data object tombstone settings.
37  Capsule::schema()->create('data_object_tombstone_settings', function (Blueprint $table) {
38  $table->bigInteger('tombstone_id');
39  $table->string('locale', 14)->default('');
40  $table->string('setting_name', 255);
41  $table->text('setting_value')->nullable();
42  $table->string('setting_type', 6)->comment('(bool|int|float|string|object)');
43  $table->index(['tombstone_id'], 'data_object_tombstone_settings_tombstone_id');
44  $table->unique(['tombstone_id', 'locale', 'setting_name'], 'data_object_tombstone_settings_pkey');
45  });
46 
47  // Objects that are part of a data object tombstone OAI set.
48  Capsule::schema()->create('data_object_tombstone_oai_set_objects', function (Blueprint $table) {
49  $table->bigInteger('object_id')->autoIncrement();
50  $table->bigInteger('tombstone_id');
51  $table->bigInteger('assoc_type');
52  $table->bigInteger('assoc_id');
53  $table->index(['tombstone_id'], 'data_object_tombstone_oai_set_objects_tombstone_id');
54  });
55  }
56 
61  public function down() {
62  Capsule::schema()->drop('data_object_tombstone_oai_set_objects');
63  Capsule::schema()->drop('data_object_tombstone_settings');
64  Capsule::schema()->drop('data_object_tombstones');
65  }
66 }
TombstoneMigration\up
up()
Definition: TombstoneMigration.inc.php:24
TombstoneMigration\down
down()
Definition: TombstoneMigration.inc.php:61
TombstoneMigration
Describe database table structures.
Definition: TombstoneMigration.inc.php:19