Is there a way to source control an entire database, not just scripts that I choose to save to my git enabled folder? - azure-data-studio

Using Azure Data Studio, is there a way or extension that allows me to mark a database as being under source control, and upon doing so, have it automatically add my changes to source control.
Instead it seems I have to save each alter statement to the folder that is git enabled.
If there is a free extension that works under Azure Data Studio that does this, that would be great. I know there are many 3rd party commercial apps out there. Not looking for any of those.

Related

VisualSVN - disable auto checkout

Recently switched jobs and with it switched source control from TFS to SVN, which is new to me.
In TFS there was an option to disable automatic checkout of files when you started typing in them. It's enabled by default and a lot of users like this behaviour, but I prefer to know for certain what's being changed before committing. A personal thing.
VisualSVN auto-checkouts by default. Is there an similar option to turn it off? I can't seem to find out in the settings.
"Automatic checkout" term in SVN and in TFS worlds has different meanings, as far as I see.
In Subversion, checkout relates to svn checkout operation which gets a working copy from a repository. In TFS it looks like the term somehow relates to automatic locking mechanism.
If you want a file to be locked automatically when you start modifying it in Visual Studio (with VisualSVN extension installed), see the KB article "Lock-Modify-Unlock Model with VisualSVN". I also suggest reading the SVNBook chapter "Locking".
Generally speaking, you can set svn:needs-lock property on files. The property instructs client which files must be locked before editing. After applying svn:need-lock to a file the file gets read-only attribute. Before editing the file must be explicitly locked by the user. After committing the lock is released by default.
Short answer: I don;t think you can do this without becoming very unpopular.
I think you should read up on the SVN redbook's description of how SVN works, especially the versioning models
In your environment, everyone wants to be able to modify any file locally and then send their changes to the server, merging changes with colleague's changes if necessary. This approach works well if 2 people are not changing the same files all the time, which is typical of most dev shops.
The old TFS/VSS model of checkout a file to work on it is pretty obsolete today - the more 'optimistic' approach where you assume you have exclusive access is much more productive. (as usual its easier to ask forgiveness if it goes wrong than ask permission every time)
Your main problem is that you cannot mix these models - if your colleagues are using the merge model, then you have to as well. You cannot lock a file and expect them to still be able to change any file anytime.
Now, there are tricks you can use to prevent yourself from modifying files you never meant to - I'm not sure of VisualSVN but TortoiseSVN (awesome tool) can run client hooks - ie you can write a program to run on every checkout, and that program can be as simple as setting every file's read-only flag. Whether this is god enough for you is another matter.
Personally, I would get used to the idea of change whatever you like whenever. If you accidentally edit a file, you can see the change indicator (AnkhSVN turns the file icon orange for changed files), and its easy to 'svn revert' changes you didn't want to make. Also SVN lets you see diffs really easily, especially on commit - double click the files in the commit dialog. The productivity gains from being able to work without the tools getting in your way (as I found with TFS continually pinging at me as I tried to edit a file) are huge. The SVN tools are really good to let you "ask forgiveness" so you don't need to run in the crappy old TFS way now you've upgraded to something better.
The other advantage is that this applies to files that are not in a Visual Studio project, if you've ever had a project file that was edited outside VS (eg a generated WCF client stub) then you will appreciate how SVN works - never again will you do a full commit and find that TFS has conveniently decided that your changed file wasn't changed and so didn't need to be committed!

TFS and resources that is changed from outside?

Hi,
Its not unusual to include images in a solutions. The problem is that these images is often edited out site Visual Studio in another program and TFS will not pick up the changes. So how do you handle this? Do you need to checkout the image before changing it? What If I have forgot to do that? How do I update TSF with my setup of the solution?
BestRegards
There are two different types of workspaces in TFS.
Server Workspaces
Local Workspaces - New in TFS 2012
Server Workspaces
Within Server Workspaces all files under source control are marked as read only. This means that if you wish to edit these files outside of Visual Studio, the workflow would be:
Check out images
Edit images
Check in images
If you try to edit the files before checking them out, the external program will try to save the edited file, see that it is readonly and then either not let you save, or ask you if you wish to overwrite. Either way TFS does not know you have changed the file.
Local Workspaces
Within Local Workspaces, files are not marked as read only. You can edit them in any program you want. Visual Studio will see that you have changed the file automatically and mark it as a Pending Change. You can then check this file in. The workflow would be:
Edit image in any program you like
Check in to TFS
This way of working is much more akin to Subversion and I think is what you are looking for.

Is Visual Studio's .Publish.xml safe to be stored in source control?

I recently realized that my project's .Publish.xml file is being committed to source control. While it seems like the FTP password in the file is encrypted, how safe is it to be storing? Can it be reverse engineered by 3rd parties?
Our own experiences of including the publish.xml file in source control are the password is not stored in clear text but another user can make use of the file to publish to the ftp account, so presumably whatever key is used to encrypt/encode the password is availible somewhere.
The other thing that we noticed was that if you try and publish the project without having the publish.xml file checked out it causes all sorts of problems, even to the extent of causing visual studio to hang, although we haven't conducted much further research into this yet.

Disable warning that solution is not under source control?

Shamefully, we use TFS at work for a C# project. I wish we could move to svn or git, but we can't change that. All of us working on the project hate the automatic check-out "feature" of TFS, so we checked in our solution and project files as unbound from TFS.
Now, whenever we open the project, we get the following message:
The solution you have opened is under source control but not currently configured for integrated source control in Visual Studio. Would you like to bind this solution to source control now?
Is there a way to disable this message while keeping the solution unbound from the buggy and annoying integrated source control?
The message you reference has nothing to do with TFS, it has to do with integrated source control within Visual Studio. If you really want to get rid of this message, go to Tools->Options->Source Control and set your source control provider to "none."
Then, go and download the Team Foundation Power Tools and enable the shell access, and you'll be able to right click within Windows Explorer and check in from there. If you don't want to do that, you can do your check-ins from the TF.EXE command line.
But seriously, if you don't like the automatic check-out, then just turn that off. You have the option of having TFS automatically check out, prompt you for check out, or do nothing and leave the files in a read-only state until you explicitly check them out.
Another possibility could be to move to a 'git-tfs' combined solution. You would move your team to git, and sync with TFS on a regular basis. This way, only one person has to live with the TFS annoyances.
I have no experience with that, but apparently it has been tried before
If you like the svn/git model better, then I honestly wonder why you would want to turn off automatic checkout? You can configure VS to silently check out files on edit. This comes pretty close to the svn way of working, no?
Also, ensure that the TFS server is configured to allow multiple checkout on all text-based files, and you should be good to go. You can also install your own diff and merge tools (e.g. TortoiseDiff/TortoiseMerge) if you want.

Perforce integration with visual studio without project files being checked in to perforce

I am working on a large source base (approx 15K files) decomposed into about 25 projects. I want to keep the source in perforce (and am evaluating perforce to that end) but due to complications in the setup it isn't possible for me to keep the visual studio projects in source control, I know in theory the answer to this is to check the projects in, but that isn't feasible (we would end up with projects for several versions of VS checked in, and additionally several variants of each of these, instead they are generated automatically and this setup works very well).
Is there a way to get VS to checkout files for editing as it goes without adding the project to perforce, to avoid the user having to go to the perforce client and manually check out each file for editing as they go? Alternatively (and even better) is there a way to get VS to recognise that the files in a project are under source control, without having to add the project to source control also?
I know we could also take the tack of having every user check out for editing all files they might potentially want to edit ahead of time, then revert unmodified files before submitting their changes, is there a performance penalty in perforce in taking this approach?
In your case, I'd suggest not using the visual studio integration for Perforce.
You can either add Perforce commands to the Tools Menu, or try Nifty Perforce from Google:
http://code.google.com/p/niftyplugins/
One option is to use Perforce as if you were disconnected from the server and reconcile your changes later, rather than telling Perforce everything you do before you do it. (This is roughly equivalent to the workflow in CVS or Subversion.) You would synchronize your working copy, go off and develop, and then ask Perforce to figure out what you did while it wasn't watching.
Perforce has a nice document describing the process: Working Disconnected From The Perforce Server
One thing the document doesn't mention is the allwrite clientspec attribute, which marks all files in your working directory as writable instead of only the files you have checked out.
For the sake of completeness: There is a new tool for your wish called P4VS. I like it better that P4SCC which never worked for me as I wanted.

Resources