2019-08-29 14:58:35 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
class CreateDocumentsTable extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
|
|
|
Schema::create('documents', function (Blueprint $table) {
|
|
|
|
$table->increments('id');
|
2019-09-16 15:34:57 +00:00
|
|
|
$table->string('contributing_corporation', 255)->nullable();
|
|
|
|
$table->string('creating_corporation', 255);
|
|
|
|
$table->string('publisher_name', 255)->nullable();
|
2019-09-02 14:58:08 +00:00
|
|
|
$table->dateTime('embargo_date')->nullable();
|
2019-09-17 10:55:01 +00:00
|
|
|
$table->unsignedInteger('publish_id')->unique()->nullable();
|
2019-08-29 14:58:35 +00:00
|
|
|
$table->integer('project_id')->unsigned()->nullable();
|
|
|
|
$table->foreign('project_id')->references('id')->on('projects');
|
|
|
|
$table->enum(
|
|
|
|
'type',
|
2020-01-23 16:52:26 +00:00
|
|
|
// ['analysisdata', 'interpreteddata', 'measurementdata', 'models', 'rawdata', 'supplementarydata', 'mixedtype']
|
|
|
|
['analysisdata', 'measurementdata', 'monitoring', 'remotesensing', 'gis', 'models', 'mixedtype']
|
2019-08-29 14:58:35 +00:00
|
|
|
);
|
|
|
|
$table->string('language', 10);
|
|
|
|
$table->enum(
|
|
|
|
'server_state',
|
2019-09-20 08:26:30 +00:00
|
|
|
Config::get('enums.server_states')
|
2019-08-29 14:58:35 +00:00
|
|
|
)->default('inprogress');
|
|
|
|
$table->boolean('belongs_to_bibliography')->default(0);
|
|
|
|
$table->dateTime('created_at');
|
|
|
|
$table->dateTime('server_date_modified');
|
|
|
|
$table->dateTime('server_date_published')->nullable();
|
|
|
|
$table->integer('account_id')->unsigned()->nullable();
|
|
|
|
$table->integer('editor_id')->unsigned()->nullable();
|
|
|
|
$table->integer('reviewer_id')->unsigned()->nullable();
|
|
|
|
$table->string('preferred_reviewer', 25)->nullable();
|
|
|
|
$table->string('preferred_reviewer_email', 50)->nullable();
|
2019-11-25 13:41:25 +00:00
|
|
|
$table->string('reject_editor_note', 500)->nullable();
|
|
|
|
$table->string('reject_reviewer_note', 500)->nullable();
|
2019-08-29 14:58:35 +00:00
|
|
|
$table->boolean('reviewer_note_visible')->default(false);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('documents');
|
|
|
|
}
|
|
|
|
}
|