Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
62
src/Domain/Media/Migrations/CreateImagesTableWithSchema.php
Normal file
62
src/Domain/Media/Migrations/CreateImagesTableWithSchema.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\Media\Migrations;
|
||||
|
||||
use App\Framework\Database\ConnectionInterface;
|
||||
use App\Framework\Database\Migration\Migration;
|
||||
use App\Framework\Database\Migration\MigrationVersion;
|
||||
use App\Framework\Database\Schema\Blueprint;
|
||||
use App\Framework\Database\Schema\Schema;
|
||||
|
||||
final class CreateImagesTableWithSchema implements Migration
|
||||
{
|
||||
public function up(ConnectionInterface $connection): void
|
||||
{
|
||||
$schema = new Schema($connection);
|
||||
|
||||
$schema->create('images', function (Blueprint $table) {
|
||||
$table->ulid('ulid')->primary();
|
||||
$table->string('filename', 255);
|
||||
$table->string('original_filename', 255);
|
||||
$table->string('mime_type', 100);
|
||||
$table->bigInteger('file_size');
|
||||
$table->unsignedInteger('width');
|
||||
$table->unsignedInteger('height');
|
||||
$table->string('hash', 255)->unique();
|
||||
$table->string('path', 500);
|
||||
$table->text('alt_text');
|
||||
$table->timestamps();
|
||||
|
||||
// Indexes
|
||||
$table->unique(['hash'], 'uk_images_hash');
|
||||
$table->index(['mime_type']);
|
||||
$table->index(['created_at']);
|
||||
|
||||
// Table options
|
||||
$table->engine('InnoDB');
|
||||
$table->charset('utf8mb4');
|
||||
$table->collation('utf8mb4_unicode_ci');
|
||||
});
|
||||
|
||||
$schema->execute();
|
||||
}
|
||||
|
||||
public function down(ConnectionInterface $connection): void
|
||||
{
|
||||
$schema = new Schema($connection);
|
||||
$schema->dropIfExists('images');
|
||||
$schema->execute();
|
||||
}
|
||||
|
||||
public function getVersion(): MigrationVersion
|
||||
{
|
||||
return MigrationVersion::fromTimestamp("2024_01_17_000003");
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return "Create Images Table with Schema Builder";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user