Projects

Each development project should have its own OneScript project. This is where you define users and their rights. It is also where you connect OneScript to your Subversion or TFS source control, or specify the directory on a disk that holds your files. And you define scripts that are injected into the outputted SQL file during the build process. Each section has its own tab.

Edit Project Information (the Name Tab)

Enter a name for the project this is usually the same name as your TFS or Subversion project. Then define if you use branches in your source control or not. If you only want to include scripts in a release that a developer has specifically requested than leave the "Default Request Type" to the value "Include Files". But if you are always going to release all files based on a filter (all files changed since '1/12/2016 13:25'), and will only require a request if the developer want to exclude a file, then change the value to "Exclude Files". This is only the default request type, the developer can change the request to be an "Include" or "Exclude" when they edit the request.

Finally, define what the output file will be named. (Don't include a directory path here.) Use the placeholders that will be populated at build time. The list of placeholders is shown below. If your project has a space in it, it might be better to replace the defaulted %p placeholder with the project name without the space.

Members

The second tab "Members" should be prepopulated with all of the users in your OneScript Server that you are currently connected to. Change their rights for the project as you need. There must be at least 1 member (usually you) that is an administrator of the project.

Source Control

Here you will be selecting the source control connection you defined in a previous step. Once a source control is selected and click the "Connect" button you should see the folders from your source control. You need to select the parent folder from the source control folders. The parent folder is the root of where your SQL script files will be stored, or it is the parent folder of your branches if your project uses branches.

In the example above I'm selecting the parent of my branches as the Parent Folder. If my project didn't use branches I would point to the folder that contained the sub folders named "Table", "Store Procs", "Data", etc.

Folder Sort Order Rules

Once we have connected to source control we can click the button "Copy folder names from SVN" (or it will say TFS, etc.). This will allow us to see the folders in our source control and just start assigning them sort order values.

The title ("branches" in this example), is just the name of my parent folder. When I click "Apply" the folders will be added to my sort rules. If you have folders within folders, then you only need to assign a sort order to the child folder name. So a folder structure with "Functions\Aggregate Functions" could have a sort order assigned to "Functions" and one assigned to "Aggregate Functions" if you want it different than the sort order than its parent folder.

Automatically Injected Build Scripts

On this tab you define the comments or SQL you want automatically added to your release script when it is being built. This allows you to place print statement that highlight details of errors (filename, last check-in user id, etc) when your OneScript file is applied to the database or to inject SQL statements that log build details to a log tables.

OneScript will combine each of the files from source control (that match your build command filters) into one big release script file (one script.) Each project can define SQL, with placeholder, to inject while building that file. You can define SQL to be generated in 4 places. At the start or end of the generated release file and before or after each included script file. Here is where you enter the SQL.

Note the default PRINT statement for the start of every file above makes it easy to see which file caused an error when the release script is applied to a database. The output would be something like:

Project Summary and Save

The save tab will display any errors in your project definition (such as a blank name.) If there are no errors you will see a summary of your project and you will be able to save it.