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

2.5 #61

Merged
merged 18 commits into from
Apr 6, 2018
Merged

2.5 #61

merged 18 commits into from
Apr 6, 2018

Conversation

timgit
Copy link
Owner

@timgit timgit commented Feb 21, 2018

No description provided.

@coveralls
Copy link

coveralls commented Feb 21, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling b47fb6a on feature/archive into dc0a34e on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 6dc2040 on feature/archive into a226d24 on master.

@timgit timgit merged commit 8d38a15 into master Apr 6, 2018
@timgit timgit deleted the feature/archive branch April 6, 2018 04:45
@phips28
Copy link
Contributor

phips28 commented Apr 6, 2018

@timgit 2.5.0 broke prev version compatibility. :(
if you have breaking changes, you should always upgrade to a major version 3.0.0!!

Now I had to fix my version to "pg-boss": "2.4.4"

@phips28
Copy link
Contributor

phips28 commented Apr 6, 2018

after some investigation, I found it was an error in the migrate.

...start()

  1. it created the archive table, and ALTER to add archivedOn column
  2. it failed to update version to 7

at next start, it tried to migrate again, because version is still 6 in database, but archive tables was already created.

  1. CREATE IF NOT EXISTS works, but the ALTER add archivedOn throws an error:
    column "archivedon" of relation "archive" already exists

now I had to resolve this by hand to set the version to 7.

Solution: do the migration commands within a tx (BEGIN & COMMIT)

BEGIN;
CREATE TABLE
ALTER TABLE
UPDATE version
COMMIT;

It would rollback if there is any error until COMMIT. Therefore db is clean at the next server start and it can try again to migrate.
If you need more info, let me know ;)

@timgit
Copy link
Owner Author

timgit commented Apr 6, 2018

Phil, thanks for posting. I have migration tests that should have caught this. I’ll figure this out and write a test to repro.

@timgit timgit mentioned this pull request Apr 7, 2018
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

Successfully merging this pull request may close these issues.

3 participants