Skip to content

Failed to run db sync after changing project name in the config #142

Closed

Description

@wonder-sk

A situation that confuses db-sync currently:

  1. dbsync is started (from database) with project A and base schema A in the database
  2. dbsync is stopped
  3. user modifies the configuration to use a newly created project B (at version 0), but does not remove the base schema A
  4. dbsync is started again - it prints that "Modified and base schemas already exist" and then fails to download a non-existent version of a project

This is because in dbsync.py in init(), when the base schema exists and the project directory does not exist, we are downloading the project at the version that is read from the base schema's metadata - but without checking it is the same project ID

The correct behavior should be to detect that base schema has been used with a different project ID, and then throw a db sync error, with a suggestion to run db sync with --force-init (or to delete the base schema manually).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions