Skip to content

Change the SchemaVersions location to another instance #127

Open

Description

@kevchant

I've seen some discussions online about various attempts by others to move the SchemaVersions table to another location using DbUp. It would be great if this was possible with this module.

Activity

  1. nvarscar commented on Oct 26, 2021

    @nvarscar
    Collaborator

    Hello, thanks for the feature idea.
    When you say "move the SchemaVersions table to another location", do you mean move it into a different table within the same database? Or into an entirely different database/server? The first one can be resolved by renaming the table in the database and changing your configuration. I can see how it can become a command that simply renames the table inside a database.
    The second one, however, introduces some major changes to the way the framework operates, where you'd have to orchestrate switching contexts and (potentially) maintaining a separate connection to the schema versions table.

  2. kevchant commented on Oct 26, 2021

    @kevchant
    ContributorAuthor

    Hi, unfortunately I mean the second one.

    Discovered this solves an issue with Azure Synapse Analytics and I think a few people would prefer it if they could change the table to be in a separate SQL database.

  3. nvarscar commented on Oct 27, 2021

    @nvarscar
    Collaborator

    There are two major issues related to this functionality:

    1. Switching context is something only SQL Server is doing. Other supported DBMS will require a separate connection, which the DbUp framework won't be able to do without some major refactoring.
    2. If two connections are involved, this would require a two-phase commit protocol implemented. The framework would have to be flexible enough to do that after each script, which again, would require modification of core DbUp components.

    Have you seen, by any chance, a working solution that I could look at? Maybe the problem isn't as big as I'm imagining.

  4. kevchant commented on Jan 10, 2022

    @kevchant
    ContributorAuthor

    Apologies for the delay. I have not seen a working version of it. Only a couple of references online saying how it can be done in theory.

  5. iampeterdaniels commented on Aug 24, 2023

    @iampeterdaniels

    For me, it's important to keep the SchemaVersions (migration log) table in the target DB so it can follow it along if it is copied/moved somewhere. I could see some benefit to ALSO having it log to another central DB on the same or another instance, though.

  6. kevchant commented on Sep 7, 2023

    @kevchant
    ContributorAuthor

    If you want to use it with serverless SQL Pools then only option is to have be able to specify another location.

  7. iampeterdaniels commented on Sep 12, 2023

    @iampeterdaniels

    Ah. Of course. Actually working with an external table or view (ie files) in serverless SQL would be a pretty tricky endeavor indeed. Not impossible, but definitely not simple like a "regular" RW SQL table. Thanks for clarifying, Kevin.

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

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions