connection->getDatabasePlatform(); $table = $schema->getTable('short_urls'); $column = $table->getColumn('short_code'); match (true) { is_subclass_of($platformClass, MySQLPlatform::class) => $column ->setPlatformOption('charset', 'utf8mb4') ->setPlatformOption('collation', 'utf8mb4_bin'), is_subclass_of($platformClass, SQLitePlatform::class) => $column->setPlatformOption('collate', 'BINARY'), default => null, }; } public function down(Schema $schema): void { // Nothing to roll back } public function isTransactional(): bool { return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform); } }