- 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:
parent
4d22498e2d
commit
c082b4bc60
25 changed files with 463 additions and 86 deletions
|
@ -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(
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
}
|
|
@ -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');
|
||||
}
|
||||
}
|
|
@ -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');
|
||||
}
|
||||
}
|
|
@ -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');
|
||||
}
|
||||
}
|
|
@ -36,7 +36,7 @@ class AccountsTableSeeder extends Seeder
|
|||
'email' => "editor@geologie.ac.at",
|
||||
'password' => bcrypt('rdr007'),
|
||||
'created_at' => Carbon::now(),
|
||||
],
|
||||
],
|
||||
[
|
||||
'login' => "Review",
|
||||
'email' => "review@geologie.ac.at",
|
||||
|
|
170
database/seeds/CollectionsTableSeeder.php
Normal file
170
database/seeds/CollectionsTableSeeder.php
Normal file
|
@ -0,0 +1,170 @@
|
|||
<?php
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
||||
class CollectionsTableSeeder extends Seeder
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
|
||||
DB::table('collections_roles')->insert([
|
||||
[
|
||||
'name' => 'bk',
|
||||
'oai_name' => 'bk',
|
||||
'position' => 1,
|
||||
'visible' => true,
|
||||
'visible_frontdoor' => true,
|
||||
'visible_oai' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'ccs',
|
||||
'oai_name' => 'ccs',
|
||||
'position' => 2,
|
||||
'visible' => true,
|
||||
'visible_frontdoor' => true,
|
||||
'visible_oai' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'ddc',
|
||||
'oai_name' => 'ddc',
|
||||
'position' => 3,
|
||||
'visible' => true,
|
||||
'visible_frontdoor' => true,
|
||||
'visible_oai' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'institutes',
|
||||
'oai_name' => 'institutes',
|
||||
'position' => 4,
|
||||
'visible' => true,
|
||||
'visible_frontdoor' => true,
|
||||
'visible_oai' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'jel',
|
||||
'oai_name' => 'jel',
|
||||
'position' => 5,
|
||||
'visible' => true,
|
||||
'visible_frontdoor' => true,
|
||||
'visible_oai' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'msc',
|
||||
'oai_name' => 'msc',
|
||||
'position' => 6,
|
||||
'visible' => true,
|
||||
'visible_frontdoor' => true,
|
||||
'visible_oai' => true,
|
||||
],
|
||||
[
|
||||
'name' => 'pacs',
|
||||
'oai_name' => 'pacs',
|
||||
'position' => 7,
|
||||
'visible' => true,
|
||||
'visible_frontdoor' => true,
|
||||
'visible_oai' => true,
|
||||
],
|
||||
]);
|
||||
|
||||
DB::table('collections')->insert([
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => null,
|
||||
'name' => 'Informatik, Informationswissenschaft, allgemeine Werke',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => null,
|
||||
'name' => 'Philosophie und Psychologie',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => null,
|
||||
'name' => 'Religion',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => null,
|
||||
'name' => 'Sozialwissenschaften',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => null,
|
||||
'name' => 'Sprache',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => null,
|
||||
'name' => 'Naturwissenschaften und Mathematik',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => null,
|
||||
'name' => 'Technik, Medizin, angewandte Wissenschaften',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => null,
|
||||
'name' => 'Künste und Unterhaltung',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => null,
|
||||
'name' => 'Literatur',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => null,
|
||||
'name' => 'Geschichte und Geografie',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => 3,
|
||||
'name' => 'Informatik, Wissen, Systeme',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => 3,
|
||||
'name' => 'Bibliografien',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => 3,
|
||||
'name' => 'Bibliotheks- und Informationswissenschaften',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => 3,
|
||||
'name' => 'Enzyklopädien, Faktenbücher',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => 3,
|
||||
'name' => 'Zeitschriften, fortlaufende Sammelwerke',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => 3,
|
||||
'name' => 'Verbände, Organisationen, Museen',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => 3,
|
||||
'name' => 'Publizistische Medien, Journalismus, Verlagswesen',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => 3,
|
||||
'name' => 'Allgemeine Sammelwerke, Zitatensammlungen',
|
||||
],
|
||||
[
|
||||
'role_id' => 2,
|
||||
'parent_id' => 3,
|
||||
'name' => 'Handschriften, seltene Bücher',
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -29,6 +29,7 @@ class DatabaseSeeder extends Seeder
|
|||
$this->call('LicencesTableSeeder');
|
||||
$this->call('LanguagesTableSeeder');
|
||||
$this->call('PagesTableSeeder');
|
||||
$this->call('CollectionsTableSeeder');
|
||||
$this->command->info('User table seeded!');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,6 +181,14 @@ class RolesTableSeeder extends Seeder
|
|||
'permission_id' => '2', //permission 'page'
|
||||
'role_id' => '1', //administrator role
|
||||
],
|
||||
[
|
||||
'permission_id' => '3', //permission 'dataset-list'
|
||||
'role_id' => '1', //administrator role
|
||||
],
|
||||
[
|
||||
'permission_id' => '4', //permission 'dataset-submit'
|
||||
'role_id' => '1', //administrator role
|
||||
],
|
||||
[
|
||||
'permission_id' => '3', //permission 'dataset-list'
|
||||
'role_id' => '2', //submitter role
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue