- add additional migration files

- add seeder for collections
- coverage x_min, x_max, y_min, y_max
- SitelinkController db-independent
This commit is contained in:
Arno Kaimbacher 2019-09-02 16:58:08 +02:00
parent 4d22498e2d
commit c082b4bc60
25 changed files with 463 additions and 86 deletions

View file

@ -17,7 +17,7 @@ class CreateDocumentsTable extends Migration
$table->increments('id');
$table->string('contributing_corporation', 50)->nullable();
$table->string('creating_corporation', 50);
$table->dateTime('embargo_date');
$table->dateTime('embargo_date')->nullable();
$table->integer('project_id')->unsigned()->nullable();
$table->foreign('project_id')->references('id')->on('projects');
$table->enum(

View file

@ -16,11 +16,18 @@ class CreatePersonsTable extends Migration
Schema::create('persons', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->integer('registered_at');
$table->boolean('status')->default(1);
$table->timestamps();
$table->string('academic_title', 255)->nullable();
$table->string('date_of_birth', 100)->nullable();
$table->string('email', 100);
$table->string('first_name', 255);
$table->string('last_name', 255);
$table->string('place_of_birth', 255)->nullable();
$table->string('identifier_orcid', 50)->nullable();
$table->string('identifier_gnd', 50)->nullable();
$table->string('identifier_misc', 50)->nullable();
$table->boolean('status')->nullable()->default(1);
$table->integer('registered_at')->nullable();
$table->string('name_type', 50)->nullable();
});
Schema::create('link_documents_persons', function (Blueprint $table) {

View file

@ -13,10 +13,26 @@ class CreateCollectionsTable extends Migration
*/
public function up()
{
Schema::create('collections_roles', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 255);
$table->string('oai_name', 255);
$table->integer('position');
$table->boolean('visible')->default(1);
$table->boolean('visible_frontdoor')->default(1);
$table->boolean('visible_oai')->default(1);
});
Schema::create('collections', function (Blueprint $table) {
$table->increments('id');
$table->integer('role_id')->unsigned()->nullable();
$table->foreign('role_id')
->references('id')->on('collections_roles')
->onUpdate('cascade')->onDelete('cascade');
$table->string('number', 255)->nullable();
$table->string('name', 255)->nullable();
$table->string('name', 255);
$table->string('oai_subset', 255)->nullable();
$table->integer('parent_id')->unsigned()->nullable();
$table->foreign('parent_id')
@ -24,7 +40,6 @@ class CreateCollectionsTable extends Migration
->onUpdate('cascade')->onDelete('cascade');
$table->boolean('visible')->default(1);
$table->boolean('visible_publish')->default(1);
$table->timestamps();
});
Schema::create('link_documents_collections', function (Blueprint $table) {
@ -54,5 +69,6 @@ class CreateCollectionsTable extends Migration
{
Schema::dropIfExists('link_documents_collections');
Schema::dropIfExists('collections');
Schema::dropIfExists('collections_roles');
}
}

View file

@ -1,8 +1,8 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDatasetTitlesTable extends Migration
{
@ -15,12 +15,13 @@ class CreateDatasetTitlesTable extends Migration
{
Schema::create('dataset_titles', function (Blueprint $table) {
$table->increments('id');
$table->integer('document_id')->unsigned();
$table->foreign('document_id')->references('id')->on('documents')
->onUpdate('cascade')->onDelete('cascade');
->onUpdate('cascade')->onDelete('cascade');
$table->text('value');
$table->enum('type', ['sub' => 'sub', 'alternative' => 'alternative', 'translated' => 'translated', 'other' => 'other']);
$table->string('value', 255);
$table->string('language', 3);
});
}

View file

@ -1,8 +1,8 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDatasetAbstractsTable extends Migration
{
@ -15,12 +15,16 @@ class CreateDatasetAbstractsTable extends Migration
{
Schema::create('dataset_abstracts', function (Blueprint $table) {
$table->increments('id');
$table->integer('document_id')->unsigned();
$table->foreign('document_id')->references('id')->on('documents')
->onUpdate('cascade')->onDelete('cascade');
->onUpdate('cascade')->onDelete('cascade');
$table->text('value');
$table->enum(
'type',
['methods' => 'methods', 'series_information' => 'series_information', 'technical_info' => 'technical_info', 'translated' => 'translated', 'other' => 'other']
);
$table->string('value', 255);
$table->string('language', 3);
});
}

View file

@ -0,0 +1,57 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDocumentFilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('document_files', function (Blueprint $table) {
$table->increments('id');
$table->integer('document_id')->unsigned();
$table->foreign('document_id')->references('id')->on('documents')
->onUpdate('cascade')->onDelete('cascade');
$table->string('path_name', 50);
$table->string('label', 50)->nullable();
$table->string('comment', 255)->nullable();
$table->string('mime_type', 255)->nullable();
$table->string('language', 3)->nullable();
$table->bigInteger('file_size');
$table->boolean('visible_in_frontdoor')->default(1);
$table->boolean('visible_in_oai')->default(1);
$table->integer('sort_order');
$table->nullableTimestamps();
});
Schema::create('file_hashvalues', function (Blueprint $table) {
$table->integer('file_id')->unsigned();
$table->foreign('file_id')->references('id')->on('document_files')
->onUpdate('cascade')->onDelete('cascade');
$table->string('type', 50);
$table->string('value');
$table->primary(['file_id', 'type']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('file_hashvalues');
Schema::dropIfExists('document_files');
}
}

View file

@ -0,0 +1,50 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCoverageTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('coverage', function (Blueprint $table) {
$table->increments('id');
$table->integer('dataset_id')->unsigned();
$table->foreign('dataset_id')->references('id')->on('documents')
->onUpdate('cascade')->onDelete('cascade');
$table->smallInteger('elevation_min')->nullable();
$table->smallInteger('elevation_max')->nullable();
$table->smallInteger('elevation_absolut')->nullable();
$table->smallInteger('depth_min')->nullable();
$table->smallInteger('depth_max')->nullable();
$table->smallInteger('depth_absolut')->nullable();
$table->dateTime('time_min')->nullable();
$table->dateTime('time_max')->nullable();
$table->dateTime('time_absolut')->nullable();
$table->float('x_min')->nullable();
$table->float('x_max')->nullable();
$table->float('y_min')->nullable();
$table->float('y_max')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('coverage');
}
}

View file

@ -0,0 +1,42 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDocumentSubjectsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('document_subjects', function (Blueprint $table) {
$table->increments('id');
$table->integer('document_id')->unsigned();
$table->foreign('document_id')->references('id')->on('documents')
->onUpdate('cascade')->onDelete('cascade');
$table->string('language', 3)->nullable();
$table->enum(
'type',
['uncontrolled']
);
$table->string('value', 255);
$table->string('external_key', 255)->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('document_subjects');
}
}

View file

@ -0,0 +1,46 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDocumentReferencesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//Table for identifiers referencing to related datasets.
Schema::create('document_references', function (Blueprint $table) {
$table->increments('id');
$table->integer('document_id')->unsigned();
$table->foreign('document_id')->references('id')->on('documents')
->onUpdate('cascade')->onDelete('cascade');
$table->enum(
'type',
["DOI", "Handle", "ISBN", "ISSN", "URL", "URN"]
);
$table->enum(
'relation',
["IsCitedBy", "Cites", "IsSupplementTo", "IsSupplementedBy", "IsContinuedBy", "Continues", "HasMetadata", "IsMetadataFor","IsNewVersionOf", "IsPreviousVersionOf", "IsPartOf", "HasPart", "IsReferencedBy", "References", "IsDocumentedBy", "Documents", "IsCompiledBy", "Compiles", "IsVariantFormOf", "IsOriginalFormOf", "IsIdenticalTo", "IsReviewedBy", "Reviews", "IsDerivedFrom", "IsSourceOf"]
);
$table->string('value', 255);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('document_references');
}
}