You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's the situation. We want to start using a migrator for our database. We already have customers with an existing database. I've written all the migrations that create a new database and updates it. My idea is that for existing customers, during the update to the next version, it will detect if there is a "migrations" table. If not, it will create it and fill it with existing migrations so they don't get run.
I created a new migration and when I run it in this scenario, I get the error above in the title.
For a new install where db-migrate was used to create the database, this problem does not exist.
Expected behavior
I would have expected the migration to be inserted into the migration table without error. It appears that when it's doing the insert it is also inserting the primary key (1 in this case) instead of using the DEFAULT key word (postgreSQL) to automatically increment the insert.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
db-migrate version: 0.10.5
plugins with versions: X.Y.Z
db-migrate driver with versions: db-migrate-pg 0.3.1
Additional information:
- Node version: 6.12.3
- Platform: Linux
Others:
The text was updated successfully, but these errors were encountered:
I discovered when creating the migrations table with the sequence, I need to set the "START WITH" to the correct count of expected migrations (rows) in the table:
CREATE SEQUENCE ivtinternal.migrations_id_seq
START WITH 39 <-- was 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
I'm submitting a...
Current behavior
Here's the situation. We want to start using a migrator for our database. We already have customers with an existing database. I've written all the migrations that create a new database and updates it. My idea is that for existing customers, during the update to the next version, it will detect if there is a "migrations" table. If not, it will create it and fill it with existing migrations so they don't get run.
I created a new migration and when I run it in this scenario, I get the error above in the title.
For a new install where db-migrate was used to create the database, this problem does not exist.
Expected behavior
I would have expected the migration to be inserted into the migration table without error. It appears that when it's doing the insert it is also inserting the primary key (1 in this case) instead of using the DEFAULT key word (postgreSQL) to automatically increment the insert.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: