SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Source Control with empty Project Path

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Source Control with empty Project Path
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2108

Post Source Control with empty Project Path Reply with quote
I think there's a minor inconsistency in the way SA Repository browser handles Project Path. My project folder structures are usually several levels deep trees, where the place of SQL scrpits is the following:

    "...project_name\_source\SQL\MSSQL\"

This results in repo tree as:

    "...project_repo/trunk/_source/SQL/MSSQL/"


According to help, the repository connection should be set up as:

    Server URL: "...project_repo"
    Project Path: "trunk/_source/SQL/MSSQL"

But that would inevitably result in SA recreating the "trunk/_source/SQL/MSSQL" structure in Workspace Directory. That's something I wanted to avoid because neither the trunk folder nor the whole sub-tree is ever present explicitly in any checkout. I'd like to put the database folders into the root of the workspace (each project has its own). So I tried to trick SA and set:

    Server URL: "...project_repo/trunk/_source/SQL/MSSQL"
    Project Path: "" (empty)

That was only a half-success because the folders were there but I was unable to commit them to the repository: the corresponding buttons/menu items were disabled. Setting Project Path to "/" seemed a good idea and the buttons were enabled again. Unfortunately, to no avail, because trying to commit the changes to the repository resulted in error message:

    Failed to make path "...\Workspace\\" versioned.

Also tried:

    Server URL: "...project_repo/trunk/_source/SQL/"
    Project Path: "MSSQL" (empty)

This was a working scenario creating database folders in the "...\Workspace\MSSQL" folder with successful repository commit. Hence I came to conclusion that SA does not allow an empty Project Path and there will always be a surplus subfolder connecting the Workspace with the database folders. Could you confirm that, please?
Fri Nov 09, 2012 3:20 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
I don't completely understand what happened in your setup.

Here is what I see on one of the test machines


Repo server URL: http://SERVER_NAME_HERE/svn/SA_Repo_Test/
Project root path: trunk/db projects
Workspace : C:\sa_workspace\

Please note that project root is relative to the repo URL, this is to enable switching current project in the repository without making any other changes. In my case the complete path to the project in the repository would be http://SERVER_NAME_HERE/svn/SA_Repo_Test/trunk/db projects, but you need not enter the complete path, only need to enter the relative part

Here is what I see on the local disk

Path: C:\sa_workspace\trunk\db projects

In this location I see a bunch of folders that match database names like AdventureWorksLT2008 and similar. within these folders I see a bunch of subfolders like Views, Tables, Functions... and so on...

Does this help?
Fri Nov 09, 2012 5:54 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2108

Post Reply with quote
Yes, that's exactly what I see and at the same time that's my problem as well. Also, DB scripts are not individual projects but parts of projects and each project has its own repository. Having said that the config should be:

Repo server URL: http://SERVER_NAME_HERE/project_name_repo/
let's suppose we do not want to switch, so the project root is actually /trunk

Therefore the complete path to the scripts is http://SERVER_NAME_HERE/trunk/_source/SQL/MSSQL
so the project root in SA should be
Project root path: /trunk/_source/SQL/MSSQL

The problem with this approach is that using
Workspace : C:\project1_workspace\
for workspace will end up with

    C:\project1_workspace\trunk\_source\SQL\MSSQL\project1_db1\tables\db1_table1
    C:\project1_workspace\trunk\_source\SQL\MSSQL\project1_db1\tables\db1_table2
    ...
    C:\project1_workspace\trunk\_source\SQL\MSSQL\project1_db2\tables\db2_table1
    C:\project1_workspace\trunk\_source\SQL\MSSQL\project1_db2\functions\db2_function1
    C:\project1_workspace\trunk\_source\SQL\MSSQL\project1_db2\procedures\db2_procedure1
    ...

and so on,
meaning that the database folders (project1_db1, project1_db2, etc.) will be unnecessarily located rather 4 levels below than at the root of the workspace. Those 4 levels (trunk\_source\SQL\MSSQL) are unwanted.
This obstacle could be easily surmounted with http://SERVER_NAME_HERE/trunk/_source/SQL/MSSQL as Repo server URL and an empty Project root path. Using these settings the result after updating workspace from the databases is:

    C:\project1_workspace\project1_db1\tables\db1_table1
    C:\project1_workspace\project1_db1\tables\db1_table2
    ...
    C:\project1_workspace\project1_db2\tables\db2_table1
    C:\project1_workspace\project1_db2\functions\db2_function1
    C:\project1_workspace\project1_db2\procedures\db2_procedure1
    ...

which is what I wanted but the whole process comes to a dead end when it turns out that the outcome cannot be committed to the repository because the buttons/menu items are disabled.
Fri Nov 09, 2012 7:15 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
I think I now understand where you have the difficulty.

In your model, each database is associated with a separate project, in our model, a project can contain multiple databases, even more than that, a separate non-managed set of folders for seed scripts, data-gen scripts, and other sorts of database related files. that's why the database is pushed further down to the next level.


Last edited by SysOp on Mon Nov 12, 2012 9:44 am; edited 1 time in total
Fri Nov 09, 2012 9:08 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2108

Post Reply with quote
Er... No... Let's try again :)

We do have multiple databases in our projects. It's the repositories that are in one-to-one connection with projects. But that's not causing difficulties here.
The thing I discommend is the way SA handles levels of repository checkouts and commits. Or to be more precise, how it does not when the desired level is deep into the tree and changes are made to that level as root.

When you use an svn client to check out a project from the repository at its trunk level as URL, the folder it is checked out into (the workspace) will contain all the folders and files (the whole structure). If you go deeper in the tree by adding the path to the URL, only the corresponding level will be present in the workspace.

If it is checked out with SA at its trunk level as URL + and the so called project path, the workspace will only contain the relevant branch of the project tree and only that. But it is still unnecessary. Why would I want to have a 4 level deep structure to be in my workspace when the things I'll only ever want to touch are at level 4? I don't want all the project folders leading to the SQL scripts to be in the workspace. I only need SQL associated things there.

That's why I added the path to the SQL sources to the Repository URL. This way the checkout in workspace only contains the database folders of the project and omits the path that leads to them in the repository. And here come my difficulties. While SA is able to update the workspace from the database (the object scripts are created), it is unable to commit them to the repository. The buttons/menu items are disabled.
Sat Nov 10, 2012 4:29 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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
Design by Freestyle XL / Flowers Online.