mirror of https://github.com/abpframework/eventhub
committed by
GitHub
31 changed files with 3481 additions and 18 deletions
File diff suppressed because it is too large
@ -0,0 +1,135 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace EventHub.Migrations |
||||
|
{ |
||||
|
public partial class Added_CmsKit : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "CmsComments", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true), |
||||
|
EntityType = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false), |
||||
|
EntityId = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false), |
||||
|
Text = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: false), |
||||
|
RepliedCommentId = table.Column<Guid>(type: "uuid", nullable: true), |
||||
|
CreatorId = table.Column<Guid>(type: "uuid", nullable: false), |
||||
|
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
||||
|
ExtraProperties = table.Column<string>(type: "text", nullable: true), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_CmsComments", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "CmsEntityTags", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
TagId = table.Column<Guid>(type: "uuid", nullable: false), |
||||
|
EntityId = table.Column<string>(type: "text", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_CmsEntityTags", x => new { x.EntityId, x.TagId }); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "CmsTags", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true), |
||||
|
EntityType = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false), |
||||
|
Name = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false), |
||||
|
ExtraProperties = table.Column<string>(type: "text", nullable: true), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: true), |
||||
|
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
||||
|
CreatorId = table.Column<Guid>(type: "uuid", nullable: true), |
||||
|
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true), |
||||
|
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true), |
||||
|
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false), |
||||
|
DeleterId = table.Column<Guid>(type: "uuid", nullable: true), |
||||
|
DeletionTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_CmsTags", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "CmsUsers", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false), |
||||
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true), |
||||
|
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false), |
||||
|
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false), |
||||
|
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true), |
||||
|
Surname = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true), |
||||
|
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false), |
||||
|
PhoneNumber = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: true), |
||||
|
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false), |
||||
|
ExtraProperties = table.Column<string>(type: "text", nullable: true), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_CmsUsers", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_CmsComments_TenantId_EntityType_EntityId", |
||||
|
table: "CmsComments", |
||||
|
columns: new[] { "TenantId", "EntityType", "EntityId" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_CmsComments_TenantId_RepliedCommentId", |
||||
|
table: "CmsComments", |
||||
|
columns: new[] { "TenantId", "RepliedCommentId" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_CmsEntityTags_TenantId_EntityId_TagId", |
||||
|
table: "CmsEntityTags", |
||||
|
columns: new[] { "TenantId", "EntityId", "TagId" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_CmsTags_TenantId_Name", |
||||
|
table: "CmsTags", |
||||
|
columns: new[] { "TenantId", "Name" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_CmsUsers_TenantId_Email", |
||||
|
table: "CmsUsers", |
||||
|
columns: new[] { "TenantId", "Email" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_CmsUsers_TenantId_UserName", |
||||
|
table: "CmsUsers", |
||||
|
columns: new[] { "TenantId", "UserName" }); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "CmsComments"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "CmsEntityTags"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "CmsTags"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "CmsUsers"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue