Wish and veckomeny fixes
This commit is contained in:
1349
Aberwyn/Migrations/20250921133610_AddMealWish.Designer.cs
generated
Normal file
1349
Aberwyn/Migrations/20250921133610_AddMealWish.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
53
Aberwyn/Migrations/20250921133610_AddMealWish.cs
Normal file
53
Aberwyn/Migrations/20250921133610_AddMealWish.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Aberwyn.Migrations
|
||||
{
|
||||
public partial class AddMealWish : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MealWishes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
Name = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Recipe = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LinkedMealId = table.Column<int>(type: "int", nullable: true),
|
||||
RequestedByUserId = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
IsArchived = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
IsImported = table.Column<bool>(type: "tinyint(1)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MealWishes", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_MealWishes_Meals_LinkedMealId",
|
||||
column: x => x.LinkedMealId,
|
||||
principalTable: "Meals",
|
||||
principalColumn: "Id");
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MealWishes_LinkedMealId",
|
||||
table: "MealWishes",
|
||||
column: "LinkedMealId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "MealWishes");
|
||||
}
|
||||
}
|
||||
}
|
||||
1359
Aberwyn/Migrations/20250921161413_AddMealWishUserRelation.Designer.cs
generated
Normal file
1359
Aberwyn/Migrations/20250921161413_AddMealWishUserRelation.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
56
Aberwyn/Migrations/20250921161413_AddMealWishUserRelation.cs
Normal file
56
Aberwyn/Migrations/20250921161413_AddMealWishUserRelation.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Aberwyn.Migrations
|
||||
{
|
||||
public partial class AddMealWishUserRelation : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "RequestedByUserId",
|
||||
table: "MealWishes",
|
||||
type: "varchar(255)",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "longtext")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MealWishes_RequestedByUserId",
|
||||
table: "MealWishes",
|
||||
column: "RequestedByUserId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_MealWishes_AspNetUsers_RequestedByUserId",
|
||||
table: "MealWishes",
|
||||
column: "RequestedByUserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_MealWishes_AspNetUsers_RequestedByUserId",
|
||||
table: "MealWishes");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_MealWishes_RequestedByUserId",
|
||||
table: "MealWishes");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "RequestedByUserId",
|
||||
table: "MealWishes",
|
||||
type: "longtext",
|
||||
nullable: false,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "varchar(255)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
}
|
||||
}
|
||||
}
|
||||
1362
Aberwyn/Migrations/20250921170530_AddDateToWeeklyMenu.Designer.cs
generated
Normal file
1362
Aberwyn/Migrations/20250921170530_AddDateToWeeklyMenu.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
27
Aberwyn/Migrations/20250921170530_AddDateToWeeklyMenu.cs
Normal file
27
Aberwyn/Migrations/20250921170530_AddDateToWeeklyMenu.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Aberwyn.Migrations
|
||||
{
|
||||
public partial class AddDateToWeeklyMenu : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "Date",
|
||||
table: "WeeklyMenu",
|
||||
type: "datetime(6)",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Date",
|
||||
table: "WeeklyMenu");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -484,6 +484,44 @@ namespace Aberwyn.Migrations
|
||||
b.ToTable("MealRatings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Aberwyn.Models.MealWish", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<bool>("IsArchived")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<bool>("IsImported")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<int?>("LinkedMealId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("Recipe")
|
||||
.HasColumnType("longtext");
|
||||
|
||||
b.Property<string>("RequestedByUserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("varchar(255)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LinkedMealId");
|
||||
|
||||
b.HasIndex("RequestedByUserId");
|
||||
|
||||
b.ToTable("MealWishes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Aberwyn.Models.PizzaOrder", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -719,6 +757,9 @@ namespace Aberwyn.Migrations
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("Date")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<int>("DayOfWeek")
|
||||
.HasColumnType("int");
|
||||
|
||||
@@ -1097,6 +1138,23 @@ namespace Aberwyn.Migrations
|
||||
b.Navigation("Meal");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Aberwyn.Models.MealWish", b =>
|
||||
{
|
||||
b.HasOne("Aberwyn.Models.Meal", "LinkedMeal")
|
||||
.WithMany()
|
||||
.HasForeignKey("LinkedMealId");
|
||||
|
||||
b.HasOne("Aberwyn.Models.ApplicationUser", "RequestedByUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("RequestedByUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LinkedMeal");
|
||||
|
||||
b.Navigation("RequestedByUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Aberwyn.Models.PushSubscriber", b =>
|
||||
{
|
||||
b.HasOne("Aberwyn.Models.PizzaOrder", "PizzaOrder")
|
||||
|
||||
Reference in New Issue
Block a user