Optimised scanning and importing

This commit is contained in:
Deon George
2018-01-11 23:59:53 +11:00
parent 96fadc5080
commit cfc9bf5d9a
26 changed files with 1542 additions and 759 deletions

View File

@@ -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');
});
}
}

View 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');
});
}
}

View 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']);
});
}
}