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

Database Prod Vs Dev #1

Open
mashuDuek opened this issue Jul 21, 2021 · 1 comment
Open

Database Prod Vs Dev #1

mashuDuek opened this issue Jul 21, 2021 · 1 comment
Assignees

Comments

@mashuDuek
Copy link

In Heroku we cannot create or delete our database and thats why the schema file has them create tables only. Locally however, this will create tables top level in their pg console. I think would be valid to add instructions for pushing code that has only table creation, but their local database still needs to be created and they can do that via the psql terminal or adding a line that they comment out or remove for Heroku pushes.

Secondly, there seems to be some confusion about their ENV files. Most groups have created their ENV vars in Heroku, and also added those to their local .env files.

@Krafalski
Copy link
Contributor

Point 2 🤕 - I am open to clarifying the instructions further.

I have always seen it be a large challenge for students to understand hat they now have a local database and a database in the cloud. Additionally git does not track/update/sync their local database with the deployed one. This tends to be a point that needs to addressed multiple times, usually once the students are facing the issue directly before it clicks. If you have better ways of explaining/addressing it I am open.

Yes, to create an out-of-the-box ready to go/near 0 config template, the best I could come up with was dumping it into their local postgres db. I attempted to write a SQL function that checks if the host is localhost (success!) and then connects to their specific db (not the default one set by heroku) -fail I ran out of time.

I thought about creating separate files and running them separately depending on heroku/local but I thought that would
a) add more confusion
b) require them to have two sources of truth as far as schema/seeding

Recently, I was looking at you code for testing the back-end, and for future iterations, perhaps the correct thing to do would be to utilize pg-promise to set up the schema and seed the db. - I am open to updating for future iterations.

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