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

This enhancement automatically updates the Dockerfile to the desired db. #49311

Merged
merged 1 commit into from Sep 20, 2023

Conversation

paulreece
Copy link
Contributor

@paulreece paulreece commented Sep 18, 2023

This enhancement automatically updates the Dockerfile to the desired db when using db:system:change.

It is currently implemented to update and change the following:

  • sqlite3
  • mysql
  • postgresql
  • trilogy

Please Advise:

I could only find oracle install information using yum.

I could not find reliable Dockerfile information on the following:

  • sqlserver
  • jdbc
  • jdbcmysql
  • jdbcpostgresql
  • jdbdsqlite3

If one of the maintainers can tell me the desired config for the DB's that are not currently implemented I will add them. However if they are not seen as necessary at this point I will push up a commit removing the commented out lines containing them.

Motivation / Background

Fixes 49304.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@rails-bot rails-bot bot added the railties label Sep 18, 2023
@paulreece paulreece changed the title This enhancement automatically updates the Dockerfile to the desired db… This enhancement automatically updates the Dockerfile to the desired db. Sep 18, 2023
@eileencodes
Copy link
Member

Trilogy is just a different client/adapter for mysql, so it should use the same commands as mysql2.

@paulreece
Copy link
Contributor Author

Trilogy is just a different client/adapter for mysql, so it should use the same commands as mysql2.

Just added this in! Thank you

@paulreece
Copy link
Contributor Author

paulreece commented Sep 19, 2023

I added the default Dockerfile that's created for a new app in the fixtures directory within the /railties/test/fixtures directory as Dockerfile.test. This is then tested against my assertions in the tmp dir.

With this I now have functioning tests.

@guilleiguaran
Copy link
Member

guilleiguaran commented Sep 19, 2023

jdbc
jdbcmysql
jdbcpostgresql
jdbdsqlite3

I would expect someone using those adapters has JRuby and proper dependencies already so we don't need to do anything else for those cases.

@paulreece
Copy link
Contributor Author

jdbc
jdbcmysql
jdbcpostgresql
jdbdsqlite3

I would expect someone using those adapters has JRuby and proper dependencies already so we don't need to do anything else for those cases.

Just removed these as well as oracle. Let me know if it needs any other adjustments.

@guilleiguaran guilleiguaran merged commit 3c7a8d7 into rails:main Sep 20, 2023
4 checks passed
@dhh
Copy link
Member

dhh commented Sep 21, 2023

Great work, @paulreece! Thanks for taking this on 👏

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

Successfully merging this pull request may close these issues.

rails db:system:change should update the Dockerfile too
4 participants