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

598 tech add support for postgresql and pgsearch #613

Closed

Conversation

Drinion
Copy link
Contributor

@Drinion Drinion commented May 12, 2022

No description provided.

@Drinion Drinion requested a review from Robin481 May 12, 2022 08:52
@Drinion
Copy link
Contributor Author

Drinion commented May 12, 2022

Hello @Robin481 We are currently a little stuck with the migration. Could you maybe have a look at the code to see, if it's going into the right direction? Thanks a lot!

Copy link
Member

@Robin481 Robin481 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya looks good so far.
I left a comment that should help guide you towards a working PostgreSQL container.
If you need more specific help let me know what you are struggling with.

@@ -6,16 +6,14 @@
# PostgreSQL. Versions 8.2 and up are supported.
#
base: &generic
adapter: <%= ENV['RAILS_DB_ADAPTER'] || 'sqlite3' %>
adapter: sqlite3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why make sqlite3 the default here.
You want the opposite.
Either make PostgreSQL the default or leave it as it was and set the environment variable RAILS_DB_ADAPTER.

@@ -1,28 +1,11 @@
version: '2'

services:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably just delete the whole mysql service, or just leave it in but don't use it.


services:
postgresql:
image: postgres
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, (I haven't checked how much works and how much doesn't).
Is this a proper image reference or do you have to be more specific?
You then have to set the proper ENV variables so that Rails knows where to find the PostgreSQL container in the database.yml file. (you set the port number here so for example so you can just give rails that port number etc.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I would start by just making sure that the PostgreSQL container works.

  • Start the postgresql container with docker and see if you have any errors starting.
  • If it starts connect via docker exec -it NAME_OF_CONTAINER bash and try to connect to the postgresql instance from there.
  • If you know that all works you can connect rails to the postgresql container and rails should then be able to create the database, migrate and see it (famous last words)
  • To be even more thorough you can then connect to the postgresql container again and connect to the newly created database and see if the tables that rails just created are there and are functioning properly (they really should be there but I think this helps understanding 😁 )

db/schema.rb Outdated
@@ -98,4 +98,14 @@
t.index ["default_ccli_user_id"], name: "index_users_on_default_ccli_user_id"
end

create_table "versions", force: :cascade do |t|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not entirely sure why you have the versions table here.
Probably a left over from working on the other branches?
As you are basing this branch on master which currently doesn't have any versions this would probably break some stuff 😂 unless I am misunderstanding something 👼

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops! yes this is a mistake 😆

@Drinion Drinion requested a review from Robin481 May 19, 2022 11:20
@mtnstar mtnstar force-pushed the 598-TECH_add_support_for_postgresql_and_pgsearch branch from 1541656 to 8c5d897 Compare June 21, 2022 06:37
@mtnstar mtnstar mentioned this pull request May 22, 2023
5 tasks
@Robin481 Robin481 removed their request for review May 22, 2023 11:00
@mtnstar mtnstar force-pushed the master branch 4 times, most recently from ecd3f3e to d610931 Compare June 21, 2023 14:08
@Vakmeth Vakmeth closed this Jun 26, 2023
@Vakmeth Vakmeth deleted the 598-TECH_add_support_for_postgresql_and_pgsearch branch June 26, 2023 08:47
@Vakmeth Vakmeth restored the 598-TECH_add_support_for_postgresql_and_pgsearch branch July 3, 2023 06:30
@Vakmeth Vakmeth linked an issue Jul 3, 2023 that may be closed by this pull request
5 tasks
@kcinay055679 kcinay055679 removed a link to an issue May 31, 2024
5 tasks
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.

4 participants