using System; using Microsoft.EntityFrameworkCore.Migrations; namespace MyCompanyName.MyProjectName.Host.Migrations { public partial class Initial : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AbpAuditLogs", columns: table => new { Id = table.Column(nullable: false), ExtraProperties = table.Column(nullable: true), ConcurrencyStamp = table.Column(nullable: true), UserId = table.Column(nullable: true), UserName = table.Column(maxLength: 256, nullable: true), TenantId = table.Column(nullable: true), ImpersonatorUserId = table.Column(nullable: true), ImpersonatorTenantId = table.Column(nullable: true), ExecutionTime = table.Column(nullable: false), ExecutionDuration = table.Column(nullable: false), ClientIpAddress = table.Column(maxLength: 64, nullable: true), ClientName = table.Column(maxLength: 128, nullable: true), BrowserInfo = table.Column(maxLength: 512, nullable: true), HttpMethod = table.Column(maxLength: 16, nullable: true), Url = table.Column(maxLength: 256, nullable: true), Exceptions = table.Column(maxLength: 4000, nullable: true), Comments = table.Column(maxLength: 256, nullable: true), HttpStatusCode = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); }); migrationBuilder.CreateTable( name: "AbpPermissionGrants", columns: table => new { Id = table.Column(nullable: false), TenantId = table.Column(nullable: true), Name = table.Column(maxLength: 128, nullable: false), ProviderName = table.Column(maxLength: 64, nullable: false), ProviderKey = table.Column(maxLength: 64, nullable: false) }, constraints: table => { table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id); }); migrationBuilder.CreateTable( name: "AbpSettings", columns: table => new { Id = table.Column(nullable: false), Name = table.Column(maxLength: 128, nullable: false), Value = table.Column(maxLength: 2048, nullable: false), ProviderName = table.Column(maxLength: 64, nullable: true), ProviderKey = table.Column(maxLength: 64, nullable: true) }, constraints: table => { table.PrimaryKey("PK_AbpSettings", x => x.Id); }); migrationBuilder.CreateTable( name: "AbpAuditLogActions", columns: table => new { Id = table.Column(nullable: false), TenantId = table.Column(nullable: true), AuditLogId = table.Column(nullable: false), ServiceName = table.Column(maxLength: 256, nullable: true), MethodName = table.Column(maxLength: 128, nullable: true), Parameters = table.Column(maxLength: 2000, nullable: true), ExecutionTime = table.Column(nullable: false), ExecutionDuration = table.Column(nullable: false), ExtraProperties = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id); table.ForeignKey( name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId", column: x => x.AuditLogId, principalTable: "AbpAuditLogs", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AbpEntityChanges", columns: table => new { Id = table.Column(nullable: false), AuditLogId = table.Column(nullable: false), TenantId = table.Column(nullable: true), ChangeTime = table.Column(nullable: false), ChangeType = table.Column(nullable: false), EntityId = table.Column(maxLength: 128, nullable: false), EntityTypeFullName = table.Column(maxLength: 128, nullable: false), ExtraProperties = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_AbpEntityChanges", x => x.Id); table.ForeignKey( name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId", column: x => x.AuditLogId, principalTable: "AbpAuditLogs", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AbpEntityPropertyChanges", columns: table => new { Id = table.Column(nullable: false), TenantId = table.Column(nullable: true), EntityChangeId = table.Column(nullable: false), NewValue = table.Column(maxLength: 512, nullable: true), OriginalValue = table.Column(maxLength: 512, nullable: true), PropertyName = table.Column(maxLength: 128, nullable: false), PropertyTypeFullName = table.Column(maxLength: 64, nullable: false), EntityChangeId1 = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id); table.ForeignKey( name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId", column: x => x.EntityChangeId, principalTable: "AbpEntityChanges", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId1", column: x => x.EntityChangeId1, principalTable: "AbpEntityChanges", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_AbpAuditLogActions_AuditLogId", table: "AbpAuditLogActions", column: "AuditLogId"); migrationBuilder.CreateIndex( name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime", table: "AbpAuditLogActions", columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" }); migrationBuilder.CreateIndex( name: "IX_AbpAuditLogs_TenantId_ExecutionTime", table: "AbpAuditLogs", columns: new[] { "TenantId", "ExecutionTime" }); migrationBuilder.CreateIndex( name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime", table: "AbpAuditLogs", columns: new[] { "TenantId", "UserId", "ExecutionTime" }); migrationBuilder.CreateIndex( name: "IX_AbpEntityChanges_AuditLogId", table: "AbpEntityChanges", column: "AuditLogId"); migrationBuilder.CreateIndex( name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", table: "AbpEntityChanges", columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" }); migrationBuilder.CreateIndex( name: "IX_AbpEntityPropertyChanges_EntityChangeId", table: "AbpEntityPropertyChanges", column: "EntityChangeId"); migrationBuilder.CreateIndex( name: "IX_AbpEntityPropertyChanges_EntityChangeId1", table: "AbpEntityPropertyChanges", column: "EntityChangeId1"); migrationBuilder.CreateIndex( name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey", table: "AbpPermissionGrants", columns: new[] { "Name", "ProviderName", "ProviderKey" }); migrationBuilder.CreateIndex( name: "IX_AbpSettings_Name_ProviderName_ProviderKey", table: "AbpSettings", columns: new[] { "Name", "ProviderName", "ProviderKey" }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AbpAuditLogActions"); migrationBuilder.DropTable( name: "AbpEntityPropertyChanges"); migrationBuilder.DropTable( name: "AbpPermissionGrants"); migrationBuilder.DropTable( name: "AbpSettings"); migrationBuilder.DropTable( name: "AbpEntityChanges"); migrationBuilder.DropTable( name: "AbpAuditLogs"); } } }