Red Gate forums :: View topic - Get Latest showing dropped objects
Return to www.red-gate.com RSS Feed Available

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

Get Latest showing dropped objects

Search in SQL Source Control 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
amumaugh



Joined: 30 Jun 2011
Posts: 13

PostPosted: Thu Jun 30, 2011 6:47 pm    Post subject: Get Latest showing dropped objects Reply with quote

I have a database fully committed to source control but when I switch to the "Get Latest" tab, it shows me objects that have been dropped. They are obviously not supposed to be there as I have just committed all changes from the exact same db.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1120
Location: My desk.

PostPosted: Tue Jul 05, 2011 1:05 pm    Post subject: Reply with quote

Thanks for your post. Could you clarify exactly what's happening here? As I understand it you:

- linked a database to source control.
- committed all objects
- went to Get Latest, and saw drops listed.


Are the drops for the same objects you just committed? What sort of time was there between when you committed, and when you went to Get Latest? Are other users also linked to the same source control location, and if so, do they have their own local databases (Dedicated) or do you all work on the same database (Shared)? Does the problem clear itself if you unlink + relink the database?
Back to top
View user's profile Send private message
amumaugh



Joined: 30 Jun 2011
Posts: 13

PostPosted: Tue Jul 05, 2011 1:42 pm    Post subject: Reply with quote

This database has been under source control for several months. There have been many incremental changes committed over this period. I am the only developer. I recently got a new laptop and restored a version of the db to it. I wanted to make sure everything was in sync with what was on our central development server so I committed any changes that weren't already committed, switched to my local machine, linked my restored db to source control and went to get latest. There are objects showing up that have been dropped for some time now.

To answer your questions more directly:
The objects are not the same objects just committed. Since these weren't the objects just committed, I would say anywhere from 1 week to several months between when the drops were committed and when I tried to get latest. There are no other developers linked to the source control location, although I have 2 different machines that I develop on linked to the same place. Unlink and relink does not resolve the issue.

It's basically like a/some commit(s) for dropped objects did not take in source control.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1120
Location: My desk.

PostPosted: Tue Jul 05, 2011 1:52 pm    Post subject: Reply with quote

Thanks for your reply.

Drops on the Get Latest tab will be where you have the object in your local database, but not in the source control repo. So if this is showing up objects that have been dropped over a period of a couple of months, it sounds like the local DB still has them in.

Normally when you want to link a "fresh" database to source control, you can skip the restore, and instead create a new blank DB then just do a Get Latest.
Back to top
View user's profile Send private message
amumaugh



Joined: 30 Jun 2011
Posts: 13

PostPosted: Tue Jul 05, 2011 2:05 pm    Post subject: Reply with quote

The dropped objects are listed as Adds since the objects were actually dropped in the db but the repo thinks they're still there.

A backup is used because of the complexity of our structure and data. A close to complete data set is needed for testing so a backup is easier than a fresh db and ETL. Either way, the comparison would still create those objects that should no longer actually be in source control because they were dropped and supposedly committed.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1120
Location: My desk.

PostPosted: Tue Jul 05, 2011 2:09 pm    Post subject: Reply with quote

Ah, sorry - when you said it was showing as drops I thought you meant the Get Latest tab wanted to drop them from your local DB.

If they are listed as Adds, then yes, it does sound like previous commits didn't get rid of them for some reason. Seems a little odd, if there was a problem deleting the file I would have expected an error to be thrown.

One workaround, depending on the number of objects, would be to delete the files manually from your Repo (using Tortoise for example, if you're working with SVN) and refreshing.

Failing that, if you're happy your local DB is up-to-date you could remove the folder completely from your repo, recreate it, then perform an "initial" commit again.
Back to top
View user's profile Send private message
amumaugh



Joined: 30 Jun 2011
Posts: 13

PostPosted: Tue Jul 05, 2011 2:21 pm    Post subject: Reply with quote

I wasn't sure if I could just remove the .sql files and everything still be ok. When I 1st set up SQL Source Control, it seemed very particular about setting up it's own structure so I figured any manual intervention would muck things up.

I don't want to start over in the repo because then I lose all of my history.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1120
Location: My desk.

PostPosted: Tue Jul 05, 2011 2:36 pm    Post subject: Reply with quote

Fair enough - you should be ok to delete the relevant .sql files - I'd then suggest unlinking and relinking to ensure your temp copies are up to date.
Back to top
View user's profile Send private message
amumaugh



Joined: 30 Jun 2011
Posts: 13

PostPosted: Tue Jul 05, 2011 4:24 pm    Post subject: Reply with quote

I got latest on a fresh db, dropped just those objects that shouldn't have been there, then committed just those drops. Still not sure why it happened in the 1st place but that seemed to work. Thanks for your workaround anyway.
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1120
Location: My desk.

PostPosted: Tue Jul 05, 2011 4:25 pm    Post subject: Reply with quote

Glad to hear you're up and running!
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