85 lines
3.5 KiB
C#
85 lines
3.5 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Content.Server.Database.Migrations.Sqlite
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class CosmaticDriftCharacterRecords : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "cdprofile",
|
|
columns: table => new
|
|
{
|
|
cdprofile_id = table.Column<int>(type: "INTEGER", nullable: false)
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
profile_id = table.Column<int>(type: "INTEGER", nullable: false),
|
|
height = table.Column<float>(type: "REAL", nullable: false),
|
|
character_records = table.Column<byte[]>(type: "jsonb", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_cdprofile", x => x.cdprofile_id);
|
|
table.ForeignKey(
|
|
name: "FK_cdprofile_profile_profile_id",
|
|
column: x => x.profile_id,
|
|
principalTable: "profile",
|
|
principalColumn: "profile_id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "cd_character_record_entries",
|
|
columns: table => new
|
|
{
|
|
cd_character_record_entries_id = table.Column<int>(type: "INTEGER", nullable: false)
|
|
.Annotation("Sqlite:Autoincrement", true),
|
|
title = table.Column<string>(type: "TEXT", nullable: false),
|
|
involved = table.Column<string>(type: "TEXT", nullable: false),
|
|
description = table.Column<string>(type: "TEXT", nullable: false),
|
|
type = table.Column<byte>(type: "INTEGER", nullable: false),
|
|
cdprofile_id = table.Column<int>(type: "INTEGER", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_cd_character_record_entries", x => x.cd_character_record_entries_id);
|
|
table.ForeignKey(
|
|
name: "FK_cd_character_record_entries_cdprofile_cdprofile_id",
|
|
column: x => x.cdprofile_id,
|
|
principalTable: "cdprofile",
|
|
principalColumn: "cdprofile_id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_cd_character_record_entries_cd_character_record_entries_id",
|
|
table: "cd_character_record_entries",
|
|
column: "cd_character_record_entries_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_cd_character_record_entries_cdprofile_id",
|
|
table: "cd_character_record_entries",
|
|
column: "cdprofile_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_cdprofile_profile_id",
|
|
table: "cdprofile",
|
|
column: "profile_id",
|
|
unique: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "cd_character_record_entries");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "cdprofile");
|
|
}
|
|
}
|
|
}
|