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

Schema version comment doesn't end up in Rails structure.sql #363

Closed
milgner opened this issue May 20, 2022 · 3 comments
Closed

Schema version comment doesn't end up in Rails structure.sql #363

milgner opened this issue May 20, 2022 · 3 comments

Comments

@milgner
Copy link

milgner commented May 20, 2022

While investigating possible reasons for #350 I was checking whether the DB schema was up-to-date and noticed that que keeps it on a table comment.

Unfortunately this comment doesn't end up in Rails' structure.sql so it isn't added to new systems (including development and test databases) that run rake db:structure:load to prepare the database.

At first glance, there seem to be two possible solutions: get Rails to dump comments (might have additional benefits because one could use them to document the schema) or introduce a separate version column or table for que (less dependencies and reliance on specific Rails behaviour).

@milgner
Copy link
Author

milgner commented May 20, 2022

Looks like this was already changed in Rails:

We're currently on Rails 7.0.2 which has --no-comments but this line is gone in 7.0.3...

Might be worth mentioning in the Readme, to help people running into the same issue?

@milgner
Copy link
Author

milgner commented Jun 8, 2022

Gonna close this issue as it has been fixed in Rails 7.0.3 so it won't be a problem with new users anymore. Existing users should be able to find this issue and resolution through the search function.

@ZimbiX
Copy link
Member

ZimbiX commented Aug 26, 2022

I believe we just had another user get stung by this, noted in #376.

Here's where the Rails bug was: introduced, resolved. The fix was indeed released in Rails 7.0.3.

Going by the Git tags shown in the commit that introduced the issue, it looks like the issue affects every version of Rails 7 prior to 7.0.3:

image

I wonder if we should not just document it, but add code to detect the lack of schema version comment and warn/raise!

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