Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(zkstack): shouldn't attempt to create db on migrate command #3468

Open
wants to merge 1 commit into from

Conversation

albertlai431
Copy link

What ❔

zkstack dev migrate attempts to create a database first before performing the migration. It should instead only try to perform the migration, and fail if the database does not exist.

Why ❔

Keeping the create database command may potentially drop and recreate the database - the current behaviour of cargo sqlx database create doesn't do this, but it may change in the future. Furthermore, even if the database doesn't exist, it doesn't make sense for a migrate command to perform database creation.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zkstack dev fmt and zkstack dev lint.

@albertlai431 albertlai431 changed the title fix: shouldn't attempt to create db on migrate command fix(zkstack): shouldn't attempt to create db on migrate command Jan 14, 2025
@sanekmelnikov sanekmelnikov self-requested a review January 14, 2025 17:06
@sanekmelnikov sanekmelnikov added this pull request to the merge queue Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants