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:
@@ -1,26 +1,41 @@
|
||||
<?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\Schema;
|
||||
|
||||
final readonly class AddSizeToImageVariantsTable implements Migration
|
||||
{
|
||||
|
||||
public function up(ConnectionInterface $connection): void
|
||||
{
|
||||
$connection->execute("ALTER TABLE image_variants ADD COLUMN size VARCHAR(25) NOT NULL DEFAULT ''");
|
||||
$schema = new Schema($connection);
|
||||
|
||||
/*$schema->table('image_variants', function ($table) {
|
||||
$table->string('size', 25)->default('');
|
||||
});*/
|
||||
|
||||
if (! $schema->hasColumn('image_variants', 'size')) {
|
||||
$connection->execute("ALTER TABLE image_variants ADD COLUMN size VARCHAR(25) NOT NULL DEFAULT ''");
|
||||
}
|
||||
}
|
||||
|
||||
public function down(ConnectionInterface $connection): void
|
||||
{
|
||||
$connection->execute("ALTER TABLE image_variants DROP COLUMN size");
|
||||
$schema = new Schema($connection);
|
||||
|
||||
if ($schema->hasColumn('image_variants', 'size')) {
|
||||
$connection->execute("ALTER TABLE image_variants DROP COLUMN size");
|
||||
}
|
||||
}
|
||||
|
||||
public function getVersion(): string
|
||||
public function getVersion(): MigrationVersion
|
||||
{
|
||||
return "005";
|
||||
return MigrationVersion::fromTimestamp("2024_01_16_000005");
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
<?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;
|
||||
|
||||
final readonly class CreateImageSlotsTable implements Migration
|
||||
{
|
||||
|
||||
public function up(ConnectionInterface $connection): void
|
||||
{
|
||||
$sql = <<<SQL
|
||||
@@ -31,9 +33,9 @@ SQL;
|
||||
$connection->execute("DROP TABLE IF EXISTS image_slots");
|
||||
}
|
||||
|
||||
public function getVersion(): string
|
||||
public function getVersion(): MigrationVersion
|
||||
{
|
||||
return "004";
|
||||
return MigrationVersion::fromTimestamp("2024_01_15_000004");
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<?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;
|
||||
|
||||
final class CreateImageVariantsTable implements Migration
|
||||
{
|
||||
|
||||
public function up(ConnectionInterface $connection): void
|
||||
{
|
||||
$sql = <<<SQL
|
||||
@@ -44,9 +45,9 @@ SQL;
|
||||
$connection->execute("DROP TABLE IF EXISTS image_variants");
|
||||
}
|
||||
|
||||
public function getVersion(): string
|
||||
public function getVersion(): MigrationVersion
|
||||
{
|
||||
return "003";
|
||||
return MigrationVersion::fromTimestamp("2024_01_15_000003");
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<?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;
|
||||
|
||||
final class CreateImagesTable implements Migration
|
||||
{
|
||||
|
||||
public function up(ConnectionInterface $connection): void
|
||||
{
|
||||
$sql = <<<SQL
|
||||
@@ -40,9 +41,9 @@ SQL;
|
||||
$connection->execute("DROP TABLE IF EXISTS images");
|
||||
}
|
||||
|
||||
public function getVersion(): string
|
||||
public function getVersion(): MigrationVersion
|
||||
{
|
||||
return "002";
|
||||
return MigrationVersion::fromTimestamp("2024_01_15_000002");
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
|
||||
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";
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
<?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;
|
||||
|
||||
final readonly class UpdateImageVariantsConstraint implements Migration
|
||||
{
|
||||
@@ -23,9 +26,9 @@ final readonly class UpdateImageVariantsConstraint implements Migration
|
||||
$connection->execute("ALTER TABLE image_variants ADD UNIQUE KEY uk_image_variants_combination (image_id, variant_type, format)");
|
||||
}
|
||||
|
||||
public function getVersion(): string
|
||||
public function getVersion(): MigrationVersion
|
||||
{
|
||||
return "006";
|
||||
return MigrationVersion::fromTimestamp("2024_01_18_000006");
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
|
||||
Reference in New Issue
Block a user