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

Registry is at version 0 but latest is 1.1. Please run the "upgrade" conmand #271

Closed
arnaldop opened this issue Nov 18, 2015 · 6 comments
Closed
Assignees
Milestone

Comments

@arnaldop
Copy link

I ran a command from shell history:

sqitch revert -y && sqitch --verbose deploy --mode change

I had just dropped all objects including the Sqitch schema, so the database was blank.

I sa #234 but my message is slightly different:

Registry is at version 0 but latest is 1.1. Please run the "upgrade" conmand

Please advise. For now the fix is to not run revert on an empty database.

Thanks!

@theory
Copy link
Collaborator

theory commented Nov 18, 2015

Are you using SQLite? If so, this commit might address the issue.

@arnaldop
Copy link
Author

No, I'm on Postgres.
Thanks!

On Wed, Nov 18, 2015 at 11:48 AM, David E. Wheeler <notifications@github.com

wrote:

Are you using SQLite? If so, this commit
dcbbe6d
might address the issue.


Reply to this email directly or view it on GitHub
#271 (comment).

@theory
Copy link
Collaborator

theory commented Nov 18, 2015

This error happens when sqitch finds no registry schema objects. Without them, you cannot revert. Sqitch uses the registry to decide what to revert. Since you dropped them, it thinks that the registry is out-of-date. I'll improve it to detect when the registry simply isn't there. Meanwhile, to fix your issue, you'll have to revert all your changes yourself, or else drop the whole database and create a new one.

@arnaldop
Copy link
Author

That's fine. I just figured the fix you just described would be a more
robust behavior for the app. I worked around it, though. Thanks again!

On Wed, Nov 18, 2015 at 2:26 PM, David E. Wheeler notifications@github.com
wrote:

This error happens when sqitch finds no registry schema objects. Without
them, you cannot revert. Sqitch uses the registry to decide what to revert.
Since you dropped them, it thinks that the registry is out-of-date. I'll
improve it to detect when the registry simply isn't there. Meanwhile, to
fix your issue, you'll have to revert all your changes yourself, or else
drop the whole database and create a new one.


Reply to this email directly or view it on GitHub
#271 (comment).

@theory theory added this to the v1.0.0 milestone Dec 3, 2015
@theory theory self-assigned this Dec 3, 2015
@theory theory closed this as completed in ba1539e Jan 7, 2016
@EmilGerth
Copy link

This error also occurs if the account Sqitch is using does not have permission to the sqitch schema in Postgres (maybe others, too). Found this thread searching that error, and my solution ended up being those permissions. Important to note this error implies not having USAGE on sqitch - you will get a more specific "permission denied on relation" message if you are missing table access.

The quickest solution is to just make the account running your deployment owner of the database. ALTER DATABASE database OWNER TO role;

@theory
Copy link
Collaborator

theory commented Jan 18, 2018

Yeah, the Postgres user that runs Sqitch more or less needs admin access to the database. Owning the DB is the simplest way to do that, but if you use a single Sqitch user for a bunch of DBs on the same host, it's probably easiest to make that user a superuser. I tend to use a use other than postgres so that it's separate from other superuser use cases.

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

No branches or pull requests

3 participants