Skip to content

Commit 24227b2

Browse files
committed
Prepare test (sample) schema
1 parent dc0aef5 commit 24227b2

File tree

11 files changed

+236
-9
lines changed

11 files changed

+236
-9
lines changed

T4SQLTemplateLibrary/Databases/SqlServer/Schema Objects/Database Level Objects/Security/Schemas/T4SQL.schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE SCHEMA [T4SQL]
1+
CREATE SCHEMA [T4SQL];
22

33
----------------------------------------------------------------------------------------------------
44
--

T4SQLTemplateLibrary/Databases/SqlServer/Schema Objects/Schemas/T4SQL/Programmability/Stored Procedures/T4SQL.CMD_PRINT_ALL_LINES.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ AS
2727
IF @tEnd < @tTextLen
2828
BEGIN
2929
SET @tEnd = CHARINDEX(@tNewLine, @inMessage, @tEnd);
30+
3031
IF @tEnd > 0
3132
BEGIN
3233
PRINT SUBSTRING(@inMessage, @tStart, @tEnd - @tStart);
3334
SET @tStart = @tEnd + @tNL;
3435
CONTINUE;
35-
END
36+
END;
3637
END;
3738

3839
PRINT SUBSTRING(@inMessage, @tStart, @tTextLen - @tStart + 1);

