Start of Datenbank

This commit is contained in:
Simon Lübeß
2023-10-10 16:21:00 +02:00
parent b9054b485a
commit d0d9cb8bb3
17 changed files with 345 additions and 9 deletions

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Operations Version="1.0" xmlns="http://schemas.microsoft.com/sqlserver/dac/Serialization/2012/02">
<Operation Name="Rename Refactor" Key="c957123b-8f1b-4753-96eb-c2ea2811027a" ChangeDateTime="10/10/2023 12:47:37">
<Property Name="ElementName" Value="[dbo].[BildInfo].[Prompt]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[BildInfo]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="BildPrompt" />
</Operation>
<Operation Name="Rename Refactor" Key="9e69babc-e66c-496f-960a-0c9ad936d763" ChangeDateTime="10/10/2023 12:47:42">
<Property Name="ElementName" Value="[dbo].[BildInfo].[Beschreibung]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[BildInfo]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="BildBeschreibung" />
</Operation>
<Operation Name="Rename Refactor" Key="1dc11132-1619-4a0d-b261-0d56392a3d51" ChangeDateTime="10/10/2023 13:39:00">
<Property Name="ElementName" Value="[dbo].[BildInfo].[Index]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[BildInfo]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="GroupIndex" />
</Operation>
</Operations>

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Name>KiKunstDatenbank</Name>
<SchemaVersion>2.0</SchemaVersion>
<ProjectVersion>4.1</ProjectVersion>
<ProjectGuid>{a19cd19a-fe5b-4d4e-896b-dcc43b45f734}</ProjectGuid>
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql150DatabaseSchemaProvider</DSP>
<OutputType>Database</OutputType>
<RootPath>
</RootPath>
<RootNamespace>KiKunstDatenbank</RootNamespace>
<AssemblyName>KiKunstDatenbank</AssemblyName>
<ModelCollation>1033, CI</ModelCollation>
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
<DeployToDatabase>True</DeployToDatabase>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetLanguage>CS</TargetLanguage>
<AppDesignerFolder>Properties</AppDesignerFolder>
<SqlServerVerification>False</SqlServerVerification>
<IncludeCompositeObjects>True</IncludeCompositeObjects>
<TargetDatabaseSet>True</TargetDatabaseSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
</PropertyGroup>
<Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<ItemGroup>
<Folder Include="Properties" />
<Folder Include="dpo" />
<Folder Include="dpo\Tables" />
<Folder Include="dpo\StoredProcedures" />
</ItemGroup>
<ItemGroup>
<Build Include="dpo\Tables\BildInfo.sql" />
<Build Include="dpo\StoredProcedures\spBildInfo_Insert.sql" />
</ItemGroup>
<ItemGroup>
<RefactorLog Include="KiKunstDatenbank.refactorlog" />
</ItemGroup>
<ItemGroup>
<PostDeploy Include="Script.PostDeployment.sql" />
</ItemGroup>
<ItemGroup>
<None Include="KiKunstDatenbank.publish.xml" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,19 @@
/*
Vorlage für ein Skript nach der Bereitstellung
--------------------------------------------------------------------------------------
Diese Datei enthält SQL-Anweisungen, die an das Buildskript angefügt werden.
Schließen Sie mit der SQLCMD-Syntax eine Datei in das Skript nach der Bereitstellung ein.
Beispiel: :r .\myfile.sql
Verwenden Sie die SQLCMD-Syntax, um auf eine Variable im Skript nach der Bereitstellung zu verweisen.
Beispiel: :setvar TableName MyTable
SELECT * FROM [$(TableName)]
--------------------------------------------------------------------------------------
*/
--IF NOT EXISTS (SELECT 1 FROM [dbo].[User])
--BEGIN
-- INSERT INTO [dbo].[User] (FirstName, LastName)
-- VALUES ('Simon', 'Lübeß'),
-- ('Peter', 'Enis'),
-- ('John', 'Smith'),
-- ('Mary', 'Jones')
--END

View File

@ -0,0 +1,22 @@
CREATE PROCEDURE [dbo].[spBildInfo_Insert]
@Id INT,
@BildPrompt NVARCHAR(MAX) ,
@Wunsch NVARCHAR(1024) ,
@BildBeschreibung NVARCHAR(MAX) ,
@Datum DATETIME2 ,
@Dateiname NCHAR(256) ,
@GPTModel NCHAR(32) ,
@ImageModel NCHAR(32) ,
@GroupIndex INT
AS
BEGIN
INSERT INTO [dbo].[BildInfo] (BildPrompt, Wunsch, BildBeschreibung, Datum, Dateiname, GPTModel, ImageModel, GroupIndex)
VALUES (@BildPrompt,
@Wunsch,
@BildBeschreibung,
@Datum,
@Dateiname,
@GPTModel,
@ImageModel,
@GroupIndex);
END

View File

@ -0,0 +1,22 @@
CREATE TABLE [dbo].[BildInfo]
(
[Id] INT NOT NULL PRIMARY KEY IDENTITY,
[BildPrompt] NVARCHAR(MAX) NOT NULL,
[Wunsch] NVARCHAR(1024) NOT NULL,
[BildBeschreibung] NVARCHAR(MAX) NOT NULL,
[Datum] DATETIME2 NOT NULL,
[Dateiname] NCHAR(256) NOT NULL,
[GPTModel] NCHAR(32) NOT NULL,
[ImageModel] NCHAR(32) NOT NULL,
[GroupIndex] INT NOT NULL
)
GO
EXEC sp_addextendedproperty @name = N'MS_Description',
@value = N'Index der Gruppe, in der dieses Bild generiert wurde und so.',
@level0type = N'SCHEMA',
@level0name = N'dbo',
@level1type = N'TABLE',
@level1name = N'BildInfo',
@level2type = N'COLUMN',
@level2name = 'GroupIndex'