v0.9.12
This commit is contained in:
commit
e50fe9b0c2
298 files changed
+20885
No files matched your search
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use IriksIT\Manager\Support\Names;
|
||||
use IriksIT\Manager\Support\Tables;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
$users = (new (config('manager.user_model')))->getTable();
|
||||
|
||||
// The file itself is elsewhere: `disk` says where, `location` is its path there.
|
||||
Tables::create(Names::table('media'), function (Blueprint $table) use ($users) {
|
||||
$table->id();
|
||||
$table->string('disk', 40);
|
||||
$table->string('location');
|
||||
$table->string('name');
|
||||
$table->string('filename');
|
||||
$table->string('mime_type', 100);
|
||||
$table->unsignedBigInteger('size');
|
||||
$table->string('checksum', 64)->nullable();
|
||||
$table->unsignedInteger('width')->nullable();
|
||||
$table->unsignedInteger('height')->nullable();
|
||||
$table->string('alt', 500)->nullable();
|
||||
// The part of an image that must stay in view when it is cropped to fit:
|
||||
// 0-1 from the left and from the top.
|
||||
$table->decimal('focus_x', 5, 4)->nullable();
|
||||
$table->decimal('focus_y', 5, 4)->nullable();
|
||||
$table->foreignId('uploaded_by')->nullable()->constrained($users)->nullOnDelete();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists(Names::table('media'));
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use IriksIT\Manager\Support\Names;
|
||||
use IriksIT\Manager\Support\Tables;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
// The IriksIT API knows a file by an id of its own: this remembers which id belongs to which path of the `iriksit` disk.
|
||||
Tables::create(Names::table('storage_files'), function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('path')->unique();
|
||||
$table->string('remote_id', 100);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists(Names::table('storage_files'));
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user