Skip to content

Enforce timestamp-prefixed migration filenames generated via drizzle.config.ts / src/db/migrate.ts #180

Description

@Jagadeeshftw

📌 Description

Drizzle migrations under the folder configured in drizzle.config.ts should follow a consistent timestamp-prefixed naming convention so ordering is unambiguous; nothing currently enforces this, so a manually-added or renamed migration file could silently break apply order.

🧩 Requirements and context

  • Add a lint/check script that verifies every migration filename in the configured migrations folder matches the expected timestamp-prefixed pattern.
  • Run the check in CI (.github/workflows/ci.yml) so a violation fails the build, not just local dev.
  • Document the naming convention near the migrations folder or in README.md.

🛠️ Suggested execution

  1. Write a small script that reads the migrations directory referenced by drizzle.config.ts and validates filenames against the pattern.
  2. Wire the script into package.json scripts and into CI.
  3. Add a test with a deliberately misnamed fixture filename asserting the check fails.

✅ Acceptance criteria

  • A correctly-named migration set passes the check.
  • An incorrectly-named migration file fails the check with a clear message.
  • The check runs in CI.

🔒 Security notes

None — this is a correctness/ordering safeguard for migrations, not a security control.

📋 Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox open-source programMaybe RewardedGrantFox: potentially rewarded contributionOfficial Campaign | FWC26GrantFox official campaign issueStellar WaveIssues in the Stellar wave programbackendBackend / API workdb

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions