photo/database/migrations/0030-make_videos.php

65 lines
1.9 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('videos', function(Blueprint $table)
{
$table->id();
$table->timestamps();
$table->softDeletes();
$table->string('filename',256)->index();
$table->string('file_signature')->nullable();
$table->dateTimeTz('created')->nullable();
$table->dateTimeTz('created_manual')->nullable();
$table->string('signature',64)->index()->nullable();
$table->string('type',32)->nullable();
$table->string('codec',32)->nullable();
$table->integer('audiochannels')->nullable();
$table->string('channelmode',16)->nullable();
$table->float('samplerate',10,)->nullable();
$table->integer('height')->nullable();
$table->integer('width')->nullable();
$table->float('length')->nullable();
$table->integer('orientation')->nullable();
$table->float('gps_lat',10)->nullable();
$table->float('gps_lon',10)->nullable();
$table->float('gps_altitude',10)->nullable();
$table->string('identifier')->nullable();
$table->boolean('duplicate')->default(FALSE)->nullable();
$table->boolean('flag')->default(FALSE)->nullable();
$table->boolean('scanned')->default(FALSE)->nullable();
$table->boolean('ignore_duplicate')->default(FALSE)->nullable();
$table->boolean('remove')->default(FALSE)->nullable();
$table->bigInteger('model_id')->unsigned()->nullable();
$table->foreign('model_id')->references('id')->on('models');
$table->bigInteger('software_id')->unsigned()->nullable();
$table->foreign('software_id')->references('id')->on('software');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('videos');
}
};