Revert "Adding Blocking to migrations"

This reverts commit c8934e53da.

Revert "Adding Blocking to migrations"

This reverts commit c8934e53da.
This commit is contained in:
2025-02-19 17:54:16 +01:00
parent c8eaf5eccf
commit 7226614b5c
4 changed files with 52 additions and 44 deletions

View File

@@ -12,8 +12,8 @@ using pointMaster.Data;
namespace pointMaster.Migrations namespace pointMaster.Migrations
{ {
[DbContext(typeof(DataContext))] [DbContext(typeof(DataContext))]
[Migration("20250212090035_Adding blockings")] [Migration("20241121135108_DateTime")]
partial class Addingblockings partial class DateTime
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -37,6 +37,7 @@ namespace pointMaster.Migrations
.HasColumnType("timestamp with time zone"); .HasColumnType("timestamp with time zone");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.HasKey("Id"); b.HasKey("Id");
@@ -59,9 +60,10 @@ namespace pointMaster.Migrations
.HasColumnType("timestamp with time zone"); .HasColumnType("timestamp with time zone");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.Property<int?>("PatruljeId") b.Property<int>("PatruljeId")
.HasColumnType("integer"); .HasColumnType("integer");
b.HasKey("Id"); b.HasKey("Id");
@@ -82,13 +84,13 @@ namespace pointMaster.Migrations
b.Property<DateTime?>("DateCreated") b.Property<DateTime?>("DateCreated")
.HasColumnType("timestamp with time zone"); .HasColumnType("timestamp with time zone");
b.Property<int?>("PatruljeId") b.Property<int>("PatruljeId")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<int>("Points") b.Property<int>("Points")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<int?>("PosterId") b.Property<int>("PosterId")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<int>("Turnout") b.Property<int>("Turnout")
@@ -111,22 +113,19 @@ namespace pointMaster.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("BlockPoint")
.HasColumnType("boolean");
b.Property<bool>("BlockTurnout")
.HasColumnType("boolean");
b.Property<DateTime?>("DateCreated") b.Property<DateTime?>("DateCreated")
.HasColumnType("timestamp with time zone"); .HasColumnType("timestamp with time zone");
b.Property<string>("Description") b.Property<string>("Description")
.IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("Location") b.Property<string>("Location")
.IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.HasKey("Id"); b.HasKey("Id");
@@ -138,7 +137,9 @@ namespace pointMaster.Migrations
{ {
b.HasOne("pointMaster.Models.Patrulje", "Patrulje") b.HasOne("pointMaster.Models.Patrulje", "Patrulje")
.WithMany("PatruljeMedlems") .WithMany("PatruljeMedlems")
.HasForeignKey("PatruljeId"); .HasForeignKey("PatruljeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Patrulje"); b.Navigation("Patrulje");
}); });
@@ -147,11 +148,15 @@ namespace pointMaster.Migrations
{ {
b.HasOne("pointMaster.Models.Patrulje", "Patrulje") b.HasOne("pointMaster.Models.Patrulje", "Patrulje")
.WithMany("Points") .WithMany("Points")
.HasForeignKey("PatruljeId"); .HasForeignKey("PatruljeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("pointMaster.Models.Post", "Poster") b.HasOne("pointMaster.Models.Post", "Poster")
.WithMany() .WithMany()
.HasForeignKey("PosterId"); .HasForeignKey("PosterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Patrulje"); b.Navigation("Patrulje");

View File

@@ -1,5 +1,4 @@
using System; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable #nullable disable
@@ -7,7 +6,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace pointMaster.Migrations namespace pointMaster.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class Addingblockings : Migration public partial class DateTime : Migration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
@@ -18,7 +17,7 @@ namespace pointMaster.Migrations
{ {
Id = table.Column<int>(type: "integer", nullable: false) Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: true), Name = table.Column<string>(type: "text", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true) DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
}, },
constraints: table => constraints: table =>
@@ -32,11 +31,9 @@ namespace pointMaster.Migrations
{ {
Id = table.Column<int>(type: "integer", nullable: false) Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: true), Name = table.Column<string>(type: "text", nullable: false),
Location = table.Column<string>(type: "text", nullable: true), Location = table.Column<string>(type: "text", nullable: false),
Description = table.Column<string>(type: "text", nullable: true), Description = table.Column<string>(type: "text", nullable: false),
BlockPoint = table.Column<bool>(type: "boolean", nullable: false),
BlockTurnout = table.Column<bool>(type: "boolean", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true) DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
}, },
constraints: table => constraints: table =>
@@ -50,9 +47,9 @@ namespace pointMaster.Migrations
{ {
Id = table.Column<int>(type: "integer", nullable: false) Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: true), Name = table.Column<string>(type: "text", nullable: false),
Age = table.Column<int>(type: "integer", nullable: false), Age = table.Column<int>(type: "integer", nullable: false),
PatruljeId = table.Column<int>(type: "integer", nullable: true), PatruljeId = table.Column<int>(type: "integer", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true) DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
}, },
constraints: table => constraints: table =>
@@ -62,7 +59,8 @@ namespace pointMaster.Migrations
name: "FK_PatruljeMedlemmer_Patruljer_PatruljeId", name: "FK_PatruljeMedlemmer_Patruljer_PatruljeId",
column: x => x.PatruljeId, column: x => x.PatruljeId,
principalTable: "Patruljer", principalTable: "Patruljer",
principalColumn: "Id"); principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
@@ -73,8 +71,8 @@ namespace pointMaster.Migrations
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Points = table.Column<int>(type: "integer", nullable: false), Points = table.Column<int>(type: "integer", nullable: false),
Turnout = table.Column<int>(type: "integer", nullable: false), Turnout = table.Column<int>(type: "integer", nullable: false),
PatruljeId = table.Column<int>(type: "integer", nullable: true), PatruljeId = table.Column<int>(type: "integer", nullable: false),
PosterId = table.Column<int>(type: "integer", nullable: true), PosterId = table.Column<int>(type: "integer", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true) DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
}, },
constraints: table => constraints: table =>
@@ -84,12 +82,14 @@ namespace pointMaster.Migrations
name: "FK_Points_Patruljer_PatruljeId", name: "FK_Points_Patruljer_PatruljeId",
column: x => x.PatruljeId, column: x => x.PatruljeId,
principalTable: "Patruljer", principalTable: "Patruljer",
principalColumn: "Id"); principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey( table.ForeignKey(
name: "FK_Points_Poster_PosterId", name: "FK_Points_Poster_PosterId",
column: x => x.PosterId, column: x => x.PosterId,
principalTable: "Poster", principalTable: "Poster",
principalColumn: "Id"); principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}); });
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(

View File

@@ -34,6 +34,7 @@ namespace pointMaster.Migrations
.HasColumnType("timestamp with time zone"); .HasColumnType("timestamp with time zone");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.HasKey("Id"); b.HasKey("Id");
@@ -56,9 +57,10 @@ namespace pointMaster.Migrations
.HasColumnType("timestamp with time zone"); .HasColumnType("timestamp with time zone");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.Property<int?>("PatruljeId") b.Property<int>("PatruljeId")
.HasColumnType("integer"); .HasColumnType("integer");
b.HasKey("Id"); b.HasKey("Id");
@@ -79,13 +81,13 @@ namespace pointMaster.Migrations
b.Property<DateTime?>("DateCreated") b.Property<DateTime?>("DateCreated")
.HasColumnType("timestamp with time zone"); .HasColumnType("timestamp with time zone");
b.Property<int?>("PatruljeId") b.Property<int>("PatruljeId")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<int>("Points") b.Property<int>("Points")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<int?>("PosterId") b.Property<int>("PosterId")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<int>("Turnout") b.Property<int>("Turnout")
@@ -108,22 +110,19 @@ namespace pointMaster.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("BlockPoint")
.HasColumnType("boolean");
b.Property<bool>("BlockTurnout")
.HasColumnType("boolean");
b.Property<DateTime?>("DateCreated") b.Property<DateTime?>("DateCreated")
.HasColumnType("timestamp with time zone"); .HasColumnType("timestamp with time zone");
b.Property<string>("Description") b.Property<string>("Description")
.IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("Location") b.Property<string>("Location")
.IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired()
.HasColumnType("text"); .HasColumnType("text");
b.HasKey("Id"); b.HasKey("Id");
@@ -135,7 +134,9 @@ namespace pointMaster.Migrations
{ {
b.HasOne("pointMaster.Models.Patrulje", "Patrulje") b.HasOne("pointMaster.Models.Patrulje", "Patrulje")
.WithMany("PatruljeMedlems") .WithMany("PatruljeMedlems")
.HasForeignKey("PatruljeId"); .HasForeignKey("PatruljeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Patrulje"); b.Navigation("Patrulje");
}); });
@@ -144,11 +145,15 @@ namespace pointMaster.Migrations
{ {
b.HasOne("pointMaster.Models.Patrulje", "Patrulje") b.HasOne("pointMaster.Models.Patrulje", "Patrulje")
.WithMany("Points") .WithMany("Points")
.HasForeignKey("PatruljeId"); .HasForeignKey("PatruljeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("pointMaster.Models.Post", "Poster") b.HasOne("pointMaster.Models.Post", "Poster")
.WithMany() .WithMany()
.HasForeignKey("PosterId"); .HasForeignKey("PosterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Patrulje"); b.Navigation("Patrulje");

View File

@@ -6,8 +6,6 @@
public string Name { get; set; } public string Name { get; set; }
public string Location { get; set; } public string Location { get; set; }
public string Description { get; set; } public string Description { get; set; }
public bool BlockPoint { get; set; }
public bool BlockTurnout { get; set; }
public DateTime? DateCreated { get; set; } public DateTime? DateCreated { get; set; }
} }
} }