Register DB Tables

Tables for the basic register system.
This commit is contained in:
s459315 2022-07-05 13:54:10 +02:00
parent 17286a5fc4
commit f582cf6653
7 changed files with 107 additions and 0 deletions

52
RMData/RMData.refactorlog Normal file
View File

@ -0,0 +1,52 @@
<?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="f23a07df-85da-41c9-bef3-1d8b2c6005e9" ChangeDateTime="07/05/2022 11:12:32">
<Property Name="ElementName" Value="[dbo].[User].[UserId]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[User]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="AuthUserId" />
</Operation>
<Operation Name="Rename Refactor" Key="b63f445d-826e-4450-b386-3d0ed7ace982" ChangeDateTime="07/05/2022 11:16:28">
<Property Name="ElementName" Value="[dbo].[User].[EmailAdress]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[User]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="EmailAddress" />
</Operation>
<Operation Name="Rename Refactor" Key="5b27f075-6a30-4411-b1f0-64a6356b9dbc" ChangeDateTime="07/05/2022 11:28:47">
<Property Name="ElementName" Value="[dbo].[Sale].[Total]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[Sale]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="Tax" />
</Operation>
<Operation Name="Rename Refactor" Key="129c5839-00ca-49b4-9c90-4dd268e05d5e" ChangeDateTime="07/05/2022 11:31:09">
<Property Name="ElementName" Value="[dbo].[SaleDetail].[Purchuse]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[SaleDetail]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="PurchusePrice" />
</Operation>
<Operation Name="Rename Refactor" Key="691b988d-c264-4d3f-825b-badeabd67a5c" ChangeDateTime="07/05/2022 11:43:56">
<Property Name="ElementName" Value="[dbo].[User].[CreatedDate]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[User]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="CreateDate" />
</Operation>
<Operation Name="Rename Refactor" Key="a0f5fc0f-82a7-4ff3-94d0-09021f6c40dc" ChangeDateTime="07/05/2022 11:48:50">
<Property Name="ElementName" Value="[dbo].[Inventory].[Purchuse]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[Inventory]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="PurchasePrice" />
</Operation>
<Operation Name="Rename Refactor" Key="20100fc6-a3a6-4c90-9586-d02bb96c76a9" ChangeDateTime="07/05/2022 11:49:28">
<Property Name="ElementName" Value="[dbo].[SaleDetail].[PurchusePrice]" />
<Property Name="ElementType" Value="SqlSimpleColumn" />
<Property Name="ParentElementName" Value="[dbo].[SaleDetail]" />
<Property Name="ParentElementType" Value="SqlTable" />
<Property Name="NewName" Value="PurchasePrice" />
</Operation>
</Operations>

View File

@ -65,4 +65,14 @@
<ItemGroup> <ItemGroup>
<None Include="PublishLocations\RMData.publish.xml" /> <None Include="PublishLocations\RMData.publish.xml" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Build Include="dbo\Tables\User.sql" />
<Build Include="dbo\Tables\Sale.sql" />
<Build Include="dbo\Tables\SaleDetail.sql" />
<Build Include="dbo\Tables\Product.sql" />
<Build Include="dbo\Tables\Inventory.sql" />
</ItemGroup>
<ItemGroup>
<RefactorLog Include="RMData.refactorlog" />
</ItemGroup>
</Project> </Project>

View File

@ -0,0 +1,8 @@
CREATE TABLE [dbo].[Inventory]
(
[Id] INT NOT NULL PRIMARY KEY IDENTITY,
[ProductId] INT NOT NULL,
[Quantity] INT NOT NULL DEFAULT 1,
[PurchasePrice] MONEY NOT NULL,
[PurchaseDate] DATETIME2 NOT NULL DEFAULT getutcdate(),
)

View File

@ -0,0 +1,10 @@
CREATE TABLE [dbo].[Product]
(
[Id] INT NOT NULL PRIMARY KEY IDENTITY,
[ProductName] NVARCHAR(100) NOT NULL,
[Description] NVARCHAR(MAX) NOT NULL,
[RetailPrice] MONEY NOT NULL,
[CreateDate] DATETIME2 NOT NULL DEFAULT getutcdate(),
[LastModified] DATETIME2 NOT NULL DEFAULT getutcdate(),
)

View File

@ -0,0 +1,9 @@
CREATE TABLE [dbo].[Sale]
(
[Id] INT NOT NULL PRIMARY KEY IDENTITY,
[CashierId] NVARCHAR(128) NOT NULL,
[SaleDate] DATETIME2 NOT NULL,
[SubTotal] MONEY NOT NULL,
[Tax] MONEY NOT NULL,
[Total] MONEY NOT NULL
)

View File

@ -0,0 +1,10 @@
CREATE TABLE [dbo].[SaleDetail]
(
[Id] INT NOT NULL PRIMARY KEY IDENTITY,
[SaleId] INT NOT NULL,
[ProductId] INT NOT NULL,
[Quantity] INT NOT NULL DEFAULT 1,
[PurchasePrice] MONEY NOT NULL,
[Tax] MONEY NOT NULL DEFAULT 0,
)

View File

@ -0,0 +1,8 @@
CREATE TABLE [dbo].[User]
(
[Id] NVARCHAR(128) NOT NULL PRIMARY KEY,
[FirstName] NVARCHAR(50) NOT NULL,
[LastName] NVARCHAR(50) NOT NULL,
[EmailAddress] NVARCHAR(256) NOT NULL,
[CreateDate] DATETIME2 NOT NULL DEFAULT getutcdate()
)