-
-
Notifications
You must be signed in to change notification settings - Fork 909
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
Install active_storage migrations #1367
Conversation
753acfe
to
a1154b2
Compare
Just taking some notes. Error on CI with Rails 5.2 and DATABASE_ADAPTER=postgresql:
How to execute the tests using postgresql and Rails 5.2?
And update to_hash method to: def to_hash
ENVIRONMENTS.each_with_object({}) do |env, config_as_hash|
config_as_hash[env] = {
'adapter' => adapter.to_s,
'database' => "#{database}_#{env}",
'host' => 'localhost',
'port' => 5432,
'username' => 'postgres',
'password' => '',
}
end
end |
This is weird. The active_storage tables are being created on postgres database instead of shoulda-matchers-test-development database on Rails 5.2. On Rails 6 it works and because of that, the tests pass. I will keep digging. |
To solves this problem it's necessary to update Rails from 5.2.4.1 to 5.2.4.4. I noticed that the last PR that updated the dependencies of this project was 10 months ago - #1269. I think it's time to do another one. |
I tried DATABASE_ADAPTER=postgresql bundle exec appraisal rails_5_2 rspec spec/unit/shoulda/matchers/active_record/have_attached_matcher_spec.rb with both the version and got the same errors. And about upgrading the dependencies, I too think we should do that. |
No, I thought it worked, but now I see it didn't work. I probably ran with another version of Rails and thought it was 5.2. My bad. Thank you for pointing this out. I will keep digging. |
2025b55
to
4d11f7a
Compare
I don't know the reason yet but when running The migrattion is not being runned on the test database - when I tried locally it was adding in the postgres database. Separating the commands solves the problem. I tried to change to
In case you want to take a look at this error on the CI. So, I will continue digging to get a better understanding of why we need a production database on the CI. |
@vsppedro I can answer that question. We need a "production" database (really just a secondary database, but it keys off of |
4d11f7a
to
febdaa3
Compare
Thank you for pointing this out. I think it would be a good idea to change the names of these databases, but to be honest I can think of a better name now. I'll leave that for later, in case I find better names and, of course, if you also think that this change would bring some value to the project. |
Suggestion: instead of creating the table manually, use the command 'bundle exec rake active_storage: install: migrations'.