Optimised scanning and importing
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class PhotosRenameFields extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('photo', function(Blueprint $table)
|
||||
{
|
||||
$table->renameColumn('date_taken', 'date_created');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('photo', function(Blueprint $table)
|
||||
{
|
||||
$table->renameColumn('date_created', 'date_taken');
|
||||
});
|
||||
}
|
||||
}
|
51
database/migrations/2018_01_11_090453_VideoAddScanned.php
Normal file
51
database/migrations/2018_01_11_090453_VideoAddScanned.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class VideoAddScanned extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('photo', function (Blueprint $table) {
|
||||
$table->boolean('scanned')->nullable();
|
||||
$table->string('file_signature')->nullable();
|
||||
$table->string('identifier')->nullable();
|
||||
$table->string('software')->nullable();
|
||||
});
|
||||
|
||||
Schema::table('videos', function (Blueprint $table) {
|
||||
$table->boolean('scanned')->nullable();
|
||||
$table->string('file_signature')->nullable();
|
||||
$table->string('identifier')->nullable();
|
||||
$table->string('software')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('photo', function (Blueprint $table) {
|
||||
$table->dropColumn('scanned');
|
||||
$table->dropColumn('file_signature');
|
||||
$table->dropColumn('identifier');
|
||||
$table->dropColumn('software');
|
||||
});
|
||||
Schema::table('videos', function (Blueprint $table) {
|
||||
$table->dropColumn('scanned');
|
||||
$table->dropColumn('file_signature');
|
||||
$table->dropColumn('identifier');
|
||||
$table->dropColumn('software');
|
||||
});
|
||||
}
|
||||
}
|
54
database/migrations/2018_01_13_120330_PhotoAddIndex.php
Normal file
54
database/migrations/2018_01_13_120330_PhotoAddIndex.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class PhotoAddIndex extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('photo', function (Blueprint $table) {
|
||||
$table->index(['signature']);
|
||||
$table->index(['filename']);
|
||||
$table->index(['remove']);
|
||||
$table->index(['duplicate']);
|
||||
$table->index(['date_created','subsectime','model','make']);
|
||||
});
|
||||
Schema::table('videos', function (Blueprint $table) {
|
||||
$table->index(['signature']);
|
||||
$table->index(['filename']);
|
||||
$table->index(['remove']);
|
||||
$table->index(['duplicate']);
|
||||
$table->index(['date_created','model','make']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('photo', function (Blueprint $table) {
|
||||
$table->dropIndex(['signature']);
|
||||
$table->dropIndex(['filename']);
|
||||
$table->dropIndex(['remove']);
|
||||
$table->dropIndex(['duplicate']);
|
||||
$table->dropIndex(['date_created','subsectime','model','make']);
|
||||
});
|
||||
Schema::table('videos', function (Blueprint $table) {
|
||||
$table->dropIndex(['signature']);
|
||||
$table->dropIndex(['filename']);
|
||||
$table->dropIndex(['remove']);
|
||||
$table->dropIndex(['duplicate']);
|
||||
$table->dropIndex(['date_created','model','make']);
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user