T4SQLTemplateLibrary/Databases/SqlServer/T4SQLDB.sqlproj

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,6 @@
317317
<SubType>NotInBuild</SubType>
318318
</None>
319319
</ItemGroup>
320-
<ItemGroup>
321-
<ArtifactReference Include="C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\100\\SQLSchemas\master.dacpac">
322-
<HintPath>C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\100\\SQLSchemas\master.dacpac</HintPath>
323-
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
324-
</ArtifactReference>
325-
</ItemGroup>
326320
<ItemGroup>
327321
<None Include="Debug.publish.xml" />
328322
<None Include="Release.publish.xml" />
@@ -333,4 +327,11 @@
333327
<ItemGroup>
334328
<PostDeploy Include="Scripts\Post-Deployment\Script.PostDeployment.sql" />
335329
</ItemGroup>
330+
<ItemGroup>
331+
<ArtifactReference Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\100\SqlSchemas\master.dacpac">
332+
<HintPath>$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\100\SqlSchemas\master.dacpac</HintPath>
333+
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
334+
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
335+
</ArtifactReference>
336+
</ItemGroup>
336337
</Project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
IF NOT EXISTS (SELECT 1 FROM T4SQL.WORKSPACE_ENTRY WHERE OBJECT_ID(WORKITEM_TABLE_NAME, N'U') = OBJECT_ID(N'test.sample_workspace') AND OBJECT_ID(PROPERTY_TABLE_NAME) = OBJECT_ID(N'test.sample_properties'))
2+
INSERT INTO T4SQL.WORKSPACE_ENTRY
3+
(
4+
WORKITEM_TABLE_NAME,
5+
PROPERTY_TABLE_NAME,
6+
AUTONOMOUS_OWNER,
7+
WORKSPACE_DESCRIPTION
8+
)
9+
VALUES
10+
(
11+
N'test.sample_workspace',
12+
N'test.sample_properties',
13+
N'test',
14+
N'Sample Workspace'
15+
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
Post-Deployment Script Template
3+
--------------------------------------------------------------------------------------
4+
This file contains SQL statements that will be appended to the build script.
5+
Use SQLCMD syntax to include a file in the post-deployment script.
6+
Example: :r .\myfile.sql
7+
Use SQLCMD syntax to reference a variable in the post-deployment script.
8+
Example: :setvar TableName MyTable
9+
SELECT * FROM [$(TableName)]
10+
--------------------------------------------------------------------------------------
11+
*/
12+
13+
:r .\RegisterSampleWorkspace.sql
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
CREATE TABLE test.sample_properties
2+
(
3+
WORKITEM_NAME NVARCHAR(32) NOT NULL,
4+
PROPERTY_NAME NVARCHAR(64) NOT NULL,
5+
STRING_VALUE NVARCHAR(4000) NOT NULL,
6+
LINK_STATE NVARCHAR(256),
7+
8+
CONSTRAINT PK_SEED_PROPERTY PRIMARY KEY (WORKITEM_NAME, PROPERTY_NAME),
9+
CONSTRAINT FK_SEED_PROPERTY_WORKITEM FOREIGN KEY (WORKITEM_NAME)
10+
REFERENCES test.sample_workspace(WORKITEM_NAME)
11+
ON UPDATE CASCADE
12+
ON DELETE CASCADE
13+
);
14+
15+
----------------------------------------------------------------------------------------------------
16+
--
17+
-- Copyright 2013 Abel Cheng
18+
-- This source code is subject to terms and conditions of the Apache License, Version 2.0.
19+
-- See http://www.apache.org/licenses/LICENSE-2.0.
20+
-- All other rights reserved.
21+
-- You must not remove this notice, or any other, from this software.
22+
--
23+
-- Original Author: Abel Cheng <[email protected]>
24+
-- Created Date: June ‎25, ‎2013, ‏‎12:23:54 AM
25+
-- Primary Host: http://t4sql.codeplex.com
26+
-- Change Log:
27+
-- Author Date Comment
28+
--
29+
--
30+
--
31+
--
32+
-- (Keep code clean)
33+
--
34+
----------------------------------------------------------------------------------------------------
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
CREATE TABLE test.sample_workspace
2+
(
3+
WORKITEM_NAME NVARCHAR(32) NOT NULL,
4+
TEMPLATE_NAME VARCHAR(128) NOT NULL,
5+
WORKITEM_DESCRIPTION NVARCHAR(256) NOT NULL,
6+
WORKITEM_USER NVARCHAR(32),
7+
MODIFIED_TIME DATETIME NOT NULL DEFAULT GETDATE(),
8+
COMPILED_TIME DATETIME,
9+
COMPILED_ERROR NVARCHAR(2000),
10+
OBJECT_CODE NVARCHAR(MAX),
11+
BUILD_ORDER INT,
12+
START_BUILD BIT NOT NULL DEFAULT 0,
13+
14+
CONSTRAINT PK_SEED_WORKITEM PRIMARY KEY (WORKITEM_NAME),
15+
CONSTRAINT FK_SEED_WORKITEM_TEMPLATE_CLASS FOREIGN KEY (TEMPLATE_NAME)
16+
REFERENCES T4SQL.TEMPLATE_CLASS(FULL_NAME)
17+
ON UPDATE CASCADE
18+
ON DELETE CASCADE
19+
);
20+
21+
----------------------------------------------------------------------------------------------------
22+
--
23+
-- Copyright 2013 Abel Cheng
24+
-- This source code is subject to terms and conditions of the Apache License, Version 2.0.
25+
-- See http://www.apache.org/licenses/LICENSE-2.0.
26+
-- All other rights reserved.
27+
-- You must not remove this notice, or any other, from this software.
28+
--
29+
-- Original Author: Abel Cheng <[email protected]>
30+
-- Created Date: ‎‎June ‎25, ‎2013, ‏‎12:15:59 AM
31+
-- Primary Host: http://t4sql.codeplex.com
32+
-- Change Log:
33+
-- Author Date Comment
34+
--
35+
--
36+
--
37+
--
38+
-- (Keep code clean)
39+
--
40+
----------------------------------------------------------------------------------------------------
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<Name>Test (SQL Server)</Name>
8+
<SchemaVersion>2.0</SchemaVersion>
9+
<ProjectVersion>4.1</ProjectVersion>
10+
<ProjectGuid>{c8e89649-607a-4a1d-94bb-f1b0235dcc67}</ProjectGuid>
11+
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql100DatabaseSchemaProvider</DSP>
12+
<OutputType>Database</OutputType>
13+
<RootPath>
14+
</RootPath>
15+
<RootNamespace>Test</RootNamespace>
16+
<AssemblyName>Test</AssemblyName>
17+
<ModelCollation>1033, CI</ModelCollation>
18+
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
19+
<DeployToDatabase>True</DeployToDatabase>
20+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
21+
<TargetLanguage>CS</TargetLanguage>
22+
<AppDesignerFolder>Properties</AppDesignerFolder>
23+
<SqlServerVerification>False</SqlServerVerification>
24+
<IncludeCompositeObjects>True</IncludeCompositeObjects>
25+
<TargetDatabaseSet>True</TargetDatabaseSet>
26+
<SccProjectName>SAK</SccProjectName>
27+
<SccProvider>SAK</SccProvider>
28+
<SccAuxPath>SAK</SccAuxPath>
29+
<SccLocalPath>SAK</SccLocalPath>
30+
<TargetDatabase>Test</TargetDatabase>
31+
<DefaultSchema>test</DefaultSchema>
32+
<IncludeSchemaNameInFileName>True</IncludeSchemaNameInFileName>
33+
<GenerateCreateScript>True</GenerateCreateScript>
34+
</PropertyGroup>
35+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
36+
<OutputPath>bin\Release\</OutputPath>
37+
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
38+
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39+
<DebugType>pdbonly</DebugType>
40+
<Optimize>true</Optimize>
41+
<DefineDebug>false</DefineDebug>
42+
<DefineTrace>true</DefineTrace>
43+
<ErrorReport>prompt</ErrorReport>
44+
<WarningLevel>4</WarningLevel>
45+
</PropertyGroup>
46+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
47+
<OutputPath>bin\Debug\</OutputPath>
48+
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
49+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
50+
<DebugSymbols>true</DebugSymbols>
51+
<DebugType>full</DebugType>
52+
<Optimize>false</Optimize>
53+
<DefineDebug>true</DefineDebug>
54+
<DefineTrace>true</DefineTrace>
55+
<ErrorReport>prompt</ErrorReport>
56+
<WarningLevel>4</WarningLevel>
57+
<SqlTargetName>Test T4SQLDB</SqlTargetName>
58+
</PropertyGroup>
59+
<!-- VS10 without SP1 will not have VisualStudioVersion set, so do that here -->
60+
<PropertyGroup>
61+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
62+
<!-- Default to the v10.0 targets path if the targets file for the current VS version is not found -->
63+
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
64+
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">10.0</VisualStudioVersion>
65+
</PropertyGroup>
66+
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
67+
<ItemGroup>
68+
<Folder Include="Properties" />
69+
<Folder Include="Tables" />
70+
<Folder Include="Views" />
71+
<Folder Include="InitData" />
72+
</ItemGroup>
73+
<ItemGroup>
74+
<ProjectReference Include="..\..\SqlServer\T4SQLDB.sqlproj">
75+
<Name>T4SQLDB</Name>
76+
<Project>{7deafca2-b40a-4c8b-a6bb-8123bdf91ab4}</Project>
77+
<Private>False</Private>
78+
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
79+
</ProjectReference>
80+
</ItemGroup>
81+
<ItemGroup>
82+
<Build Include="test.schema.sql" />
83+
<Build Include="Tables\test.sample_properties.sql" />
84+
<Build Include="Tables\test.sample_workspace.sql" />
85+
</ItemGroup>
86+
<ItemGroup>
87+
<ArtifactReference Include="$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\100\SqlSchemas\master.dacpac">
88+
<HintPath>$(DacPacRootPath)\Extensions\Microsoft\SQLDB\Extensions\SqlServer\100\SqlSchemas\master.dacpac</HintPath>
89+
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
90+
<DatabaseVariableLiteralValue>master</DatabaseVariableLiteralValue>
91+
</ArtifactReference>
92+
</ItemGroup>
93+
<ItemGroup>
94+
<PostDeploy Include="InitData\Script.PostDeployment.sql" />
95+
</ItemGroup>
96+
<ItemGroup>
97+
<None Include="InitData\RegisterSampleWorkspace.sql" />
98+
</ItemGroup>
99+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
""
2+
{
3+
"FILE_VERSION" = "9237"
4+
"ENLISTMENT_CHOICE" = "NEVER"
5+
"PROJECT_FILE_RELATIVE_PATH" = ""
6+
"NUMBER_OF_EXCLUDED_FILES" = "0"
7+
"ORIGINAL_PROJECT_FILE_PATH" = ""
8+
"NUMBER_OF_NESTED_PROJECTS" = "0"
9+
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE SCHEMA [test];

0 commit comments

Comments
 (0)