You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A seed function could be activated automatically for pull requests, or on a developer's machine.
Seed functions lower the need for developers to use production environments, as the usefulness of data in production is the same as the dummy data - but the risk is much lower.
Other thoughts:
The amount of data shouldn't be high, but it definitely shouldn't be low.
It would be good if the data is relevant, i.e. not static. For example, events in the past are nice, but if they're all in the past, then the data is mostly irrelevant. Some of the data should be active the moment the seed is given.
For consistency, each table needs to be populated with something. It's not super important that the data activates every function of the table, but it would be nice to maintain that over time. A comment about this should be included wherever the feature is placed.
Introspection of the database should be provided, checking that each and every table in the schema is touched in the seed function. If not, it should log a warning. This way, developers using the seed function are given some notice if new tables are added - but not given a proper seed function.
Concerns:
A seed function could wipe a production database. Some kind of check should be made to ensure a production database is not wiped accidentally. I am not sure how this could be done, though. Simply checking the environment == "production" is not valid as it would be true for Vercel's branch deployments.
It would be good for this to run for pull requests and/or development branches, but spinning up databases for every branch is unfeasible. If the seed function is intended to run regularly during the development cycle on a shared development database, then it should run only for a development branch as part of the push workflow.
The text was updated successfully, but these errors were encountered:
To improve workflows for new developers & testing environments, a database seed would be a good feature.
Other thoughts:
Concerns:
== "production"
is not valid as it would be true for Vercel's branch deployments.development
branch as part of thepush
workflow.The text was updated successfully, but these errors were encountered: