| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using Microsoft.EntityFrameworkCore.Metadata;
- using Microsoft.EntityFrameworkCore.Migrations;
- using System;
- using System.Collections.Generic;
- namespace Winsoft.GOV.XF.WebApi.WXCore.Migrations
- {
- public partial class Initial : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Bundle",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "char(36)", nullable: false),
- Describe = table.Column<string>(type: "longtext", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Bundle", x => x.Id);
- });
- migrationBuilder.CreateTable(
- name: "WXUser",
- columns: table => new
- {
- Id = table.Column<int>(type: "int", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
- Mobile = table.Column<string>(type: "longtext", nullable: true),
- OpenId = table.Column<string>(type: "longtext", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WXUser", x => x.Id);
- });
- migrationBuilder.CreateTable(
- name: "Asset",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "char(36)", nullable: false),
- AssetType = table.Column<int>(type: "int", nullable: false),
- BundleId = table.Column<Guid>(type: "char(36)", nullable: false),
- Data = table.Column<string>(type: "longtext", nullable: true),
- Describe = table.Column<string>(type: "longtext", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Asset", x => x.Id);
- table.ForeignKey(
- name: "FK_Asset_Bundle_BundleId",
- column: x => x.BundleId,
- principalTable: "Bundle",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
- migrationBuilder.CreateIndex(
- name: "IX_Asset_BundleId",
- table: "Asset",
- column: "BundleId");
- }
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "Asset");
- migrationBuilder.DropTable(
- name: "WXUser");
- migrationBuilder.DropTable(
- name: "Bundle");
- }
- }
- }
|