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

feat(seed-data): reset and add seed data in DB in dev mode✨ #72

Merged
merged 2 commits into from
Dec 1, 2024

Conversation

shivamvijaywargi
Copy link
Contributor

This pull request includes changes to add a database seeding script and its dependencies. The most important changes include adding a new script to seed the database, updating the package.json file to include the new script and dependencies, and creating a new TypeScript file for the seed script.

Database seeding:

  • src/db/scripts/seed-db.script.ts: Added a new script to reset and seed the database using drizzle-seed. This script handles resetting the database, executing the seed script, and logging the process.

package.json updates:

  • package.json: Added a new script entry "db:seed" to run the seed script in the development environment.
  • package.json: Added drizzle-seed to the list of dependencies.

@shivamvijaywargi shivamvijaywargi added this to the V1.0 milestone Dec 1, 2024
@shivamvijaywargi shivamvijaywargi self-assigned this Dec 1, 2024
@shivamvijaywargi shivamvijaywargi linked an issue Dec 1, 2024 that may be closed by this pull request
@github-actions github-actions bot added bug Something isn't working enhancement New feature or request dependencies Pull requests that update a dependency file database Database schemas, migrations, and configurations release labels Dec 1, 2024
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 suggestion.

Files not reviewed (1)
  • package.json: Language not supported
Comments skipped due to low confidence (1)

src/db/scripts/seed-db.script.ts:15

  • [nitpick] The function name 'fn.default' is unclear. Consider using a more descriptive name for the function.
currency: fn.default({

Copy link

sonarqubecloud bot commented Dec 1, 2024

@sub1120
Copy link
Contributor

sub1120 commented Dec 1, 2024

@shivamvijaywargi, if i am not wrong this seeding the data will help us to provide mock data for testing?

@shivamvijaywargi
Copy link
Contributor Author

@shivamvijaywargi, if i am not wrong this seeding the data will help us to provide mock data for testing?

Correct, as for now since this is a test I have the script to only run on development mode deleting all the previous records, after a little more testing we can use this in other places.

Also, the package drizzle-seed released like a week ago.

@shivamvijaywargi shivamvijaywargi merged commit c07c74c into main Dec 1, 2024
6 checks passed
@shivamvijaywargi shivamvijaywargi deleted the feat/add-seed-data branch December 17, 2024 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working database Database schemas, migrations, and configurations dependencies Pull requests that update a dependency file enhancement New feature or request release
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

[FEAT]: Add (Deterministic?) seed data
2 participants