cybertec-postgresql / db_migrator

Other
21 stars 8 forks source link

NO MAXVALUE option for sequences #8

Closed fljdin closed 1 year ago

fljdin commented 1 year ago

Hi !

This PR adds a condition in db_migrate_mkforeign() during sequences creation.

When sequence.maxvalue is null, the NO MAXVALUE option is provided to construct a valid SQL instruction. Required for mysql_migrator plugin as sequences are built from auto_increment table attribut.


See issue fljdin/mysql_migrator/issues/1

NOTICE:  Creating sequences ...
WARNING:  Error creating sequence sakila.actor_seq
DETAIL:  syntax error at or near "START": 
WARNING:  Error creating sequence sakila.address_seq
DETAIL:  syntax error at or near "START": 
WARNING:  Error creating sequence sakila.category_seq
DETAIL:  syntax error at or near "START": 
WARNING:  Error creating sequence sakila.city_seq
DETAIL:  syntax error at or near "START": 
WARNING:  Error creating sequence sakila.country_seq
DETAIL:  syntax error at or near "START": 
WARNING:  Error creating sequence sakila.customer_seq
DETAIL:  syntax error at or near "START": 
WARNING:  Error creating sequence sakila.film_seq
DETAIL:  syntax error at or near "START": 
WARNING:  Error creating sequence sakila.inventory_seq
DETAIL:  syntax error at or near "START": 
WARNING:  Error creating sequence sakila.language_seq
DETAIL:  syntax error at or near "START": 
WARNING:  Error creating sequence sakila.payment_seq
DETAIL:  syntax error at or near "START": 
WARNING:  Error creating sequence sakila.rental_seq
DETAIL:  syntax error at or near "START": 
WARNING:  Error creating sequence sakila.staff_seq
DETAIL:  syntax error at or near "START": 
WARNING:  Error creating sequence sakila.store_seq
DETAIL:  syntax error at or near "START": 
laurenz commented 1 year ago

Thanks. I decided to do the same for MINVALUE, which could also be NULL.