chore(notifications): adds db init script#1359
Conversation
WalkthroughA new initialization script was added to ensure required PostgreSQL databases exist before running migrations. The migration execution flow in the npm scripts was updated to invoke this script prior to applying migrations. The logging library Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm warn config production Use ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
apps/notifications/package.json(2 hunks)apps/notifications/script/init-db.js(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: validate-notifications
🔇 Additional comments (3)
apps/notifications/package.json (2)
13-13: LGTM! Good integration of database initialization.The updated migration script properly ensures databases exist before running migrations. This prevents migration failures due to missing databases.
61-61: LGTM! Dependency addition supports the new init script.The pino logging library is appropriately added to support structured logging in the database initialization script.
apps/notifications/script/init-db.js (1)
1-16: LGTM! Well-structured imports and environment validation.The script properly loads environment variables, validates them with zod schema, and sets up structured logging. The environment schema correctly identifies all required PostgreSQL connection strings.
Summary by CodeRabbit