♻️ refactored - removed ID from db

Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
haraldnilsen 2023-09-19 09:35:10 +02:00
parent 0fdc0e6af5
commit f19dda9a42
6 changed files with 21 additions and 49 deletions

View file

@ -10,7 +10,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace backend.Migrations
{
[DbContext(typeof(MovieDbContext))]
[Migration("20230918090830_V1__init")]
[Migration("20230919073410_V1__init")]
partial class V1__init
{
/// <inheritdoc />
@ -25,11 +25,8 @@ namespace backend.Migrations
modelBuilder.Entity("backend.MovieDB", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("imdbID")
.HasColumnType("text");
b.Property<string>("Poster")
.HasColumnType("text");
@ -43,10 +40,7 @@ namespace backend.Migrations
b.Property<string>("Year")
.HasColumnType("text");
b.Property<string>("imdbID")
.HasColumnType("text");
b.HasKey("Id");
b.HasKey("imdbID");
b.ToTable("Movies");
});

View file

@ -1,5 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
@ -15,17 +14,15 @@ namespace backend.Migrations
name: "Movies",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
imdbID = table.Column<string>(type: "text", nullable: false),
Title = table.Column<string>(type: "text", nullable: true),
Year = table.Column<string>(type: "text", nullable: true),
imdbID = table.Column<string>(type: "text", nullable: true),
Type = table.Column<string>(type: "text", nullable: true),
Poster = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Movies", x => x.Id);
table.PrimaryKey("PK_Movies", x => x.imdbID);
});
}

View file

@ -22,11 +22,8 @@ namespace backend.Migrations
modelBuilder.Entity("backend.MovieDB", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("imdbID")
.HasColumnType("text");
b.Property<string>("Poster")
.HasColumnType("text");
@ -40,10 +37,7 @@ namespace backend.Migrations
b.Property<string>("Year")
.HasColumnType("text");
b.Property<string>("imdbID")
.HasColumnType("text");
b.HasKey("Id");
b.HasKey("imdbID");
b.ToTable("Movies");
});