fix: improve error handling in database initialization and seeding#856
fix: improve error handling in database initialization and seeding#856nevil-mathew merged 2 commits intodevelopfrom
Conversation
WalkthroughUpdated two npm scripts in Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer/CI
participant Shell as Shell
participant DB as Database
rect rgb(230, 248, 255)
Dev->>Shell: run `npm run db:init`
Shell->>DB: sequelize-cli db:create
alt create succeeds
DB-->>Shell: created
Shell->>DB: sequelize-cli db:migrate
DB-->>Shell: migrated
else create fails
DB-->>Shell: error
Shell-->>Dev: echo "Database already exists or some issue..."
Shell->>DB: sequelize-cli db:migrate
DB-->>Shell: migrated (or error)
end
end
rect rgb(255, 243, 230)
Dev->>Shell: run `npm run db:seed:all`
Shell->>DB: sequelize-cli db:seed:all
alt seed succeeds
DB-->>Shell: seeded
Shell-->>Dev: exit 0
else seed fails
DB-->>Shell: error
Shell-->>Dev: echo "Seeded data already exists or some issue..."
Shell-->>Dev: exit non-zero
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit