41 lines
1.5 KiB
C#
41 lines
1.5 KiB
C#
using Iceshrimp.Backend.Core.Database.Tables;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Iceshrimp.Backend.Core.Database.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddUserSettingsTable : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "user_settings",
|
|
columns: table => new
|
|
{
|
|
userId = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
|
|
defaultNoteVisibility = table.Column<Note.NoteVisibility>(type: "note_visibility_enum", nullable: false, defaultValue: Note.NoteVisibility.Public),
|
|
privateMode = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_user_settings", x => x.userId);
|
|
table.ForeignKey(
|
|
name: "FK_user_settings_user_userId",
|
|
column: x => x.userId,
|
|
principalTable: "user",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "user_settings");
|
|
}
|
|
}
|
|
}
|