Repository navigation
Script for Database - #204
NathanielObeso wants to merge 6 commits into
Conversation
TheJolman
left a comment
There was a problem hiding this comment.
Sorry for slow review and ty for the cobtrib! Can we not include the two JSON files in the repo here? The script should be able to either access them from the live site or maybe from raw.githubusercontent.com
…f.com into script Needed to fix some stuff
NathanielObeso
left a comment
There was a problem hiding this comment.
Finished the script to pull from somewhere else
|
@TheJolman Do you think the script should call the database directly or the api? Also another comment, we should have a |
API, and I agree on ur second point |
|
@GaballaGit if he hits it via tha API does it generate the UUID for him or not? I feel like it doesn't lol |
TheJolman
left a comment
There was a problem hiding this comment.
As Gaballa pointed out, this script should be populating the DB via hitting the API. This is because when we populate the production database, it would be unwieldy to run something like this while the service is live (likely deployed in a container). The API also provides a layer of validation that we should be using for something like this. You don't have to worry about auth for now and can pass dev-token for the bearer token if you encounter that. Thanks!
No it does not, we will have to generate a random UUID every time. Or we could try making a function like done here (though this is for posgresql): sqlc-dev/sqlc#1354 (comment) |
I feel this is something that can easily be added to the service layer. I'll make an issue |
Created a script that could be ran into database, along with adding the files officer.json and tiers.json.
Populates officer, position, and tier tables
closes #44