added migrations for mime_types

This commit is contained in:
Arno Kaimbacher 2019-08-29 17:51:13 +02:00
parent 7641c1dfdf
commit 4d22498e2d
4 changed files with 102 additions and 90 deletions

View File

@ -148,7 +148,7 @@ class RequestController extends Controller
$repositoryName = "RDR - Data Research Repository";
$repIdentifier = "rdr.gba.ac.at";
$sampleIdentifier = "oai:" . $repIdentifier . ":27";//$this->_configuration->getSampleIdentifier();
$earliestDateFromDb = Dataset::earliestPublicationDate()->get('server_date_published');
$earliestDateFromDb = optional(Dataset::earliestPublicationDate())->server_date_published;
// set parameters for oai-pmh.xslt
$this->_proc->setParameter('', 'email', $email);

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMimeTypesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mime_types', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 255);
$table->string('file_extension', 255);
$table->boolean('enabled')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mime_types');
}
}

View File

@ -23,7 +23,7 @@ class DatabaseSeeder extends Seeder
// $this->call('CategoryTableSeeder');
// $this->call('BookTableSeeder');
// $this->call('PeriodeTableSeeder');
$this->call('MimetypeTableSeeder');
$this->call('AccountsTableSeeder');
$this->call('RolesTableSeeder');
$this->call('LicencesTableSeeder');
@ -33,67 +33,6 @@ class DatabaseSeeder extends Seeder
}
}
class PeriodeTableSeeder extends Seeder
{
public function run()
{
// DB::table('users')->delete();
// User::create([
// 'name' => str_random(10),
// 'email' => 'foo@gmail.com',
// 'password' => bcrypt('secret')
// ]);
DB::table('periodes')->insert([
'id' => '1',
'days' => '100',
]);
}
}
class CategoryTableSeeder extends Seeder
{
public function run()
{
// DB::table('users')->delete();
// User::create([
// 'name' => str_random(10),
// 'email' => 'foo@gmail.com',
// 'password' => bcrypt('secret')
// ]);
DB::table('categories')->insert([
[
// 'id' => '1',
'category' => 'Sains',
'created_at' => '2015-06-09 00:17:51',
'updated_at' => '2015-06-09 01:01:36',
],
[
// 'id' => '2',
'category' => 'Computer',
'created_at' => '2015-06-09 01:07:41',
'updated_at' => '2015-06-09 01:07:41',
],
[
// 'id' => '3',
'category' => 'Life Lesson',
'created_at' => '2015-06-09 01:07:50',
'updated_at' => '2015-06-09 01:07:50',
],
[
// 'id' => '4',
'category' => 'Fairy Tail',
'created_at' => '2015-06-09 01:07:50',
'updated_at' => '2015-06-09 01:07:50',
],
]);
}
}
class CollectionTableSeeder extends Seeder
{
public function run()
@ -149,29 +88,3 @@ class CollectionTableSeeder extends Seeder
]);
}
}
class DocumentTableSeeder extends Seeder
{
public function run()
{
DB::table('documents')->insert([
[
'id' => '0',
],
[
'id' => '1',
],
]);
DB::table('link_documents_collections')->insert([
[
'document_id' => '0',
'collection_id' => '1',
],
[
'document_id' => '1',
'collection_id' => '1',
],
]);
}
}

View File

@ -0,0 +1,65 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class MimetypeTableSeeder extends Seeder
{
public function run()
{
DB::table('mime_types')->insert([
[
'name' => 'image/jpeg',
'file_extension' => 'jpg|jpeg|jpe',
'enabled' =>true,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
[
'name' => 'image/png',
'file_extension' => 'png',
'enabled' =>true,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
[
'name' => 'application/pdf',
'file_extension' => 'pdf',
'enabled' =>true,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
[
'name' => 'text/html',
'file_extension' => 'htm|html',
'enabled' =>true,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
[
'name' => 'text/csv',
'file_extension' => 'csv',
'enabled' =>true,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
[
'name' => 'text/plain',
'file_extension' => 'txt|asc|c|cc|h|srt',
'enabled' =>true,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
[
'name' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'file_extension' => 'xlsx',
'enabled' =>true,
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],
]);
}
}