using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Zentral.Infrastructure.Migrations { /// public partial class AddUserDashboardPreference : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "UserDashboardPreferences", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), UtenteId = table.Column(type: "INTEGER", nullable: false), LayoutJson = table.Column(type: "TEXT", nullable: false), CreatedAt = table.Column(type: "TEXT", nullable: true), CreatedBy = table.Column(type: "TEXT", nullable: true), UpdatedAt = table.Column(type: "TEXT", nullable: true), UpdatedBy = table.Column(type: "TEXT", nullable: true), CustomFieldsJson = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_UserDashboardPreferences", x => x.Id); table.ForeignKey( name: "FK_UserDashboardPreferences_Utenti_UtenteId", column: x => x.UtenteId, principalTable: "Utenti", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_UserDashboardPreferences_UtenteId", table: "UserDashboardPreferences", column: "UtenteId", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "UserDashboardPreferences"); } } }