更新数据库

This commit is contained in:
yxw
2025-12-23 18:39:39 +08:00
parent 3c4144335f
commit a1516490d2
15 changed files with 187 additions and 77 deletions

View File

@@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Atomx.Data.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20251216011300_0.1")]
[Migration("20251223083953_0.1")]
partial class _01
{
/// <inheritdoc />
@@ -193,8 +193,8 @@ namespace Atomx.Data.Migrations
b.Property<int>("Platform")
.HasColumnType("integer");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<int>("Status")
.HasColumnType("integer");
@@ -329,8 +329,8 @@ namespace Atomx.Data.Migrations
.IsRequired()
.HasColumnType("varchar(100)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<string>("Slug")
.IsRequired()
@@ -373,8 +373,8 @@ namespace Atomx.Data.Migrations
b.Property<int>("Network")
.HasColumnType("integer");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<int>("Status")
.HasColumnType("integer");
@@ -397,8 +397,11 @@ namespace Atomx.Data.Migrations
modelBuilder.Entity("Atomx.Common.Entities.Currency", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
@@ -433,8 +436,8 @@ namespace Atomx.Data.Migrations
b.Property<decimal>("Rate")
.HasColumnType("decimal(16, 4)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<string>("Symbolic")
.IsRequired()
@@ -681,8 +684,8 @@ namespace Atomx.Data.Migrations
.IsRequired()
.HasColumnType("varchar(256)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
@@ -1226,8 +1229,8 @@ namespace Atomx.Data.Migrations
.IsRequired()
.HasColumnType("varchar(64)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<int>("Type")
.HasColumnType("integer");
@@ -1239,8 +1242,11 @@ namespace Atomx.Data.Migrations
modelBuilder.Entity("Atomx.Common.Entities.SiteApp", b =>
{
b.Property<long>("Id")
.HasColumnType("bigint");
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
@@ -1333,6 +1339,40 @@ namespace Atomx.Data.Migrations
b.ToTable("SpecificationAttributeOptions");
});
modelBuilder.Entity("Atomx.Common.Entities.Tag", b =>
{
b.Property<long>("Id")
.HasColumnType("bigint");
b.Property<string>("Color")
.IsRequired()
.HasColumnType("varchar(12)");
b.Property<int>("Count")
.HasColumnType("integer");
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
b.Property<int>("Enabled")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(64)");
b.Property<string>("Slug")
.IsRequired()
.HasColumnType("varchar(128)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("timestamptz");
b.HasKey("Id");
b.ToTable("Tags");
});
modelBuilder.Entity("Atomx.Common.Entities.UploadFile", b =>
{
b.Property<long>("Id")
@@ -1368,8 +1408,8 @@ namespace Atomx.Data.Migrations
.IsRequired()
.HasColumnType("varchar(128)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<int>("Size")
.HasColumnType("integer");

View File

@@ -76,7 +76,7 @@ namespace Atomx.Data.Migrations
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<int>(type: "integer", nullable: false),
Platform = table.Column<int>(type: "integer", nullable: false),
AppName = table.Column<string>(type: "varchar(64)", nullable: false),
Title = table.Column<string>(type: "varchar(64)", nullable: false),
@@ -121,7 +121,7 @@ namespace Atomx.Data.Migrations
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<int>(type: "integer", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
ParentId = table.Column<long>(type: "bigint", nullable: false),
Name = table.Column<string>(type: "varchar(25)", nullable: false),
@@ -150,7 +150,7 @@ namespace Atomx.Data.Migrations
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
SiteId = 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),
@@ -171,8 +171,9 @@ namespace Atomx.Data.Migrations
name: "Currencies",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SiteId = table.Column<int>(type: "integer", 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),
@@ -296,7 +297,7 @@ namespace Atomx.Data.Migrations
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<int>(type: "integer", 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),
@@ -566,7 +567,7 @@ namespace Atomx.Data.Migrations
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<int>(type: "integer", 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),
@@ -581,7 +582,8 @@ namespace Atomx.Data.Migrations
name: "SiteApps",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Type = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "varchar(64)", nullable: false),
Enabled = table.Column<bool>(type: "boolean", nullable: false),
@@ -631,12 +633,30 @@ namespace Atomx.Data.Migrations
table.PrimaryKey("PK_SpecificationAttributes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Tags",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
Name = table.Column<string>(type: "varchar(64)", nullable: false),
Color = table.Column<string>(type: "varchar(12)", nullable: false),
Slug = table.Column<string>(type: "varchar(128)", nullable: false),
Count = table.Column<int>(type: "integer", nullable: false),
Enabled = 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_Tags", x => x.Id);
});
migrationBuilder.CreateTable(
name: "UploadFiles",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<long>(type: "bigint", nullable: false),
SiteId = table.Column<int>(type: "integer", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
Name = table.Column<string>(type: "varchar(64)", nullable: false),
Path = table.Column<string>(type: "varchar(128)", nullable: false),
@@ -764,6 +784,9 @@ namespace Atomx.Data.Migrations
migrationBuilder.DropTable(
name: "SpecificationAttributes");
migrationBuilder.DropTable(
name: "Tags");
migrationBuilder.DropTable(
name: "UploadFiles");

View File

@@ -190,8 +190,8 @@ namespace Atomx.Data.Migrations
b.Property<int>("Platform")
.HasColumnType("integer");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<int>("Status")
.HasColumnType("integer");
@@ -326,8 +326,8 @@ namespace Atomx.Data.Migrations
.IsRequired()
.HasColumnType("varchar(100)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<string>("Slug")
.IsRequired()
@@ -370,8 +370,8 @@ namespace Atomx.Data.Migrations
b.Property<int>("Network")
.HasColumnType("integer");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<int>("Status")
.HasColumnType("integer");
@@ -394,8 +394,11 @@ namespace Atomx.Data.Migrations
modelBuilder.Entity("Atomx.Common.Entities.Currency", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
@@ -430,8 +433,8 @@ namespace Atomx.Data.Migrations
b.Property<decimal>("Rate")
.HasColumnType("decimal(16, 4)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<string>("Symbolic")
.IsRequired()
@@ -678,8 +681,8 @@ namespace Atomx.Data.Migrations
.IsRequired()
.HasColumnType("varchar(256)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<string>("Title")
.IsRequired()
@@ -1223,8 +1226,8 @@ namespace Atomx.Data.Migrations
.IsRequired()
.HasColumnType("varchar(64)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<int>("Type")
.HasColumnType("integer");
@@ -1236,8 +1239,11 @@ namespace Atomx.Data.Migrations
modelBuilder.Entity("Atomx.Common.Entities.SiteApp", b =>
{
b.Property<long>("Id")
.HasColumnType("bigint");
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
@@ -1330,6 +1336,40 @@ namespace Atomx.Data.Migrations
b.ToTable("SpecificationAttributeOptions");
});
modelBuilder.Entity("Atomx.Common.Entities.Tag", b =>
{
b.Property<long>("Id")
.HasColumnType("bigint");
b.Property<string>("Color")
.IsRequired()
.HasColumnType("varchar(12)");
b.Property<int>("Count")
.HasColumnType("integer");
b.Property<DateTime>("CreateTime")
.HasColumnType("timestamptz");
b.Property<int>("Enabled")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(64)");
b.Property<string>("Slug")
.IsRequired()
.HasColumnType("varchar(128)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("timestamptz");
b.HasKey("Id");
b.ToTable("Tags");
});
modelBuilder.Entity("Atomx.Common.Entities.UploadFile", b =>
{
b.Property<long>("Id")
@@ -1365,8 +1405,8 @@ namespace Atomx.Data.Migrations
.IsRequired()
.HasColumnType("varchar(128)");
b.Property<long>("SiteId")
.HasColumnType("bigint");
b.Property<int>("SiteId")
.HasColumnType("integer");
b.Property<int>("Size")
.HasColumnType("integer");