test project created
This commit is contained in:
@@ -1,21 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.7">
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.OpenApi" Version="2.11.0" />
|
||||
<PackageReference Include="MySql.EntityFrameworkCore" Version="10.0.9" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.0.1" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,164 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Distribution.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class item_catalog : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "Factor",
|
||||
table: "UomConversions",
|
||||
type: "decimal(65,30)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(18,2)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "OneTimeAmount",
|
||||
table: "Stores",
|
||||
type: "decimal(65,30)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(18,2)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "Longitude",
|
||||
table: "Stores",
|
||||
type: "decimal(65,30)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(18,2)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "Latitude",
|
||||
table: "Stores",
|
||||
type: "decimal(65,30)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(18,2)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "CreditAmount",
|
||||
table: "Stores",
|
||||
type: "decimal(65,30)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(18,2)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "Length",
|
||||
table: "Routes",
|
||||
type: "decimal(65,30)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(18,2)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "TotalAmount",
|
||||
table: "Orders",
|
||||
type: "decimal(65,30)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(18,2)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "UnitPrice",
|
||||
table: "OrderItems",
|
||||
type: "decimal(65,30)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(18,2)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "SalePrice",
|
||||
table: "Items",
|
||||
type: "decimal(65,30)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(18,2)",
|
||||
oldNullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "Factor",
|
||||
table: "UomConversions",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(65,30)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "OneTimeAmount",
|
||||
table: "Stores",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(65,30)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "Longitude",
|
||||
table: "Stores",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(65,30)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "Latitude",
|
||||
table: "Stores",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(65,30)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "CreditAmount",
|
||||
table: "Stores",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(65,30)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "Length",
|
||||
table: "Routes",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(65,30)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "TotalAmount",
|
||||
table: "Orders",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(65,30)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "UnitPrice",
|
||||
table: "OrderItems",
|
||||
type: "decimal(18,2)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(65,30)");
|
||||
|
||||
migrationBuilder.AlterColumn<decimal>(
|
||||
name: "SalePrice",
|
||||
table: "Items",
|
||||
type: "decimal(18,2)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(decimal),
|
||||
oldType: "decimal(65,30)",
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System;
|
||||
using Distribution.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
@@ -16,9 +17,11 @@ namespace Distribution.Migrations
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "10.0.9")
|
||||
.HasAnnotation("ProductVersion", "9.0.0")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
||||
|
||||
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Distribution.Models.Brand", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -138,7 +141,7 @@ namespace Distribution.Migrations
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<decimal?>("SalePrice")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.Property<string>("Sku")
|
||||
.IsRequired()
|
||||
@@ -179,7 +182,7 @@ namespace Distribution.Migrations
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<decimal>("TotalAmount")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
@@ -209,7 +212,7 @@ namespace Distribution.Migrations
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<decimal>("UnitPrice")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.HasKey("FK_OrderId", "FK_ItemId");
|
||||
|
||||
@@ -1642,7 +1645,7 @@ namespace Distribution.Migrations
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<decimal>("Length")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.Property<string>("RouteName")
|
||||
.IsRequired()
|
||||
@@ -1686,7 +1689,7 @@ namespace Distribution.Migrations
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<decimal>("CreditAmount")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.Property<Guid>("FK_RouteId")
|
||||
.HasColumnType("char(36)");
|
||||
@@ -1695,13 +1698,13 @@ namespace Distribution.Migrations
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<decimal>("Latitude")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.Property<decimal>("Longitude")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.Property<decimal>("OneTimeAmount")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.Property<string>("OwnerName")
|
||||
.IsRequired()
|
||||
@@ -1791,7 +1794,7 @@ namespace Distribution.Migrations
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<decimal>("Factor")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
.HasColumnType("decimal(65,30)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using MySql.EntityFrameworkCore.Extensions;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@@ -28,7 +27,7 @@ var connectionString = builder.Configuration.GetConnectionString("DefaultConnect
|
||||
?? throw new InvalidOperationException("Connection string 'DefaultConnection' was not found.");
|
||||
|
||||
builder.Services.AddDbContext<AppDBContext>(options =>
|
||||
options.UseMySQL(connectionString));
|
||||
options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)));
|
||||
|
||||
builder.Services.AddScoped<IUnitOfWork, EFUnitOfWork>();
|
||||
|
||||
|
||||
@@ -1,266 +0,0 @@
|
||||
START TRANSACTION;
|
||||
ALTER TABLE `OrderItems` ADD `UnitPrice` decimal(18,2) NOT NULL DEFAULT 0.0;
|
||||
|
||||
ALTER TABLE `Items` ADD `Description` longtext NULL;
|
||||
|
||||
ALTER TABLE `Items` ADD `ExternalErpItemId` int NULL;
|
||||
|
||||
ALTER TABLE `Items` ADD `FK_BaseUomId` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
ALTER TABLE `Items` ADD `FK_BrandId` char(36) NULL;
|
||||
|
||||
ALTER TABLE `Items` ADD `FK_CategoryId` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
ALTER TABLE `Items` ADD `FK_SubCategoryId` char(36) NULL;
|
||||
|
||||
ALTER TABLE `Items` ADD `LastSyncedAt` datetime(6) NULL;
|
||||
|
||||
ALTER TABLE `Items` ADD `Name` longtext NOT NULL;
|
||||
|
||||
ALTER TABLE `Items` ADD `SalePrice` decimal(18,2) NULL;
|
||||
|
||||
ALTER TABLE `Items` ADD `Sku` longtext NOT NULL;
|
||||
|
||||
ALTER TABLE `Items` ADD `SyncSource` int NOT NULL DEFAULT 0;
|
||||
|
||||
CREATE TABLE `Brands` (
|
||||
`Id` char(36) NOT NULL,
|
||||
`Name` longtext NOT NULL,
|
||||
`ExternalErpId` int NULL,
|
||||
`CreatedAt` datetime(6) NOT NULL,
|
||||
`IsActive` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`Id`)
|
||||
);
|
||||
|
||||
CREATE TABLE `Categories` (
|
||||
`Id` char(36) NOT NULL,
|
||||
`Name` longtext NOT NULL,
|
||||
`ExternalErpId` int NULL,
|
||||
`CreatedAt` datetime(6) NOT NULL,
|
||||
`IsActive` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`Id`)
|
||||
);
|
||||
|
||||
CREATE TABLE `Uoms` (
|
||||
`Id` char(36) NOT NULL,
|
||||
`Name` longtext NOT NULL,
|
||||
`ExternalErpId` int NULL,
|
||||
`CreatedAt` datetime(6) NOT NULL,
|
||||
`IsActive` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`Id`)
|
||||
);
|
||||
|
||||
CREATE TABLE `SubCategories` (
|
||||
`Id` char(36) NOT NULL,
|
||||
`Name` longtext NOT NULL,
|
||||
`FK_CategoryId` char(36) NOT NULL,
|
||||
`ExternalErpId` int NULL,
|
||||
`CreatedAt` datetime(6) NOT NULL,
|
||||
`IsActive` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`Id`),
|
||||
CONSTRAINT `FK_SubCategories_Categories_FK_CategoryId` FOREIGN KEY (`FK_CategoryId`) REFERENCES `Categories` (`Id`) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE `UomConversions` (
|
||||
`Id` char(36) NOT NULL,
|
||||
`FK_ItemId` char(36) NOT NULL,
|
||||
`FK_FromUomId` char(36) NOT NULL,
|
||||
`FK_ToUomId` char(36) NOT NULL,
|
||||
`Factor` decimal(18,2) NOT NULL,
|
||||
PRIMARY KEY (`Id`),
|
||||
CONSTRAINT `FK_UomConversions_Items_FK_ItemId` FOREIGN KEY (`FK_ItemId`) REFERENCES `Items` (`Id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `FK_UomConversions_Uoms_FK_FromUomId` FOREIGN KEY (`FK_FromUomId`) REFERENCES `Uoms` (`Id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `FK_UomConversions_Uoms_FK_ToUomId` FOREIGN KEY (`FK_ToUomId`) REFERENCES `Uoms` (`Id`) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
INSERT INTO `Permissions` (`Id`, `Code`, `CreatedAt`, `Description`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000031', 'items.view', '2026-08-18 00:00:00.000000', 'View items, brands and UOMs', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `Permissions` (`Id`, `Code`, `CreatedAt`, `Description`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000032', 'items.create', '2026-08-18 00:00:00.000000', 'Create items, brands and UOMs', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `Permissions` (`Id`, `Code`, `CreatedAt`, `Description`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000033', 'items.update', '2026-08-18 00:00:00.000000', 'Update items, brands and UOMs', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `Permissions` (`Id`, `Code`, `CreatedAt`, `Description`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000034', 'items.delete', '2026-08-18 00:00:00.000000', 'Delete items, brands and UOMs', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `Permissions` (`Id`, `Code`, `CreatedAt`, `Description`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000035', 'categories.view', '2026-08-18 00:00:00.000000', 'View categories', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `Permissions` (`Id`, `Code`, `CreatedAt`, `Description`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000036', 'categories.create', '2026-08-18 00:00:00.000000', 'Create categories and subcategories', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `Permissions` (`Id`, `Code`, `CreatedAt`, `Description`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000037', 'categories.update', '2026-08-18 00:00:00.000000', 'Update categories and subcategories', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `Permissions` (`Id`, `Code`, `CreatedAt`, `Description`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000038', 'categories.delete', '2026-08-18 00:00:00.000000', 'Delete categories and subcategories', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000031', '10000000-0000-0000-0000-000000000001', '2026-08-18 00:00:00.000000', '7596f703-c6ab-316c-7c80-3f4e3daa174e', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000035', '10000000-0000-0000-0000-000000000001', '2026-08-18 00:00:00.000000', 'aa120c36-488e-34ba-e10a-2ac45e46e119', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000031', '10000000-0000-0000-0000-000000000002', '2026-08-18 00:00:00.000000', 'b7dee5e3-f329-95a5-75c1-d02c3e40e229', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000035', '10000000-0000-0000-0000-000000000002', '2026-08-18 00:00:00.000000', 'e5506b30-527d-08f9-6caa-8a45d3d02999', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000031', '10000000-0000-0000-0000-000000000003', '2026-08-18 00:00:00.000000', '7780d277-9597-84ff-1a1a-f63fc6b4d3cb', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000032', '10000000-0000-0000-0000-000000000003', '2026-08-18 00:00:00.000000', '8083c659-9506-0bd9-b793-3d6148ce9192', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000033', '10000000-0000-0000-0000-000000000003', '2026-08-18 00:00:00.000000', 'd49f086e-30f0-6ce8-ae96-4395d5e04472', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000035', '10000000-0000-0000-0000-000000000003', '2026-08-18 00:00:00.000000', '1e7fe1b6-5150-4b99-38ed-088d9495cfd8', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000031', '10000000-0000-0000-0000-000000000004', '2026-08-18 00:00:00.000000', 'a701da28-aa75-3c1d-abdb-4317404f8df6', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000032', '10000000-0000-0000-0000-000000000004', '2026-08-18 00:00:00.000000', '2c025310-765f-7d07-ab9a-50524c13d1d3', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000033', '10000000-0000-0000-0000-000000000004', '2026-08-18 00:00:00.000000', '7c392a13-1a57-0d85-dffa-2fb9e892abe9', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000034', '10000000-0000-0000-0000-000000000004', '2026-08-18 00:00:00.000000', '97708eed-6ce4-7710-abde-01d00c0c879b', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000035', '10000000-0000-0000-0000-000000000004', '2026-08-18 00:00:00.000000', '9afe507e-191e-bdee-0c5a-cfbcbf1efb3e', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000036', '10000000-0000-0000-0000-000000000004', '2026-08-18 00:00:00.000000', '9c278616-4289-96fb-944d-b8f1495ccb00', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000037', '10000000-0000-0000-0000-000000000004', '2026-08-18 00:00:00.000000', 'd1dcef02-d4c3-caba-372f-dab82011e9c1', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000038', '10000000-0000-0000-0000-000000000004', '2026-08-18 00:00:00.000000', '9cc36229-dfba-49b9-1d6e-8929546e894d', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000031', '10000000-0000-0000-0000-000000000005', '2026-08-18 00:00:00.000000', '69f93a29-1df1-7b20-9d5c-94c264f8c4b8', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000032', '10000000-0000-0000-0000-000000000005', '2026-08-18 00:00:00.000000', '070813f7-4053-2889-0d14-d0d5834208c2', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000033', '10000000-0000-0000-0000-000000000005', '2026-08-18 00:00:00.000000', '0efa7259-aadb-0019-4be5-38d3f8f4cd54', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000034', '10000000-0000-0000-0000-000000000005', '2026-08-18 00:00:00.000000', '9e60e7d7-8bd6-c1c7-4bf1-4de2c9dcb91c', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000035', '10000000-0000-0000-0000-000000000005', '2026-08-18 00:00:00.000000', '5df82318-bc01-1947-09ef-60508e02b257', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000036', '10000000-0000-0000-0000-000000000005', '2026-08-18 00:00:00.000000', '34f478f4-6c96-4b31-b68a-28c7942c0789', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000037', '10000000-0000-0000-0000-000000000005', '2026-08-18 00:00:00.000000', '69598e0e-b7ad-477b-c587-7abf6189162d', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000038', '10000000-0000-0000-0000-000000000005', '2026-08-18 00:00:00.000000', 'b36fb2d4-43df-44f8-ff51-de6d88644c94', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000031', '10000000-0000-0000-0000-000000000006', '2026-08-18 00:00:00.000000', 'bd209f90-6671-8ea0-eb20-aa151faec6a0', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000032', '10000000-0000-0000-0000-000000000006', '2026-08-18 00:00:00.000000', '4cc32686-8391-0214-5747-db14f53c5b6f', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000033', '10000000-0000-0000-0000-000000000006', '2026-08-18 00:00:00.000000', '26c6d86a-835d-6f0d-3730-66a46ea26b11', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000034', '10000000-0000-0000-0000-000000000006', '2026-08-18 00:00:00.000000', 'e8039d9c-a286-fb74-5abb-b5c6c67f243a', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000035', '10000000-0000-0000-0000-000000000006', '2026-08-18 00:00:00.000000', 'd9e038cb-bcff-cce1-5d34-b4e63a9ce694', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000036', '10000000-0000-0000-0000-000000000006', '2026-08-18 00:00:00.000000', '343e71f0-da6b-2489-5571-f8d7c6378ee7', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000037', '10000000-0000-0000-0000-000000000006', '2026-08-18 00:00:00.000000', 'ac894328-a935-8e6e-8427-6c0f36ac75da', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
INSERT INTO `RolePermissions` (`FK_PermissionId`, `FK_RoleId`, `CreatedAt`, `Id`, `IsActive`)
|
||||
VALUES ('20000000-0000-0000-0000-000000000038', '10000000-0000-0000-0000-000000000006', '2026-08-18 00:00:00.000000', '1d6273d4-db6a-d70e-4b5f-98cb634d668a', TRUE);
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
|
||||
CREATE INDEX `IX_Items_FK_BaseUomId` ON `Items` (`FK_BaseUomId`);
|
||||
|
||||
CREATE INDEX `IX_Items_FK_BrandId` ON `Items` (`FK_BrandId`);
|
||||
|
||||
CREATE INDEX `IX_Items_FK_CategoryId` ON `Items` (`FK_CategoryId`);
|
||||
|
||||
CREATE INDEX `IX_Items_FK_SubCategoryId` ON `Items` (`FK_SubCategoryId`);
|
||||
|
||||
CREATE INDEX `IX_SubCategories_FK_CategoryId` ON `SubCategories` (`FK_CategoryId`);
|
||||
|
||||
CREATE INDEX `IX_UomConversions_FK_FromUomId` ON `UomConversions` (`FK_FromUomId`);
|
||||
|
||||
CREATE INDEX `IX_UomConversions_FK_ItemId` ON `UomConversions` (`FK_ItemId`);
|
||||
|
||||
CREATE INDEX `IX_UomConversions_FK_ToUomId` ON `UomConversions` (`FK_ToUomId`);
|
||||
|
||||
ALTER TABLE `Items` ADD CONSTRAINT `FK_Items_Brands_FK_BrandId` FOREIGN KEY (`FK_BrandId`) REFERENCES `Brands` (`Id`);
|
||||
|
||||
ALTER TABLE `Items` ADD CONSTRAINT `FK_Items_Categories_FK_CategoryId` FOREIGN KEY (`FK_CategoryId`) REFERENCES `Categories` (`Id`) ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE `Items` ADD CONSTRAINT `FK_Items_SubCategories_FK_SubCategoryId` FOREIGN KEY (`FK_SubCategoryId`) REFERENCES `SubCategories` (`Id`);
|
||||
|
||||
ALTER TABLE `Items` ADD CONSTRAINT `FK_Items_Uoms_FK_BaseUomId` FOREIGN KEY (`FK_BaseUomId`) REFERENCES `Uoms` (`Id`) ON DELETE CASCADE;
|
||||
|
||||
INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`)
|
||||
VALUES ('20260819070136_AddItemCatalog', '10.0.9');
|
||||
|
||||
COMMIT;
|
||||
|
||||
Reference in New Issue
Block a user