添加命令数据验证和其他杂项修改
This commit is contained in:
@@ -1,73 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace QRCodeService.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20210224014442_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.3");
|
||||
|
||||
modelBuilder.Entity("Domain.AggregateModel.AppAggregate.App", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("AppKey")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("BaseUrl")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Remarks")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Apps");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Domain.AggregateModel.LinkAggregate.Link", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("AppId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("BaseUrl")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("FullUrl")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("ShortCode")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("SuffixUrl")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime>("Time")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Links");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
namespace QRCodeService.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20210224015439_AddConfiguration")]
|
||||
partial class AddConfiguration
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
||||
.HasAnnotation("ProductVersion", "5.0.3");
|
||||
|
||||
modelBuilder.Entity("Domain.AggregateModel.AppAggregate.App", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("AppKey")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("BaseUrl")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Remarks")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("App");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Domain.AggregateModel.LinkAggregate.Link", b =>
|
||||
{
|
||||
b.Property<string>("ShortCode")
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.Property<int>("AppId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("BaseUrl")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("FullUrl")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SuffixUrl")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<DateTime>("Time")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.HasKey("ShortCode");
|
||||
|
||||
b.ToTable("Link");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace QRCodeService.Migrations
|
||||
{
|
||||
public partial class AddConfiguration : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_Links",
|
||||
table: "Links");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_Apps",
|
||||
table: "Apps");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "Links",
|
||||
newName: "Link");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "Apps",
|
||||
newName: "App");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ShortCode",
|
||||
table: "Link",
|
||||
type: "varchar(255)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "longtext",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "Id",
|
||||
table: "Link",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_Link",
|
||||
table: "Link",
|
||||
column: "ShortCode");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_App",
|
||||
table: "App",
|
||||
column: "Id");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_Link",
|
||||
table: "Link");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_App",
|
||||
table: "App");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "Link",
|
||||
newName: "Links");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "App",
|
||||
newName: "Apps");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "Id",
|
||||
table: "Links",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ShortCode",
|
||||
table: "Links",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(255)");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_Links",
|
||||
table: "Links",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_Apps",
|
||||
table: "Apps",
|
||||
column: "Id");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace QRCodeService.Migrations
|
||||
{
|
||||
public partial class SetProperty : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_Link",
|
||||
table: "Link");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "Id",
|
||||
table: "Link",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ShortCode",
|
||||
table: "Link",
|
||||
type: "varchar(11)",
|
||||
maxLength: 11,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(255)");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_Link",
|
||||
table: "Link",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Link_ShortCode",
|
||||
table: "Link",
|
||||
column: "ShortCode",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_Link",
|
||||
table: "Link");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Link_ShortCode",
|
||||
table: "Link");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ShortCode",
|
||||
table: "Link",
|
||||
type: "varchar(255)",
|
||||
nullable: false,
|
||||
defaultValue: "",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(11)",
|
||||
oldMaxLength: 11,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "Id",
|
||||
table: "Link",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int")
|
||||
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_Link",
|
||||
table: "Link",
|
||||
column: "ShortCode");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace QRCodeService.Migrations
|
||||
{
|
||||
[DbContext(typeof(AppDbContext))]
|
||||
[Migration("20210224015858_SetProperty")]
|
||||
partial class SetProperty
|
||||
[Migration("20210224065420_init")]
|
||||
partial class init
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -4,12 +4,12 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace QRCodeService.Migrations
|
||||
{
|
||||
public partial class InitialCreate : Migration
|
||||
public partial class init : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Apps",
|
||||
name: "App",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
@@ -20,16 +20,16 @@ namespace QRCodeService.Migrations
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Apps", x => x.Id);
|
||||
table.PrimaryKey("PK_App", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Links",
|
||||
name: "Link",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
ShortCode = table.Column<string>(type: "longtext", nullable: true),
|
||||
ShortCode = table.Column<string>(type: "varchar(11)", maxLength: 11, nullable: true),
|
||||
BaseUrl = table.Column<string>(type: "longtext", nullable: true),
|
||||
SuffixUrl = table.Column<string>(type: "longtext", nullable: true),
|
||||
FullUrl = table.Column<string>(type: "longtext", nullable: true),
|
||||
@@ -38,17 +38,23 @@ namespace QRCodeService.Migrations
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Links", x => x.Id);
|
||||
table.PrimaryKey("PK_Link", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Link_ShortCode",
|
||||
table: "Link",
|
||||
column: "ShortCode",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Apps");
|
||||
name: "App");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Links");
|
||||
name: "Link");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user