Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is ths still mantained? #9

Open
Paillat-dev opened this issue Feb 7, 2024 · 11 comments
Open

Is ths still mantained? #9

Paillat-dev opened this issue Feb 7, 2024 · 11 comments

Comments

@Paillat-dev
Copy link

No description provided.

@iamwildtuna
Copy link
Member

Overall, this driver doesn't make much sense. It is enough just to correctly register the mapping in the doctrine config.

Example doctrine.yaml:

doctrine:
  dbal:
    url: '%env(resolve:DATABASE_URL)%'
    mapping_types:
      int8: integer
      _int8: integer
      int2vector: array
      _text: string
      name: string

If you have a specific problem, write it down.

@Paillat-dev
Copy link
Author

My specific problem is doctrine using NOT DEFERRABLE when doing ALTER TABLE and other things wich is not compatible

@iamwildtuna
Copy link
Member

NOT DEFERRABLE is supported for compatibility with PostgreSQL. NOT DEFERRABLE is a no-op and the default behavior for CockroachDB. What error occurs? And show the migration code please.

@Paillat-dev
Copy link
Author

Here is one of the errors I got:

  ERR    ERR  In ToolsException.php line 19:
  ERR    ERR                                                                                 
  ERR    ERR    [Doctrine\ORM\Tools\ToolsException]                                          
  ERR    ERR    Schema-Tool failed with Error 'An exception occurred while executing a quer  
  ERR    ERR    y: SQLSTATE[42601]: Syntax error: 7 ERROR:  at or near "deferrable": syntax  
  ERR    ERR     error                                                                       
  ERR    ERR    DETAIL:  source SQL:                                                         
  ERR    ERR    ALTER TABLE device_long_urls ADD CONSTRAINT FK_119E7865F1252BC8 FOREIGN KEY  
  ERR    ERR     (short_url_id) REFERENCES short_urls (id) ON DELETE CASCADE NOT DEFERRABLE  
  ERR    ERR     INITIALLY IMMEDIATE                                                         
  ERR    ERR                                                                                 
  ERR    ERR                                                                     ^           
  ERR    ERR    HINT:  try \h ALTER TABLE' while executing DDL: ALTER TABLE device_long_url  
  ERR    ERR    s ADD CONSTRAINT FK_119E7865F1252BC8 FOREIGN KEY (short_url_id) REFERENCES   
  ERR    ERR    short_urls (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE         
  ERR    ERR                                                                                 
  ERR    ERR  
  ERR    ERR  Exception trace:
  ERR    ERR    at /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/ToolsException.php:19
  ERR    ERR   Doctrine\ORM\Tools\ToolsException::schemaToolFailure() at /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php:108
  ERR    ERR   Doctrine\ORM\Tools\SchemaTool->createSchema() at /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/CreateCommand.php:71
  ERR    ERR   Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand->executeSchemaCommand() at /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/Command/SchemaTool/AbstractCommand.php:44
  ERR    ERR   Doctrine\ORM\Tools\Console\Command\SchemaTool\AbstractCommand->doExecute() at /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/CommandCompatibility.php:32
  ERR    ERR   Doctrine\ORM\Tools\Console\Command\SchemaTool\AbstractCommand->execute() at /etc/shlink/vendor/symfony/console/Command/Command.php:326
  ERR    ERR   Symfony\Component\Console\Command\Command->run() at /etc/shlink/vendor/symfony/console/Application.php:1078
  ERR    ERR   Symfony\Component\Console\Application->doRunCommand() at /etc/shlink/vendor/symfony/console/Application.php:324
  ERR    ERR   Symfony\Component\Console\Application->doRun() at /etc/shlink/vendor/symfony/console/Application.php:175
  ERR    ERR   Symfony\Component\Console\Application->run() at /etc/shlink/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php:51
  ERR    ERR   Doctrine\ORM\Tools\Console\ConsoleRunner::run() at /etc/shlink/bin/doctrine:12
  ERR    ERR  
  ERR    ERR  In ExceptionConverter.php line 62:
  ERR    ERR                                                                                 
  ERR    ERR    [Doctrine\DBAL\Exception\SyntaxErrorException (7)]                           
  ERR    ERR    An exception occurred while executing a query: SQLSTATE[42601]: Syntax erro  
  ERR    ERR    r: 7 ERROR:  at or near "deferrable": syntax error                           
  ERR    ERR    DETAIL:  source SQL:                                                         
  ERR    ERR    ALTER TABLE device_long_urls ADD CONSTRAINT FK_119E7865F1252BC8 FOREIGN KEY  
  ERR    ERR     (short_url_id) REFERENCES short_urls (id) ON DELETE CASCADE NOT DEFERRABLE  
  ERR    ERR     INITIALLY IMMEDIATE                                                         
  ERR    ERR                                                                                 
  ERR    ERR                                                                     ^           
  ERR    ERR    HINT:  try \h ALTER TABLE 

l34syknwytgywon2fn2wxu3rj_logs.txt

See cockroachdb/cockroach#31632

@iamwildtuna
Copy link
Member

iamwildtuna commented Feb 8, 2024

I understood the problem. I'll try to release a patch this weekend.

@iamwildtuna
Copy link
Member

In general, this case in the driver has already been fixed

public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey): string

Are you sure you are using our driver?

@Paillat-dev
Copy link
Author

No I am not, that's the point of my question. Is it still up to date? I would love to use it, but since the last commit is from 2 years ago, that's what I was asking in the first palce.

@iamwildtuna
Copy link
Member

Worked, but outdated dependencies and the DBAL version. I'll update the code this weekend. If you share the migrations of your database specifically, it will make it easier for me to test. You can send the password-protected archive to my email nl@wildtuna.pro

@Paillat-dev
Copy link
Author

Worked, but outdated dependencies and the DBAL version. I'll update the code this weekend. If you share the migrations of your database specifically, it will make it easier for me to test. You can send the password-protected archive to my email nl@wildtuna.pro

I am just setting up an instance of https://github.com/shlinkio/shlink with postgres engine.

@iamwildtuna
Copy link
Member

Doctrine DBAL has changed a lot. It will take more time to update the driver.

@Paillat-dev
Copy link
Author

Doctrine DBAL has changed a lot. It will take more time to update the driver.

No problem and thanks very much for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants