using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win_in.Sfs.Message.Migrations { public partial class rebuild : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "MessageChatMessage", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), TenantId = table.Column(type: "uniqueidentifier", nullable: true), Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), From = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), To = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), Title = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: false), Content = table.Column(type: "nvarchar(max)", nullable: true), IsSendEmail = table.Column(type: "bit", nullable: false), IsSendSms = table.Column(type: "bit", nullable: false), IsRead = table.Column(type: "bit", nullable: false), IsPush = table.Column(type: "bit", nullable: false), MessageContentType = table.Column(type: "nvarchar(max)", nullable: false), EnumMessageLevel = table.Column(type: "int", nullable: false), EnumSendToType = table.Column(type: "int", nullable: false), SendTime = table.Column(type: "datetime2", nullable: false), ReadTime = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_MessageChatMessage", x => x.Id); }); migrationBuilder.CreateTable( name: "MessageMessageType", columns: table => new { Id = table.Column(type: "uniqueidentifier", maxLength: 64, nullable: false), MessageTypeName = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), EmailTemplateName = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), SmsTemplateName = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), MessageCategory = table.Column(type: "int", maxLength: 4096, nullable: false), IsSendEmail = table.Column(type: "bit", nullable: false), IsSendSms = table.Column(type: "bit", nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), TenantId = table.Column(type: "uniqueidentifier", nullable: true), Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) }, constraints: table => { table.PrimaryKey("PK_MessageMessageType", x => x.Id); }); migrationBuilder.CreateTable( name: "MessageMessageType__SubscribePeople", columns: table => new { Id = table.Column(type: "uniqueidentifier", maxLength: 64, nullable: false), PeopleId = table.Column(type: "uniqueidentifier", maxLength: 64, nullable: false), MessageTypeId = table.Column(type: "uniqueidentifier", maxLength: 4096, nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), TenantId = table.Column(type: "uniqueidentifier", nullable: true), Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) }, constraints: table => { table.PrimaryKey("PK_MessageMessageType__SubscribePeople", x => x.Id); }); migrationBuilder.CreateTable( name: "MessageSiteMessage", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), From = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), Title = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: false), Content = table.Column(type: "nvarchar(max)", nullable: true), EnumSendToType = table.Column(type: "int", nullable: false), MessageContentType = table.Column(type: "nvarchar(max)", nullable: false), MessageTypeId = table.Column(type: "uniqueidentifier", nullable: false), EnumMessageLevel = table.Column(type: "int", nullable: false), SendTime = table.Column(type: "datetime2", nullable: false), EnumMessageStats = table.Column(type: "int", nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), TenantId = table.Column(type: "uniqueidentifier", nullable: true), Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) }, constraints: table => { table.PrimaryKey("PK_MessageSiteMessage", x => x.Id); }); migrationBuilder.CreateTable( name: "MessageSiteMessage__SubscribePeople", columns: table => new { Id = table.Column(type: "uniqueidentifier", maxLength: 64, nullable: false), PeopleId = table.Column(type: "uniqueidentifier", maxLength: 64, nullable: false), SiteMessageId = table.Column(type: "uniqueidentifier", maxLength: 4096, nullable: false), IsRead = table.Column(type: "bit", maxLength: 4096, nullable: false), IsPush = table.Column(type: "bit", maxLength: 4096, nullable: false), IsSenTSms = table.Column(type: "bit", nullable: false), IsSenTEmail = table.Column(type: "bit", maxLength: 4096, nullable: false), PushDateTime = table.Column(type: "datetime2", maxLength: 4096, nullable: false), ReadDateTime = table.Column(type: "datetime2", maxLength: 4096, nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), TenantId = table.Column(type: "uniqueidentifier", nullable: true), Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) }, constraints: table => { table.PrimaryKey("PK_MessageSiteMessage__SubscribePeople", x => x.Id); }); migrationBuilder.CreateTable( name: "MessageSubscribePeople", columns: table => new { Id = table.Column(type: "uniqueidentifier", maxLength: 64, nullable: false), PeopleId = table.Column(type: "uniqueidentifier", maxLength: 64, nullable: false), NickName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), PhoneNumber = table.Column(type: "nvarchar(max)", nullable: false), Email = table.Column(type: "nvarchar(max)", nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), TenantId = table.Column(type: "uniqueidentifier", nullable: true), Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) }, constraints: table => { table.PrimaryKey("PK_MessageSubscribePeople", x => x.Id); }); migrationBuilder.CreateTable( name: "MessageSystemMessage", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), TenantId = table.Column(type: "uniqueidentifier", nullable: true), Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), From = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), To = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), Title = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: false), Content = table.Column(type: "nvarchar(max)", nullable: true), IsSendEmail = table.Column(type: "bit", nullable: false), IsSendSms = table.Column(type: "bit", nullable: false), IsRead = table.Column(type: "bit", nullable: false), IsPush = table.Column(type: "bit", nullable: false), MessageContentType = table.Column(type: "nvarchar(max)", nullable: false), EnumMessageLevel = table.Column(type: "int", nullable: false), EnumSendToType = table.Column(type: "int", nullable: false), SendTime = table.Column(type: "datetime2", nullable: false), ReadTime = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_MessageSystemMessage", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_MessageChatMessage_Company", table: "MessageChatMessage", column: "Company"); migrationBuilder.CreateIndex( name: "IX_MessageMessageType_Company", table: "MessageMessageType", column: "Company"); migrationBuilder.CreateIndex( name: "IX_MessageMessageType__SubscribePeople_Company", table: "MessageMessageType__SubscribePeople", column: "Company"); migrationBuilder.CreateIndex( name: "IX_MessageSiteMessage_Company", table: "MessageSiteMessage", column: "Company"); migrationBuilder.CreateIndex( name: "IX_MessageSiteMessage__SubscribePeople_Company", table: "MessageSiteMessage__SubscribePeople", column: "Company"); migrationBuilder.CreateIndex( name: "IX_MessageSubscribePeople_Company", table: "MessageSubscribePeople", column: "Company"); migrationBuilder.CreateIndex( name: "IX_MessageSystemMessage_Company", table: "MessageSystemMessage", column: "Company"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "MessageChatMessage"); migrationBuilder.DropTable( name: "MessageMessageType"); migrationBuilder.DropTable( name: "MessageMessageType__SubscribePeople"); migrationBuilder.DropTable( name: "MessageSiteMessage"); migrationBuilder.DropTable( name: "MessageSiteMessage__SubscribePeople"); migrationBuilder.DropTable( name: "MessageSubscribePeople"); migrationBuilder.DropTable( name: "MessageSystemMessage"); } } }