添加数据库迁移
This commit is contained in:
54
QRCodeService/Migrations/20210224014442_InitialCreate.cs
Normal file
54
QRCodeService/Migrations/20210224014442_InitialCreate.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace QRCodeService.Migrations
|
||||
{
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Apps",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
AppKey = table.Column<string>(type: "longtext", nullable: true),
|
||||
BaseUrl = table.Column<string>(type: "longtext", nullable: true),
|
||||
Remarks = table.Column<string>(type: "longtext", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Apps", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Links",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
ShortCode = table.Column<string>(type: "longtext", 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),
|
||||
AppId = table.Column<int>(type: "int", nullable: false),
|
||||
Time = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Links", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Apps");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Links");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user