Davidasix/seed database#20
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive database seeding script to populate the local database with test data. The script creates sample data across multiple tables including users, businesses, reviews, subscriptions, and related entities.
- Adds seeding functionality for all major database tables with realistic test data
- Integrates seeding into the existing database workflow via npm scripts
- Provides both populated tables (users, businesses, reviews) and placeholder seeders for empty tables
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scripts/seed/seed.ts | Main orchestration script that runs all seeding modules sequentially |
| src/scripts/seed/user.ts | Seeds user table with sample user data including Stripe customer ID |
| src/scripts/seed/businesses.ts | Seeds businesses table with a sample business (UniClaw arcade) |
| src/scripts/seed/reviews.ts | Seeds reviews table with 10 sample Google reviews for the business |
| src/scripts/seed/subscription_payments.ts | Seeds subscription payments with sample billing data |
| src/scripts/seed/business_stats.ts | Seeds business statistics with review count and score |
| src/scripts/seed/events.ts | Seeds events table with sample update events |
| src/scripts/seed/api_keys.ts | Seeds API keys table with a sample key |
| src/scripts/seed/session.ts | Placeholder seeder for session table (no data) |
| src/scripts/seed/verificationToken.ts | Placeholder seeder for verification token table (no data) |
| src/scripts/seed/authenticator.ts | Placeholder seeder for authenticator table (no data) |
| src/scripts/seed/account.ts | Placeholder seeder for account table (no data) |
| package.json | Adds db:seed script and integrates seeding into db:fresh workflow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a script which will seed the local database with some basic data to test with.