using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace song_of_the_day.DataMigrations
{
///
public partial class UpdateUserModel : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_SongSuggestions_Songs_SongId",
table: "SongSuggestions");
migrationBuilder.DropForeignKey(
name: "FK_SongSuggestions_Users_UserId",
table: "SongSuggestions");
migrationBuilder.AlterColumn(
name: "SignalMemberId",
table: "Users",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn(
name: "NickName",
table: "Users",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn(
name: "Name",
table: "Users",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AddColumn(
name: "AssociationInProgress",
table: "Users",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
name: "LdapUserName",
table: "Users",
type: "text",
nullable: true);
migrationBuilder.AlterColumn(
name: "Title",
table: "SuggestionHelpers",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn(
name: "Description",
table: "SuggestionHelpers",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn(
name: "UserId",
table: "SongSuggestions",
type: "integer",
nullable: true,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn(
name: "SongId",
table: "SongSuggestions",
type: "integer",
nullable: true,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn(
name: "Url",
table: "Songs",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn(
name: "Name",
table: "Songs",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn(
name: "Artist",
table: "Songs",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AddForeignKey(
name: "FK_SongSuggestions_Songs_SongId",
table: "SongSuggestions",
column: "SongId",
principalTable: "Songs",
principalColumn: "SongId");
migrationBuilder.AddForeignKey(
name: "FK_SongSuggestions_Users_UserId",
table: "SongSuggestions",
column: "UserId",
principalTable: "Users",
principalColumn: "UserId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_SongSuggestions_Songs_SongId",
table: "SongSuggestions");
migrationBuilder.DropForeignKey(
name: "FK_SongSuggestions_Users_UserId",
table: "SongSuggestions");
migrationBuilder.DropColumn(
name: "AssociationInProgress",
table: "Users");
migrationBuilder.DropColumn(
name: "LdapUserName",
table: "Users");
migrationBuilder.AlterColumn(
name: "SignalMemberId",
table: "Users",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn(
name: "NickName",
table: "Users",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn(
name: "Name",
table: "Users",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn(
name: "Title",
table: "SuggestionHelpers",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn(
name: "Description",
table: "SuggestionHelpers",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn(
name: "UserId",
table: "SongSuggestions",
type: "integer",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "integer",
oldNullable: true);
migrationBuilder.AlterColumn(
name: "SongId",
table: "SongSuggestions",
type: "integer",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "integer",
oldNullable: true);
migrationBuilder.AlterColumn(
name: "Url",
table: "Songs",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn(
name: "Name",
table: "Songs",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn(
name: "Artist",
table: "Songs",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_SongSuggestions_Songs_SongId",
table: "SongSuggestions",
column: "SongId",
principalTable: "Songs",
principalColumn: "SongId",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_SongSuggestions_Users_UserId",
table: "SongSuggestions",
column: "UserId",
principalTable: "Users",
principalColumn: "UserId",
onDelete: ReferentialAction.Cascade);
}
}
}