Files
qrcodeService/QRCodeService/Migrations/20210224065420_init.cs

61 lines
2.4 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace QRCodeService.Migrations
{
public partial class init : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "App",
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_App", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Link",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
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),
AppId = table.Column<int>(type: "int", nullable: false),
Time = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
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: "App");
migrationBuilder.DropTable(
name: "Link");
}
}
}