TL;DR, New database. The new env variables are under To Test and the necessary knexfile config is contained in this branch
Attempt number 2 at migrating our database!
This branch has all the updates from #80 plus the knexfile changes described here.
Explanation
I chose to go with render for my all-in-one super mega database that will contain all of my personal projects in one instance for a few reasons:
I'm well-acquainted with render at this point and I don't have to make yet another account for yet another website
Render has decent support and documentation
Render allows the creation of multiple databases within the same instance, so I don't have to have all my portfolio projects on the same database under different tables like I had initially planned, each project can still have its own database
A render web service (backend) that is hosted in the same region as a render database can connect to that database via a local private network instead of via the public internet. From what I've seen when I briefly tested this out our dashboard loads like twice as fast!
It's only $7/month, on the low end of what I've seen for comparable services
To Test
Add:DATABASE_URL=postgresql://portfolio:P2aKXzk8eDNOo054IUQOsHusHhDVumbl@dpg-cq9ajqtds78s739bfk6g-a.oregon-postgres.render.com/workplace_wellness DATABASE_URL_INTERNAL=postgresql://portfolio:P2aKXzk8eDNOo054IUQOsHusHhDVumbl@dpg-cq9ajqtds78s739bfk6g-a/workplace_wellnessto backend/.env
_INTERNAL is only needed for the deployed (production) version but idk if node is gonna have a conniption over being unable to find that variable in .env if you don't have it, so put it in there
Start up the local server (hopefully no errors) and make sure stuff that needs backend works (load up the dashboard or something)
The afore-mentioned local private network thing only works from deployed backend to deployed database, so you won't get the performance bump when querying the db from a local server backend, just fyi
Changes
Knexfile
Simplified the deconstructed "host: SQL_CREDENTIALS_HOST, user: SQL_CREDENTIALS_USER_DB, etc..." to just "connectionString: DATABASE_URL"
Got connections' ssl configs right for this new setup
TL;DR, New database. The new env variables are under To Test and the necessary knexfile config is contained in this branch
Attempt number 2 at migrating our database!
This branch has all the updates from #80 plus the knexfile changes described here.
Explanation
I chose to go with render for my all-in-one super mega database that will contain all of my personal projects in one instance for a few reasons:
To Test
DATABASE_URL=postgresql://portfolio:P2aKXzk8eDNOo054IUQOsHusHhDVumbl@dpg-cq9ajqtds78s739bfk6g-a.oregon-postgres.render.com/workplace_wellness DATABASE_URL_INTERNAL=postgresql://portfolio:P2aKXzk8eDNOo054IUQOsHusHhDVumbl@dpg-cq9ajqtds78s739bfk6g-a/workplace_wellness
to backend/.env _INTERNAL is only needed for the deployed (production) version but idk if node is gonna have a conniption over being unable to find that variable in .env if you don't have it, so put it in thereChanges
Knexfile