调整数据库结构,实现消息模板管理

This commit is contained in:
2025-12-16 11:26:55 +08:00
parent 98e3f7ab73
commit ed32b98867
45 changed files with 1100 additions and 1319 deletions

View File

@@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Atomx.Data.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20251214094758_0.1")]
[Migration("20251216011300_0.1")]
partial class _01
{
/// <inheritdoc />
@@ -347,6 +347,53 @@ namespace Atomx.Data.Migrations
b.ToTable("Categories");
});
modelBuilder.Entity("Atomx.Common.Entities.Channel", b =>
{
b.Property<int>("Id")
.HasColumnType("integer");
b.Property<string>("Config")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("varchar(512)");
b.Property<int>("DisplayOrder")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Network")
.HasColumnType("integer");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("timestamptz");
b.HasKey("Id");
b.ToTable("Channels");
});
modelBuilder.Entity("Atomx.Common.Entities.Currency", b =>
{
b.Property<int>("Id")
@@ -386,6 +433,9 @@ namespace Atomx.Data.Migrations
b.Property<decimal>("Rate")
.HasColumnType("decimal(16, 4)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<string>("Symbolic")
.IsRequired()
.HasColumnType("varchar(8)");
@@ -606,6 +656,10 @@ namespace Atomx.Data.Migrations
b.Property<long>("Id")
.HasColumnType("bigint");
b.Property<string>("Attachments")
.IsRequired()
.HasColumnType("varchar(1024)");
b.Property<string>("Body")
.IsRequired()
.HasColumnType("text");
@@ -620,10 +674,16 @@ namespace Atomx.Data.Migrations
.IsRequired()
.HasColumnType("varchar(64)");
b.Property<int>("LanguageId")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(256)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(256)");
@@ -639,54 +699,6 @@ namespace Atomx.Data.Migrations
b.ToTable("MessageTemplates");
});
modelBuilder.Entity("Atomx.Common.Entities.PaymentChannel", b =>
{
b.Property<int>("Id")
.HasColumnType("integer");
b.Property<string>("Account")
.IsRequired()
.HasColumnType("varchar(256)");
b.Property<string>("Config")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("varchar(512)");
b.Property<int>("DisplayOrder")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Network")
.HasColumnType("integer");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("timestamptz");
b.HasKey("Id");
b.ToTable("PaymentChannels");
});
modelBuilder.Entity("Atomx.Common.Entities.Permission", b =>
{
b.Property<long>("Id")

View File

@@ -145,11 +145,34 @@ namespace Atomx.Data.Migrations
table.PrimaryKey("PK_Categories", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Channels",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
Network = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "varchar(20)", nullable: false),
Title = table.Column<string>(type: "varchar(20)", nullable: false),
Description = table.Column<string>(type: "varchar(512)", nullable: false),
Config = table.Column<string>(type: "text", nullable: false),
DisplayOrder = table.Column<int>(type: "integer", nullable: false),
Status = table.Column<int>(type: "integer", nullable: false),
CreateTime = table.Column<DateTime>(type: "timestamptz", nullable: false),
UpdateTime = table.Column<DateTime>(type: "timestamptz", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Channels", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Currencies",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
Name = table.Column<string>(type: "varchar(50)", nullable: false),
Title = table.Column<string>(type: "varchar(50)", nullable: false),
CurrencyCode = table.Column<string>(type: "varchar(10)", nullable: false),
@@ -273,11 +296,14 @@ namespace Atomx.Data.Migrations
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
LanguageId = table.Column<int>(type: "integer", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
Key = table.Column<string>(type: "varchar(64)", nullable: false),
Name = table.Column<string>(type: "varchar(256)", nullable: false),
Title = table.Column<string>(type: "varchar(256)", nullable: false),
Body = table.Column<string>(type: "text", nullable: false),
Attachments = table.Column<string>(type: "varchar(1024)", nullable: false),
Enabled = table.Column<bool>(type: "boolean", nullable: false),
CreateTime = table.Column<DateTime>(type: "timestamptz", nullable: false),
UpdateTime = table.Column<DateTime>(type: "timestamptz", nullable: true)
@@ -287,28 +313,6 @@ namespace Atomx.Data.Migrations
table.PrimaryKey("PK_MessageTemplates", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PaymentChannels",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
Network = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "varchar(20)", nullable: false),
Title = table.Column<string>(type: "varchar(20)", nullable: false),
Description = table.Column<string>(type: "varchar(512)", nullable: false),
Account = table.Column<string>(type: "varchar(256)", nullable: false),
Config = table.Column<string>(type: "text", nullable: false),
DisplayOrder = table.Column<int>(type: "integer", nullable: false),
Status = table.Column<int>(type: "integer", nullable: false),
CreateTime = table.Column<DateTime>(type: "timestamptz", nullable: false),
UpdateTime = table.Column<DateTime>(type: "timestamptz", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PaymentChannels", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Permissions",
columns: table => new
@@ -563,9 +567,9 @@ namespace Atomx.Data.Migrations
{
Id = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
Key = table.Column<string>(type: "varchar(64)", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "varchar(64)", nullable: false),
Key = table.Column<string>(type: "varchar(64)", nullable: false),
Content = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
@@ -691,6 +695,9 @@ namespace Atomx.Data.Migrations
migrationBuilder.DropTable(
name: "Categories");
migrationBuilder.DropTable(
name: "Channels");
migrationBuilder.DropTable(
name: "Currencies");
@@ -712,9 +719,6 @@ namespace Atomx.Data.Migrations
migrationBuilder.DropTable(
name: "MessageTemplates");
migrationBuilder.DropTable(
name: "PaymentChannels");
migrationBuilder.DropTable(
name: "Permissions");

View File

@@ -344,6 +344,53 @@ namespace Atomx.Data.Migrations
b.ToTable("Categories");
});
modelBuilder.Entity("Atomx.Common.Entities.Channel", b =>
{
b.Property<int>("Id")
.HasColumnType("integer");
b.Property<string>("Config")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("varchar(512)");
b.Property<int>("DisplayOrder")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Network")
.HasColumnType("integer");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("timestamptz");
b.HasKey("Id");
b.ToTable("Channels");
});
modelBuilder.Entity("Atomx.Common.Entities.Currency", b =>
{
b.Property<int>("Id")
@@ -383,6 +430,9 @@ namespace Atomx.Data.Migrations
b.Property<decimal>("Rate")
.HasColumnType("decimal(16, 4)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<string>("Symbolic")
.IsRequired()
.HasColumnType("varchar(8)");
@@ -603,6 +653,10 @@ namespace Atomx.Data.Migrations
b.Property<long>("Id")
.HasColumnType("bigint");
b.Property<string>("Attachments")
.IsRequired()
.HasColumnType("varchar(1024)");
b.Property<string>("Body")
.IsRequired()
.HasColumnType("text");
@@ -617,10 +671,16 @@ namespace Atomx.Data.Migrations
.IsRequired()
.HasColumnType("varchar(64)");
b.Property<int>("LanguageId")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(256)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(256)");
@@ -636,54 +696,6 @@ namespace Atomx.Data.Migrations
b.ToTable("MessageTemplates");
});
modelBuilder.Entity("Atomx.Common.Entities.PaymentChannel", b =>
{
b.Property<int>("Id")
.HasColumnType("integer");
b.Property<string>("Account")
.IsRequired()
.HasColumnType("varchar(256)");
b.Property<string>("Config")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("varchar(512)");
b.Property<int>("DisplayOrder")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Network")
.HasColumnType("integer");
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("varchar(20)");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("timestamptz");
b.HasKey("Id");
b.ToTable("PaymentChannels");
});
modelBuilder.Entity("Atomx.Common.Entities.Permission", b =>
{
b.Property<long>("Id")