up charset

This commit is contained in:
Tykayn 2025-06-23 00:53:10 +02:00 committed by tykayn
parent 31bbf6fc36
commit 5b1eca615b
4 changed files with 87 additions and 9 deletions

View file

@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250622224949 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql(<<<'SQL'
ALTER TABLE place CHANGE osm_user osm_user VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`
SQL);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql(<<<'SQL'
ALTER TABLE place CHANGE osm_user osm_user VARCHAR(255) DEFAULT NULL
SQL);
}
}

View file

@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250622225249 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql(<<<'SQL'
ALTER TABLE place CHANGE email email VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE note note VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE name name VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE note_content note_content VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE street street VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE housenumber housenumber VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE siret siret VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE stats CHANGE name name VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`
SQL);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql(<<<'SQL'
ALTER TABLE stats CHANGE name name VARCHAR(255) DEFAULT NULL
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE place CHANGE email email VARCHAR(255) DEFAULT NULL, CHANGE note note VARCHAR(255) DEFAULT NULL, CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE note_content note_content VARCHAR(255) DEFAULT NULL, CHANGE street street VARCHAR(255) DEFAULT NULL, CHANGE housenumber housenumber VARCHAR(255) DEFAULT NULL, CHANGE siret siret VARCHAR(255) DEFAULT NULL
SQL);
}
}

View file

@ -22,7 +22,7 @@ class Place
#[ORM\Column(length: 10)]
private ?string $osm_kind = null;
#[ORM\Column(length: 255, nullable: true)]
#[ORM\Column(length: 255, nullable: true, options: ['charset' => 'utf8mb4'])]
private ?string $email = null;
#[ORM\Column]
@ -31,7 +31,7 @@ class Place
#[ORM\Column]
private ?bool $dead = null;
#[ORM\Column(length: 255, nullable: true)]
#[ORM\Column(length: 255, nullable: true, options: ['charset' => 'utf8mb4'])]
private ?string $note = null;
#[ORM\Column(nullable: true)]
@ -58,7 +58,7 @@ class Place
#[ORM\Column(type: Types::BIGINT)]
private ?string $osmId = null;
#[ORM\Column(length: 255, nullable: true)]
#[ORM\Column(length: 255, nullable: true, options: ['charset' => 'utf8mb4'])]
private ?string $name = null;
#[ORM\Column(nullable: true)]
@ -79,7 +79,7 @@ class Place
#[ORM\Column(nullable: true)]
private ?string $main_tag = null;
#[ORM\Column(length: 255, nullable: true)]
#[ORM\Column(length: 255, nullable: true, options: ['charset' => 'utf8mb4'])]
private ?string $note_content = null;
#[ORM\Column(nullable: true)]
@ -91,13 +91,15 @@ class Place
#[ORM\Column(nullable: true, type: Types::FLOAT)]
private ?float $lon = null;
#[ORM\Column(length: 255, nullable: true)]
#[ORM\Column(length: 255, nullable: true, options: ['charset' => 'utf8mb4'])]
private ?string $street = null;
#[ORM\Column(length: 255, nullable: true)]
#[ORM\Column(length: 255, nullable: true, options: ['charset'
=> 'utf8mb4'])]
private ?string $housenumber = null;
#[ORM\Column(length: 255, nullable: true)]
#[ORM\Column(length: 255, nullable: true, options: ['charset'
=> 'utf8mb4'])]
private ?string $siret = null;
#[ORM\Column(nullable: true)]
@ -109,7 +111,7 @@ class Place
#[ORM\Column(nullable: true)]
private ?int $osm_version = null;
#[ORM\Column(length: 255, nullable: true)]
#[ORM\Column(length: 255, nullable: true, options: ['charset' => 'utf8mb4'])]
private ?string $osm_user = null;
#[ORM\Column(nullable: true)]

View file

@ -52,7 +52,7 @@ class Stats
#[ORM\Column(type: Types::INTEGER, nullable: true)]
private ?int $avec_note = null;
#[ORM\Column(length: 255, nullable: true)]
#[ORM\Column(length: 255, nullable: true, options: ['charset' => 'utf8mb4'] )]
private ?string $name = null;
// nombre d'habitants dans la zone