Options

Plans to add a New-DatabaseMigration cmdlet?

It would be helpful to have a powershell cmdlet that could be used to generate new simple migrations rather than clicking thru a UI.  Any plans?  

I see a related uservoice: https://redgate.uservoice.com/forums/267000-sql-change-automation/suggestions/14435526-allow-the-sync-cmdlet-or-similar-to-generate-an

and I commented on it.
Tagged:

Answers

  • Options
    What IDE are you using to make your database changes? We sort of assume that this is where most people would want to trigger the action to create a migration script. Are we wrong?
    David Atkinson
    Product Manager
    Redgate Software
  • Options
    PeterDanielsCRBPeterDanielsCRB Posts: 126 Bronze 3
    I used to use the VS plugin.  Now, mostly the SSMS plugin.  I imagine most work will still occur in the UI.  However, I would also find value in being able to automate.  For example, i could write a powershell script that adds a column, updates a sproc to use that column, gens the migration, and commits the code, triggering a CI/CD process.  Just a nice-to-have.
  • Options
    PeterDanielsCRBPeterDanielsCRB Posts: 126 Bronze 3
    Oh - and sometimes, I will use a round-trip data modeling tool (e.g. dbschema) for the schema mods.
  • Options
    What would this cmdlet look like (eg a sample invocation with switches etc)
    David Atkinson
    Product Manager
    Redgate Software
  • Options
    PeterDanielsCRBPeterDanielsCRB Posts: 126 Bronze 3
    Good question.  Maybe something like:

    $sourceDB = New-DatabaseConnection [...]
    New-DatabaseMigration -InputObject <PathToSqlProjectFile> -Source $sourceDB

    Source DB could also be the default dev DB from the sql proj file.  It would behave similar to the process that happens in SSMS when we "generate migration(s)".
Sign In or Register to comment.