Open signmeuptwice opened 1 month ago
Did you try this? https://www.doctrine-project.org/projects/doctrine-dbal/en/4.0/how-to/postgresql-identity-migration.html Maybe you need to migrate to SERIAL with DBAL3+ORM2 first, and then to DBAL4+ORM3.
Did you try this? https://www.doctrine-project.org/projects/doctrine-dbal/en/4.0/how-to/postgresql-identity-migration.html Maybe you need to migrate to SERIAL with DBAL3+ORM2 first, and then to DBAL4+ORM3.
Before DBAL4+ORM3 I was on mariadb and upgraded DBAL, ORM and changed to PostgreSQL at the same time so I don't think this applies since it is specific to databases in postgres but mine is a mariadb. So I think this case should not apply; we are just in a case of migrating from MariaDB to Postgres right ?
I don't think so. MariaDB doesn't support IDENTITY, so I think you should handle it as if you are migrating from SERIAL
I don't think so. MariaDB doesn't support IDENTITY, so I think you should handle it as if you are migrating from SERIAL
as you see my mariadb was on auto_increment and NOT serial :
`id` int(11) NOT NULL AUTO_INCREMENT,
So are you saying I still need to downgrade ORM and DBAL and convert to serial and run the linked command ?
That seems overly complicated. Surely there must be a simpler way... people migrate all the time and doctrine which is a mature project must have a simple way to do this
The weird think is after PGLOADER I have no sequence files and everything works just fine so Doctrine is doing all the mess by creating two seq files per table so It must be a bug or config issue.
The weird think is after PGLOADER I have no sequence files and everything works just fine so Doctrine is doing all the mess by creating two seq files per table so It must be a bug or config issue.
This is not a bug. IDENTITY uses its own sequence table, so it makes sense that it needs to be created.
So are you saying I still need to downgrade ORM and DBAL and convert to serial and run the linked command ?
Nope, I'm just suggesting that this might be the simplest solution for you, but you can try following the instructions from the link right away
Nope, I'm just suggesting that this might be the simplest solution for you, but you can try following the instructions from the link right away
I just tried running the command and it does not even work anyway... wrong syntax ..
I managed to get correct sequence files on import I just need a way to tell doctrine, stop create new sequences and use the one that is there....
This is not a bug. IDENTITY uses its own sequence table, so it makes sense that it needs to be created.
Is it a bug if the sequence already exists and it creates a new one over it ? because I now have a sequence file created right after pgloader and it is correct
I also had this problem before. Actually, you need to deploy MariaDB and PSQL first before doing anything else. You can use the Servbay tool to deploy and manage MariaDB and PSQL simultaneously.
Hello, please can you elaborate "you need to deploy MariaDB and PSQL first before doing anything else" I don't understand. I have a pgsql and mariadb running. My issue is with doctrine messing it all up. How did you solve the issue ?
Support Question
Sorry for asking here but I have been on this for days and I cannot find a solution.
I have been migrating from MySQL to PostgreSQL
I import my old MariaDB data into Postgre using PGLoader and my app works just fine right after import. Please note that at this point there are no
id_seq
files generated BUT my app works just fine. I can add new entries without error.here is a screen of id column after pgloader![Screenshot 2024-07-24 at 08 02 55](https://github.com/user-attachments/assets/f6eb8939-6cbc-486b-b720-7cd609fbf10a)
All my entities are like so on the
id
column:I now would like to sync doctrine with the new postgres database with
the generated migration has for each table something like this
after migration doctrine created TWO sequence files per table named:
post_id_seq
that has the correct sequence number let say 344 andpost_id_seq1
that has a sequence of 1 which is NOT correcthere is after migration
![Screenshot 2024-07-23 at 13 41 45](https://github.com/user-attachments/assets/ec24ccd9-68c9-4546-9e11-365d7f8c21da)
now if I insert a new record I get error
That is because Postgres is following
post_id_seq1
So my question is what is going on ? I honestly do not understand what I am doing wrong and why doctrine seems to be creating two sequence files ?