Police-Data-Accessibility-Project / prod-to-dev-migration

Regularly migrates production database and schema to development database
1 stars 0 forks source link

Update dev_scripts.sql #2

Closed maxachis closed 3 months ago

maxachis commented 4 months ago

Fixes

Description

Testing

Performance

Docs

josh-chamberlain commented 4 months ago

I'm a bit confused about this repo—if the point is to migrate regularly from production to dev, it seems odd that the schema and such would be defined here rather than in data-sources-app. Would this repo make sense as a directory in data-sources-app?

Sorry, I know you made this a week ago but I'm just now noticing.

maxachis commented 4 months ago

@josh-chamberlain An excellent question!

  1. I was imitating what was done with data_sources_mirror, which also performs regular database actions, and is maintained in its own separate repository.
  2. The functionality done by this is rather lightweight. Putting it in the data_sources_app repository would add more to an already quite sizeable repository,
  3. It would also mean that the droplet hosting this would be continually pulling a bunch of information not needed for the action (as one of the scripts in here, by design, pulls the latest version of the repository it's located in.
  4. Putting something designed to set up a dev environment in a production repository gets things a little confusing. Right now we've got the main repository and a forked dev version. Which do we commit to? If it's the forked version, what happens when the fork is integrated into production? This keeps the logic cleaner.

I could probably come up with more post-hoc rationalizations if given enough time, but those are the ones I have right now.

mbodeantor commented 4 months ago

I don't have strong feelings on the repo, the droplet is already maintaining the full app repo for the mirror (although this will go away with the Airtable decomission). Doesn't seem too much like clutter since these are tables used by the API, but the schema definitions are not

mbodeantor commented 4 months ago

@maxachis 1. Currently all our column names for the rest of the tables are lower case

  1. Looks like Car GPS is missing from the Police & public interactions section of the Gitbook taxonomy
  2. @josh-chamberlain Might be a good time to review the request_status options to make sure they are all useful moving forward
maxachis commented 4 months ago

@maxachis 1. Currently all our column names for the rest of the tables are lower case

@mbodeantor Acknowledged! Will address. In the future, may be able to automate with sqlfluff, a sql linter.

josh-chamberlain commented 4 months ago

@mbodeantor I think all the status options are good