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(
'citations',
function (Blueprint $table) {
27 $table->bigInteger(
'citation_id')->autoIncrement();
28 $table->bigInteger(
'publication_id')->
default(0);
29 $table->text(
'raw_citation');
30 $table->bigInteger(
'seq')->
default(0);
31 $table->index([
'publication_id'],
'citations_publication');
32 $table->unique([
'publication_id',
'seq'],
'citations_publication_seq');
36 Capsule::schema()->create(
'citation_settings',
function (Blueprint $table) {
37 $table->bigInteger(
'citation_id');
38 $table->string(
'locale', 14)->
default(
'');
39 $table->string(
'setting_name', 255);
40 $table->text(
'setting_value')->nullable();
41 $table->string(
'setting_type', 6);
42 $table->index([
'citation_id'],
'citation_settings_citation_id');
43 $table->unique([
'citation_id',
'locale',
'setting_name'],
'citation_settings_pkey');
47 Capsule::schema()->create(
'metadata_descriptions',
function (Blueprint $table) {
48 $table->bigInteger(
'metadata_description_id')->autoIncrement();
49 $table->bigInteger(
'assoc_type')->
default(0);
50 $table->bigInteger(
'assoc_id')->
default(0);
51 $table->string(
'schema_namespace', 255);
52 $table->string(
'schema_name', 255);
53 $table->string(
'display_name', 255)->nullable();
54 $table->bigInteger(
'seq')->
default(0);
55 $table->index([
'assoc_type',
'assoc_id'],
'metadata_descriptions_assoc');
59 Capsule::schema()->create(
'metadata_description_settings',
function (Blueprint $table) {
60 $table->bigInteger(
'metadata_description_id');
61 $table->string(
'locale', 14)->
default(
'');
62 $table->string(
'setting_name', 255);
63 $table->text(
'setting_value')->nullable();
64 $table->string(
'setting_type', 6);
65 $table->index([
'metadata_description_id'],
'metadata_description_settings_id');
66 $table->unique([
'metadata_description_id',
'locale',
'setting_name'],
'metadata_descripton_settings_pkey');
70 Capsule::schema()->create(
'filter_groups',
function (Blueprint $table) {
71 $table->bigInteger(
'filter_group_id')->autoIncrement();
72 $table->string(
'symbolic', 255)->nullable();
73 $table->string(
'display_name', 255)->nullable();
74 $table->string(
'description', 255)->nullable();
75 $table->string(
'input_type', 255)->nullable();
76 $table->string(
'output_type', 255)->nullable();
77 $table->unique([
'symbolic'],
'filter_groups_symbolic');
81 Capsule::schema()->create(
'filters',
function (Blueprint $table) {
82 $table->bigInteger(
'filter_id')->autoIncrement();
83 $table->bigInteger(
'filter_group_id')->
default(0);
84 $table->bigInteger(
'context_id')->
default(0);
85 $table->string(
'display_name', 255)->nullable();
86 $table->string(
'class_name', 255)->nullable();
87 $table->smallInteger(
'is_template')->
default(0);
88 $table->bigInteger(
'parent_filter_id')->
default(0);
89 $table->bigInteger(
'seq')->
default(0);
93 Capsule::schema()->create(
'filter_settings',
function (Blueprint $table) {
94 $table->bigInteger(
'filter_id');
95 $table->string(
'locale', 14)->
default(
'');
96 $table->string(
'setting_name', 255);
97 $table->text(
'setting_value')->nullable();
98 $table->string(
'setting_type', 6);
99 $table->index([
'filter_id'],
'filter_settings_id');
100 $table->unique([
'filter_id',
'locale',
'setting_name'],
'filter_settings_pkey');
109 Capsule::schema()->drop(
'filter_settings');
110 Capsule::schema()->drop(
'filters');
111 Capsule::schema()->drop(
'filter_groups');
112 Capsule::schema()->drop(
'metadata_description_settings');
113 Capsule::schema()->drop(
'metadata_descriptions');
114 Capsule::schema()->drop(
'citation_settings');
115 Capsule::schema()->drop(
'citations');