How can we help you today? How can we help you today?

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.
PeterDanielsCRB
0

Comments

5 comments

  • David Atkinson
    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
    0
  • PeterDanielsCRB
    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.
    PeterDanielsCRB
    0
  • PeterDanielsCRB
    Oh - and sometimes, I will use a round-trip data modeling tool (e.g. dbschema) for the schema mods.
    PeterDanielsCRB
    0
  • David Atkinson
    What would this cmdlet look like (eg a sample invocation with switches etc)
    David Atkinson
    0
  • PeterDanielsCRB
    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)".
    PeterDanielsCRB
    0

Add comment

Please sign in to leave a comment.