updTE DB PRO
This commit is contained in:
@@ -47,6 +47,8 @@ namespace TaxPayer.Infrastructure.Persistence
|
||||
public DbSet<stuff> Stuffs { get; set; }
|
||||
public DbSet<Ulr> Ulrs { get; set; }
|
||||
public DbSet<rptQueue> rptQueue { get; set; }
|
||||
public DbSet<Promotion> Promotions { get; set; }
|
||||
public DbSet<PromotionDetails> PromotionDetails { get; set; }
|
||||
#endregion
|
||||
//public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||
//{
|
||||
|
81
Back/Migrations/20240725100322_Promotion.Designer.cs
generated
Normal file
81
Back/Migrations/20240725100322_Promotion.Designer.cs
generated
Normal file
@@ -0,0 +1,81 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TaxPayer.Infrastructure.Persistence;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Back.Migrations
|
||||
{
|
||||
[DbContext(typeof(SqlDbContext))]
|
||||
[Migration("20240725100322_Promotion")]
|
||||
partial class Promotion
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.15")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
|
||||
modelBuilder.Entity("Back.Data.Models.Promotion", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Satus")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Promotions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Back.Data.Models.PromotionDetails", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<decimal>("APrice")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<int>("CreditAmount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PermissionID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PromotionID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("PermissionID");
|
||||
|
||||
b.HasIndex("PromotionID");
|
||||
|
||||
b.ToTable("PromotionDetails");
|
||||
});
|
||||
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
100
Back/Migrations/20240725100322_Promotion.cs
Normal file
100
Back/Migrations/20240725100322_Promotion.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Back.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Promotion : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Promotions",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Satus = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Promotions", x => x.ID);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PromotionDetails",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
PromotionID = table.Column<int>(type: "int", nullable: false),
|
||||
PermissionID = table.Column<int>(type: "int", nullable: false),
|
||||
CreditAmount = table.Column<int>(type: "int", nullable: false),
|
||||
APrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PromotionDetails", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_PromotionDetails_Permissions_PermissionID",
|
||||
column: x => x.PermissionID,
|
||||
principalTable: "Permissions",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_PromotionDetails_Promotions_PromotionID",
|
||||
column: x => x.PromotionID,
|
||||
principalTable: "Promotions",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PromotionDetails_PermissionID",
|
||||
table: "PromotionDetails",
|
||||
column: "PermissionID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PromotionDetails_PromotionID",
|
||||
table: "PromotionDetails",
|
||||
column: "PromotionID");
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PromotionDetails");
|
||||
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Promotions");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
79
Back/Migrations/SqlDbContextModelSnapshot.cs
Normal file
79
Back/Migrations/SqlDbContextModelSnapshot.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TaxPayer.Infrastructure.Persistence;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Back.Migrations
|
||||
{
|
||||
[DbContext(typeof(SqlDbContext))]
|
||||
partial class SqlDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.15")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
|
||||
modelBuilder.Entity("Back.Data.Models.Promotion", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Satus")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Promotions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Back.Data.Models.PromotionDetails", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<decimal>("APrice")
|
||||
.HasColumnType("decimal(18,2)");
|
||||
|
||||
b.Property<int>("CreditAmount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PermissionID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("PromotionID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("PermissionID");
|
||||
|
||||
b.HasIndex("PromotionID");
|
||||
|
||||
b.ToTable("PromotionDetails");
|
||||
});
|
||||
|
||||
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user