In the process of migrating from Mariadb to postgres 16 with these steps:
docker exec -ti app php bin/console doctrine:database:create
docker exec -ti app php bin/console make:migration
docker exec -ti app php bin/console doctrine:migrations:migrate
docker run --rm -it --platform linux/amd64 --network app_network -v ./pgloader.load:/pgloader.load dimitri/pgloader:latest
pgloader pgloader.load
docker exec -ti app php bin/console doctrine:migrations:sync-metadata-storage
pgloader.load:
LOAD DATABASE
FROM mysql://root:root@database/dev
INTO pgsql://app:pass@postgres/dev
WITH include drop, create tables
ALTER SCHEMA 'dev' RENAME TO 'public';
I am getting into a stuck situation where my json migration is not working
php bin/console make:migration
generates
#[ORMColumn(type: 'json', nullable: true, options: ["jsonb" => true])]
private $emoji;
if I look into the migration file:
$this->addSql('ALTER TABLE blog ALTER emoji TYPE JSONB');
If I connect to the DB and look at the schema it is of type text
now everything works BUT doctrine says that migration has not been executed
if I do
php bin/console doctrine:migrations:migrate
I get
SQLSTATE[42804]: Datatype mismatch: 7 ERROR: column "emoji" cannot be cast automatically to type jsonb
HINT: You might need to specify "USING emoji::jsonb".