Skip to content

Conversation

@amirhmoradi
Copy link
Contributor

@amirhmoradi amirhmoradi commented Jan 6, 2026

What is this PR about?

This change addresses the issue of migration file conflicts when multiple contributors create migrations in parallel. The previous sequential numbering system (0001_, 0002_, etc.) caused conflicts when two PRs both added migrations.

Changes:

  • Convert all 134 existing migrations from index format (0000_) to timestamp format (YYYYMMDDHHmmss_) based on their original creation timestamps
  • Add prefix: 'timestamp' to drizzle.config.ts for future migrations
  • Add migration:new script that enforces descriptive migration names
  • Add migration:convert script for the one-time conversion
  • Add MIGRATIONS.md documentation for contributors
  • Remove orphaned migration file (0057_damp_prism.sql)

The timestamp format prevents conflicts because each migration gets a unique prefix based on when it was created (e.g., 20240627143052_add-feature.sql).

New workflow for contributors:
pnpm run migration:new add-user-preferences

This generates migrations with meaningful names and timestamp prefixes, eliminating merge conflicts and improving migration readability.

Checklist

Before submitting this PR, please make sure that:

Issues related (if applicable)

Screenshots (if applicable)

This change addresses the issue of migration file conflicts when multiple
contributors create migrations in parallel. The previous sequential numbering
system (0001_, 0002_, etc.) caused conflicts when two PRs both added migrations.

Changes:
- Convert all 134 existing migrations from index format (0000_) to timestamp
  format (YYYYMMDDHHmmss_) based on their original creation timestamps
- Add `prefix: 'timestamp'` to drizzle.config.ts for future migrations
- Add `migration:new` script that enforces descriptive migration names
- Add `migration:convert` script for the one-time conversion
- Add MIGRATIONS.md documentation for contributors
- Remove orphaned migration file (0057_damp_prism.sql)

The timestamp format prevents conflicts because each migration gets a unique
prefix based on when it was created (e.g., 20240627143052_add-feature.sql).

New workflow for contributors:
  pnpm run migration:new add-user-preferences

This generates migrations with meaningful names and timestamp prefixes,
eliminating merge conflicts and improving migration readability.
@amirhmoradi
Copy link
Contributor Author

@Siumauricio Hi, I have created this PR to allow for better management of migrations to allow PRs to be easier to merge in regards to migrations.
Please have a look and let me know if there is anything I may do to help this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants