Red Gate forums :: View topic - Cannot get migrations working on "Get Latest" tab
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Source Control 3
SQL Source Control 3 forum

Cannot get migrations working on "Get Latest" tab

Search in SQL Source Control 3 forum
Post new topic   Reply to topic
Jump to:  
Author Message
alexwoodhead



Joined: 19 Feb 2014
Posts: 1
Location: United Kingdom

PostPosted: Wed Feb 19, 2014 4:09 pm    Post subject: Cannot get migrations working on "Get Latest" tab Reply with quote

Hi there,

I can't get migrations working with my team. We are undergoing some major db changes that involve adding/removing keys. The database has a lot of orphaned data, and without removing it first with a migration, the key cannot be added by source control on get latest.

Steps we have taken:

    Both myself and my colleague have linked to a migrations folder in our TFS on the setup tab.

    I right clicked on one change to one table, and selected add migration script.

    I then copied in the migration script that I have written in a separate file.

    After giving the migration script a name, I then clicked proceed to commit. I see that I am committing both the migration script and the schema change I selected.

    I committed the changes in.

    I can now see that there is a migration on the migrations tab associated with the change between two revisions. The one previous, and the one that was created when I committed in.

    My colleague can also see this migration on their migrations tab.

    I checked the extended properties of my colleagues database, and I see they are definitely on a revision prior to the first revision referenced by the migration script.

    My colleague then "Gets Latest".

    Error is thrown.

    We click on "Manually edit script". I can see that migration script I wrote is not included in the sql that it intends to execute.... This is why it fails, because the foreign key can't be added.

    I noticed that there is a section at the bottom of the SQL to be executed setting extended properties (of note: one stores a location to the migrations folder).

    I ran the extended properties section of the script seperately in-case as this was the first attempt of getting a migration, it was breaking?

    No luck. The second attempt of getting latest results in the same error and the SQL script it is trying to run is no different.

Please could someone explain how we are to use this feature. We would like to use migrations to attach manual scripts against each db table we modify, rather than having to execute them manually for the next release one by one.

Any help would be hugely appreciated.

Many thanks in advance.

Alex Woodhead.
    Back to top
    View user's profile Send private message
    Display posts from previous:   
    Reply to topic All times are GMT + 1 Hour
    Page 1 of 1

     
    You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot vote in polls in this forum


    Powered by phpBB © 2001, 2005 phpBB Group