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

(Newbie) Need a procedure to handle data migrations

The most common problem I am running into is adding new NOT NULL columns to tables. Before Source Control, this was simply a matter of executing a script against each DB:

1. add the column to the table
2. set initial value in exiting rows
3. alter column to not null

What's the right approach with SQL Source Control?
chrisherring
0

Comments

5 comments

  • David Atkinson
    Have you tried the latest v3 early access build? This has a feature that lets you add your own custom migration script to override default behavior. What you need to do is to add a migration script to cover the change in which the NOT NULL column was added, and to edit the default script to add the UPDATE statement.

    see:
    http://www.red-gate.com/MessageBoard/vi ... hp?t=14110

    This feature works with TFS, SVN and Vault for the time being. Which do you use?

    David Atkinson
    Product Manager
    Red Gate Software
    David Atkinson
    0
  • chrisherring
    David,

    Thanks for the information. The Data Migration feature sounds like exactly what we need. We are using git; I take it that means we cannot use the v3 build yet.

    Chris
    chrisherring
    0
  • David Atkinson
    That's right, there isn't GIT support yet. Can I ask you to raise a feature request here so we can size the community interest?

    http://redgate.uservoice.com/forums/390 ... ce-control

    Although there's one for Mercurial, there isn't a migrations feature request for GIT support, so you'll need to create a new one.

    Thanks,

    David
    David Atkinson
    0
  • chrisherring
    Feature request added.

    Thanks

    Chris
    chrisherring
    0
  • David Atkinson
    Feel free to try out the feature on a 'test' database using the 'just evaluating' option and provide us with feedback on the feature itself.

    Thanks.

    David
    David Atkinson
    0

Add comment

Please sign in to leave a comment.