Skip to content

Commit 55fcaea

Browse files
authored
V1.1.0 (#7)
* DAC Version eingetragen * Versionstabelle erstellt * Prozedur SEL_VersionHistory_Latest ergänzt * Update PD.sql * Update Users_BlockDirect.sql * Update Errors.sql + Schema Name bei den Fehlermeldungen ergänzt. + Eindeutiger lokaler Tabellenname * SQL-Namen an Build ergänzt * Update build.yml
1 parent d4bd774 commit 55fcaea

File tree

10 files changed

+95
-12
lines changed

10 files changed

+95
-12
lines changed

.github/workflows/build.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
msbuild-architecture: x64
2525

26-
- name: Paket erzeugen
26+
- name: Paket erzeugen SQL2022
2727
run: msbuild -property:Configuration=Release
2828
working-directory: ${{ github.workspace }}\Latest
2929

@@ -35,4 +35,32 @@ jobs:
3535
run: gh release upload ${{ github.ref_name }} *.dacpac
3636
env:
3737
GH_TOKEN: ${{ github.token }}
38-
working-directory: ${{ github.workspace }}\Latest\bin\Release
38+
working-directory: ${{ github.workspace }}\Latest\bin\Release
39+
40+
- name: Paket erzeugen SQL2019
41+
run: msbuild -property:Configuration=Release
42+
working-directory: ${{ github.workspace }}\SQL2019
43+
44+
- name: Ausgabe anzeigen
45+
run: ls
46+
working-directory: ${{ github.workspace }}\SQL2019\bin\Release
47+
48+
- name: DACPAC im Release ablegen
49+
run: gh release upload ${{ github.ref_name }} *.dacpac
50+
env:
51+
GH_TOKEN: ${{ github.token }}
52+
working-directory: ${{ github.workspace }}\SQL2019\bin\Release
53+
54+
- name: Paket erzeugen SQL2017
55+
run: msbuild -property:Configuration=Release
56+
working-directory: ${{ github.workspace }}\SQL2017
57+
58+
- name: Ausgabe anzeigen
59+
run: ls
60+
working-directory: ${{ github.workspace }}\SQL2017\bin\Release
61+
62+
- name: DACPAC im Release ablegen
63+
run: gh release upload ${{ github.ref_name }} *.dacpac
64+
env:
65+
GH_TOKEN: ${{ github.token }}
66+
working-directory: ${{ github.workspace }}\SQL2017\bin\Release

Latest/Basedata/Errors.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
-- Fill Errors-Table
2-
DECLARE @tmp AS TABLE (
2+
DECLARE @tmpErrors AS TABLE (
33
Code INT NOT NULL
44
,ObjType CHAR(3) NOT NULL
55
,ObjName VARCHAR(255) NOT NULL
66
,Message_en VARCHAR(MAX) NOT NULL
77
,Message_de VARCHAR(MAX) NULL
88
);
99

10-
INSERT INTO @tmp ([Code], [ObjType], [ObjName], [Message_en], [Message_de])
11-
VALUES (50000, 'spr', 'INS_User', 'The minimum required length of the encryption phrase is 8 characters!', 'Die erforderliche Mindestlänge für die Passwortverschlüsselung beträgt 8 Zeichen!')
12-
, (50001, 'spr', 'INS_User', 'The selected Login Name already exists.', 'Der ausgewählte Benutzername existiert bereits.')
13-
, (50002, 'spr', 'UPD_User_details', 'The selected Login Name already exists.', 'Der ausgewählte Benutzername existiert bereits.')
14-
, (50003, 'spr', 'UPD_User_Pwd', 'The minimum required length of the encryption phrase is 8 characters!', 'Die erforderliche Mindestlänge für die Passwortverschlüsselung beträgt 8 Zeichen!')
15-
, (50004, 'trg', 'Users_BlockDirect', 'No direct modifications allowed on the users-table!', 'Es sind keine direkten Bearbeitungen in der Users-Tabelle erlaubt!');
10+
INSERT INTO @tmpErrors ([Code], [ObjType], [ObjName], [Message_en], [Message_de])
11+
VALUES (50000, 'spr', 'dbo.INS_User', 'The minimum required length of the encryption phrase is 8 characters!', 'Die erforderliche Mindestlänge für die Passwortverschlüsselung beträgt 8 Zeichen!')
12+
, (50001, 'spr', 'dbo.INS_User', 'The selected Login Name already exists.', 'Der ausgewählte Benutzername existiert bereits.')
13+
, (50002, 'spr', 'dbo.UPD_User_details', 'The selected Login Name already exists.', 'Der ausgewählte Benutzername existiert bereits.')
14+
, (50003, 'spr', 'dbo.UPD_User_Pwd', 'The minimum required length of the encryption phrase is 8 characters!', 'Die erforderliche Mindestlänge für die Passwortverschlüsselung beträgt 8 Zeichen!')
15+
, (50004, 'trg', 'dbo.Users_BlockDirect', 'No direct modifications allowed on the users-table!', 'Es sind keine direkten Bearbeitungen in der Users-Tabelle erlaubt!');
1616

17-
MERGE [dbo].[Errors] AS t USING @tmp AS s
17+
MERGE [dbo].[Errors] AS t USING @tmpErrors AS s
1818
ON [t].[Code] = [s].[Code]
1919
WHEN MATCHED
2020
THEN UPDATE

Latest/PD.sql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ Vorlage für ein Skript nach der Bereitstellung
1010
--------------------------------------------------------------------------------------
1111
*/
1212

13+
SET XACT_ABORT ON;
14+
1315
-- Fill Base-Tables
1416

1517
-- Errors-Table
16-
:R ..\Latest\Basedata\Errors.sql
18+
:R ..\Latest\Basedata\Errors.sql
19+
20+
-- Set current version number into VersionHistory-table
21+
INSERT INTO [dbo].[VersionHistory] ([MajorVers], [MinorVers], [PatchVers])
22+
VALUES (1, 1, 0);

Latest/Security/MainUser.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ GO
2323
GRANT EXECUTE ON [dbo].[SEL_Users] TO [Demo];
2424
GO
2525

26+
GRANT EXECUTE ON [dbo].[SEL_VersionHistory_Latest] TO [Demo];
27+
GO
28+
2629
GRANT EXECUTE ON [dbo].[UPD_User_Details] TO [Demo];
2730
GO
2831

Latest/WebControl-SQL-Demo.sqlproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<IncludeCompositeObjects>True</IncludeCompositeObjects>
2424
<TargetDatabaseSet>True</TargetDatabaseSet>
2525
<DelayedDurability>DISABLED</DelayedDurability>
26+
<DacVersion>1.1.0.0</DacVersion>
2627
</PropertyGroup>
2728
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2829
<OutputPath>bin\Release\</OutputPath>
@@ -34,6 +35,7 @@
3435
<DefineTrace>true</DefineTrace>
3536
<ErrorReport>prompt</ErrorReport>
3637
<WarningLevel>4</WarningLevel>
38+
<SqlTargetName>WebControl-SQL-Demo-2022</SqlTargetName>
3739
</PropertyGroup>
3840
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
3941
<OutputPath>bin\Debug\</OutputPath>
@@ -46,6 +48,7 @@
4648
<DefineTrace>true</DefineTrace>
4749
<ErrorReport>prompt</ErrorReport>
4850
<WarningLevel>4</WarningLevel>
51+
<SqlTargetName>WebControl-SQL-Demo-2022</SqlTargetName>
4952
</PropertyGroup>
5053
<PropertyGroup>
5154
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
@@ -78,6 +81,8 @@
7881
<Build Include="dbo\Stored Procedures\SEL_User_Details.sql" />
7982
<Build Include="dbo\Triggers\Users_BlockDirect.sql" />
8083
<Build Include="dbo\Stored Procedures\SEL_User_Validate.sql" />
84+
<Build Include="dbo\Tables\VersionHistory.sql" />
85+
<Build Include="dbo\Stored Procedures\SEL_VersionHistory_Latest.sql" />
8186
</ItemGroup>
8287
<ItemGroup>
8388
<None Include="Basedata\Errors.sql" />
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- Ruft die zuletzt installierte DACPAC-Version ab.
2+
3+
CREATE PROCEDURE [dbo].[SEL_VersionHistory_Latest]
4+
AS
5+
BEGIN
6+
SET NOCOUNT ON;
7+
8+
SELECT TOP (1)
9+
[vh].[MajorVers]
10+
,[vh].[MinorVers]
11+
,[vh].[PatchVers]
12+
,[vh].[InstallDate]
13+
14+
FROM [dbo].[VersionHistory] [vh]
15+
ORDER BY [vh].[InstallDate] DESC;
16+
17+
END;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CREATE TABLE [dbo].[VersionHistory] (
2+
[MajorVers] TINYINT NOT NULL
3+
,[MinorVers] TINYINT NOT NULL
4+
,[PatchVers] TINYINT NOT NULL
5+
,[InstallDate] DATETIME2(3) CONSTRAINT [DF_VersionHistory_InstallDate] DEFAULT GETDATE() NOT NULL
6+
) ON [DEFAULT];

Latest/dbo/Triggers/Users_BlockDirect.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- This trigger blocks all direct transactions to the users-table.
22
-- It is only allowed to modify the table by procedures.
33

4-
CREATE TRIGGER [Users_BlockDirect]
4+
CREATE TRIGGER [dbo].[Users_BlockDirect]
55
ON [dbo].[Users]
66
FOR DELETE, INSERT, UPDATE
77
AS

SQL2017/SQL2017.sqlproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<TargetDatabaseSet>True</TargetDatabaseSet>
2525
<DacApplicationName>WebControl-SQL-Demo</DacApplicationName>
2626
<DelayedDurability>DISABLED</DelayedDurability>
27+
<DacVersion>1.1.0.0</DacVersion>
2728
</PropertyGroup>
2829
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2930
<OutputPath>bin\Release\</OutputPath>
@@ -35,6 +36,7 @@
3536
<DefineTrace>true</DefineTrace>
3637
<ErrorReport>prompt</ErrorReport>
3738
<WarningLevel>4</WarningLevel>
39+
<SqlTargetName>WebControl-SQL-Demo-2017</SqlTargetName>
3840
</PropertyGroup>
3941
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
4042
<OutputPath>bin\Debug\</OutputPath>
@@ -47,6 +49,7 @@
4749
<DefineTrace>true</DefineTrace>
4850
<ErrorReport>prompt</ErrorReport>
4951
<WarningLevel>4</WarningLevel>
52+
<SqlTargetName>WebControl-SQL-Demo-2017</SqlTargetName>
5053
</PropertyGroup>
5154
<PropertyGroup>
5255
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
@@ -107,5 +110,11 @@
107110
<PostDeploy Include="..\Latest\PD.sql">
108111
<Link>PD.sql</Link>
109112
</PostDeploy>
113+
<Build Include="..\Latest\dbo\Tables\VersionHistory.sql">
114+
<Link>dbo\Tables\VersionHistory.sql</Link>
115+
</Build>
116+
<Build Include="..\Latest\dbo\Stored Procedures\SEL_VersionHistory_Latest.sql">
117+
<Link>dbo\Stored Procedures\SEL_VersionHistory_Latest.sql</Link>
118+
</Build>
110119
</ItemGroup>
111120
</Project>

SQL2019/SQL2019.sqlproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<TargetDatabaseSet>True</TargetDatabaseSet>
2525
<DacApplicationName>WebControl-SQL-Demo</DacApplicationName>
2626
<DelayedDurability>DISABLED</DelayedDurability>
27+
<DacVersion>1.1.0.0</DacVersion>
2728
</PropertyGroup>
2829
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2930
<OutputPath>bin\Release\</OutputPath>
@@ -35,6 +36,7 @@
3536
<DefineTrace>true</DefineTrace>
3637
<ErrorReport>prompt</ErrorReport>
3738
<WarningLevel>4</WarningLevel>
39+
<SqlTargetName>WebControl-SQL-Demo-2019</SqlTargetName>
3840
</PropertyGroup>
3941
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
4042
<OutputPath>bin\Debug\</OutputPath>
@@ -47,6 +49,7 @@
4749
<DefineTrace>true</DefineTrace>
4850
<ErrorReport>prompt</ErrorReport>
4951
<WarningLevel>4</WarningLevel>
52+
<SqlTargetName>WebControl-SQL-Demo-2019</SqlTargetName>
5053
</PropertyGroup>
5154
<PropertyGroup>
5255
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
@@ -107,5 +110,11 @@
107110
<PostDeploy Include="..\Latest\PD.sql">
108111
<Link>PD.sql</Link>
109112
</PostDeploy>
113+
<Build Include="..\Latest\dbo\Tables\VersionHistory.sql">
114+
<Link>dbo\Tables\VersionHistory.sql</Link>
115+
</Build>
116+
<Build Include="..\Latest\dbo\Stored Procedures\SEL_VersionHistory_Latest.sql">
117+
<Link>dbo\Stored Procedures\SEL_VersionHistory_Latest.sql</Link>
118+
</Build>
110119
</ItemGroup>
111120
</Project>

0 commit comments

Comments
 (0)