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

Move from enums to check constraints #62

Closed
TangoYankee opened this issue Nov 13, 2024 · 0 comments
Closed

Move from enums to check constraints #62

TangoYankee opened this issue Nov 13, 2024 · 0 comments

Comments

@TangoYankee
Copy link
Member

Description

With drizzle orm and drizzle kit supporting check constraints, we can use them instead of enums. As we move off them in the zoning api, we can remove them from the data flow. Because constraints are tracked in pg_dumps, we will not need to explicitly add data flow code to take advantage of them; the pg_dump will automatically grab them when the api database is updated.

Note: we could choose place these checks on the source tables. This would add the data quality check to an earlier step in the data flow. However, the check is already automatically added to the step where we move data from the source to the target tables within the data flow database. This step happens only a few moments after loading the data into the source tables and would result in the same errors. TL;DR: the benefit of adding the check to an earlier step is not worth the additional maintenance burden.

Acceptance criteria

  • Remove enums from database schemas
  • Remove enums from INSERT statements
  • Remove drizzle kit from data flow
  • Remove references to enum generation from readme

Related

NYCPlanning/ae-zoning-api#384 (child tickets of this issue will depend on the child tickets of this api ticket)

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

1 participant