using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Bunny.Common.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Blogs", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Url = table.Column(type: "TEXT", nullable: false), CreateTime = table.Column(type: "TEXT", nullable: false), UpdateTime = table.Column(type: "TEXT", nullable: false), CreateUserId = table.Column(type: "INTEGER", nullable: false), UpdateUserId = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Blogs", x => x.Id); }); migrationBuilder.CreateTable( name: "Products", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), CustomerId = table.Column(type: "TEXT", nullable: true), CustomerName = table.Column(type: "TEXT", nullable: true), PackageType = table.Column(type: "TEXT", nullable: true), CreateTime = table.Column(type: "TEXT", nullable: false), UpdateTime = table.Column(type: "TEXT", nullable: false), CreateUserId = table.Column(type: "INTEGER", nullable: false), UpdateUserId = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Products", x => x.Id); }); migrationBuilder.CreateTable( name: "Users", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), UserName = table.Column(type: "TEXT", nullable: true), Password = table.Column(type: "TEXT", nullable: true), Email = table.Column(type: "TEXT", nullable: true), Phone = table.Column(type: "TEXT", nullable: true), QrCode = table.Column(type: "TEXT", nullable: true), CompanyCode = table.Column(type: "TEXT", nullable: true), DeptCode = table.Column(type: "TEXT", nullable: true), CreateTime = table.Column(type: "TEXT", nullable: false), UpdateTime = table.Column(type: "TEXT", nullable: false), CreateUserId = table.Column(type: "INTEGER", nullable: false), UpdateUserId = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); }); migrationBuilder.CreateTable( name: "Posts", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), PostId = table.Column(type: "INTEGER", nullable: false), Title = table.Column(type: "TEXT", nullable: true), Content = table.Column(type: "TEXT", nullable: true), BlogId = table.Column(type: "INTEGER", nullable: false), BlogId1 = table.Column(type: "TEXT", nullable: true), CreateTime = table.Column(type: "TEXT", nullable: false), UpdateTime = table.Column(type: "TEXT", nullable: false), CreateUserId = table.Column(type: "INTEGER", nullable: false), UpdateUserId = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Posts", x => x.Id); table.ForeignKey( name: "FK_Posts_Blogs_BlogId1", column: x => x.BlogId1, principalTable: "Blogs", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_Posts_BlogId1", table: "Posts", column: "BlogId1"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Posts"); migrationBuilder.DropTable( name: "Products"); migrationBuilder.DropTable( name: "Users"); migrationBuilder.DropTable( name: "Blogs"); } } }