LiveChat/Migrations/20230526180433_sqlite.local...

62 lines
2.1 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LiveChat.Migrations
{
/// <inheritdoc />
public partial class sqlitelocal_migration_189 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Rooms",
columns: table => new
{
Id = table.Column<string>(type: "TEXT", nullable: false),
RoomJoinCode = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Rooms", x => x.Id);
});
migrationBuilder.CreateTable(
name: "RoomChatMessages",
columns: table => new
{
Id = table.Column<string>(type: "TEXT", nullable: false),
User = table.Column<string>(type: "TEXT", nullable: true),
Message = table.Column<string>(type: "TEXT", nullable: true),
RoomId = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RoomChatMessages", x => x.Id);
table.ForeignKey(
name: "FK_RoomChatMessages_Rooms_RoomId",
column: x => x.RoomId,
principalTable: "Rooms",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_RoomChatMessages_RoomId",
table: "RoomChatMessages",
column: "RoomId",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RoomChatMessages");
migrationBuilder.DropTable(
name: "Rooms");
}
}
}