How can we improve SQL Source Control?

Link databses using solution or project file

We have a lot of databases. It's very time consuming to link all databases one at a time for every developer. It should be possible to make use of a solution file to link a solution with all the databases, rather then mapping one by one.

22 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Thomas FolgerøThomas Folgerø shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    4 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • TMTM commented  ·   ·  Flag as inappropriate

        The linkages should be stored in a DB configuration table in a RedGateSourceSafeConfigDb. That way, you can have fields to determine AutoLink, path, etc on a case by case basis.

      • Marty U.Marty U. commented  ·   ·  Flag as inappropriate

        From our perspective our teams work out of specific branches of code based on which release version they are working on at the time. If they need to switch branches they must re-link all of their local databases to the new branch. It would be ideal if (similar to VS DB Solutions) if I could automatically link all databases to the same branch if one changes. The goal is to make sure that you are not making changes in DB 1 on Branch A but making changes to DB 2 on Branch B.

      • Thomas FolgerøThomas Folgerø commented  ·   ·  Flag as inappropriate

        Sounds good, but it would still mean every developer will have to link every database one by one. It should be possible to have a solution file which doesn't reference production in any way, or am I missing something here?

      • David AtkinsonAdminDavid Atkinson (Admin, Red Gate) commented  ·   ·  Flag as inappropriate

        We will be storing the repository path as an extended property in the database. Once we have this, it should be fairly straightforward for us to at the very least default the fields when the user chooses to link. Would that be enough? We're not sure that auto-linking is the right thing to do as you might end up with staging and production databases linked, which isn't good practice.

      Feedback and Knowledge Base