diff options
Diffstat (limited to 'backend/Elements.Data/Migrations')
| -rw-r--r-- | backend/Elements.Data/Migrations/20231022191811_Initial.Designer.cs | 289 | ||||
| -rw-r--r-- | backend/Elements.Data/Migrations/20231024192803_Add creation dates.cs | 201 | ||||
| -rw-r--r-- | backend/Elements.Data/Migrations/20231028175352_Initial.Designer.cs (renamed from backend/Elements.Data/Migrations/20231024192803_Add creation dates.Designer.cs) | 77 | ||||
| -rw-r--r-- | backend/Elements.Data/Migrations/20231028175352_Initial.cs (renamed from backend/Elements.Data/Migrations/20231022191811_Initial.cs) | 91 | ||||
| -rw-r--r-- | backend/Elements.Data/Migrations/ApplicationDbContextModelSnapshot.cs | 73 |
5 files changed, 137 insertions, 594 deletions
diff --git a/backend/Elements.Data/Migrations/20231022191811_Initial.Designer.cs b/backend/Elements.Data/Migrations/20231022191811_Initial.Designer.cs deleted file mode 100644 index 72f90f1..0000000 --- a/backend/Elements.Data/Migrations/20231022191811_Initial.Designer.cs +++ /dev/null @@ -1,289 +0,0 @@ -// <auto-generated /> -using System; -using Elements.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Elements.Data.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20231022191811_Initial")] - partial class Initial - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.12"); - - modelBuilder.Entity("Elements.Data.Models.Element", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<byte[]>("IconPng") - .IsRequired() - .HasColumnType("BLOB"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("State") - .HasColumnType("INTEGER"); - - b.Property<int>("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("Elements"); - - b.HasData( - new - { - Id = 1, - IconPng = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 249, 95, 224, 252, 159, 129, 2, 192, 194, 64, 33, 24, 53, 96, 212, 128, 81, 3, 6, 139, 1, 0, 119, 65, 2, 242, 233, 108, 215, 141, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, - Name = "Fire", - State = 1, - UserId = 1 - }, - new - { - Id = 2, - IconPng = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 81, 156, 246, 249, 63, 3, 5, 128, 133, 129, 66, 48, 106, 192, 168, 1, 163, 6, 12, 22, 3, 0, 85, 67, 2, 234, 36, 203, 134, 16, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, - Name = "Water", - State = 1, - UserId = 1 - }, - new - { - Id = 3, - IconPng = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 30, 73, 68, 65, 84, 120, 156, 99, 217, 125, 239, 247, 127, 6, 10, 0, 11, 3, 133, 96, 212, 128, 81, 3, 70, 13, 24, 44, 6, 0, 0, 10, 221, 3, 212, 197, 89, 182, 174, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, - Name = "Air", - State = 1, - UserId = 1 - }, - new - { - Id = 4, - IconPng = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 137, 117, 48, 255, 207, 64, 1, 96, 97, 160, 16, 140, 26, 48, 106, 192, 168, 1, 131, 197, 0, 0, 242, 75, 2, 20, 1, 55, 196, 168, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, - Name = "Ground", - State = 1, - UserId = 1 - }); - }); - - modelBuilder.Entity("Elements.Data.Models.Recipe", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("FirstIngredientId") - .HasColumnType("INTEGER"); - - b.Property<int>("ResultId") - .HasColumnType("INTEGER"); - - b.Property<int>("SecondIngredientId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("FirstIngredientId"); - - b.HasIndex("ResultId"); - - b.HasIndex("SecondIngredientId"); - - b.ToTable("Recipes"); - }); - - modelBuilder.Entity("Elements.Data.Models.Suggestion", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("FirstElementId") - .HasColumnType("INTEGER"); - - b.Property<byte[]>("Icon") - .IsRequired() - .HasColumnType("BLOB"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("SecondElementId") - .HasColumnType("INTEGER"); - - b.Property<int>("UserId") - .HasColumnType("INTEGER"); - - b.Property<DateTime>("VotingEnd") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("FirstElementId"); - - b.HasIndex("SecondElementId"); - - b.HasIndex("UserId"); - - b.ToTable("Suggestions"); - }); - - modelBuilder.Entity("Elements.Data.Models.User", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("GoogleId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Users"); - - b.HasData( - new - { - Id = 1, - GoogleId = "", - Name = "Elements" - }); - }); - - modelBuilder.Entity("Elements.Data.Models.Vote", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("SuggestionId") - .HasColumnType("INTEGER"); - - b.Property<int>("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("SuggestionId"); - - b.HasIndex("UserId"); - - b.ToTable("Votes"); - }); - - modelBuilder.Entity("Elements.Data.Models.Element", b => - { - b.HasOne("Elements.Data.Models.User", "User") - .WithMany("Elements") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Elements.Data.Models.Recipe", b => - { - b.HasOne("Elements.Data.Models.Element", "FirstIngredient") - .WithMany() - .HasForeignKey("FirstIngredientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Elements.Data.Models.Element", "Result") - .WithMany() - .HasForeignKey("ResultId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Elements.Data.Models.Element", "SecondIngredient") - .WithMany() - .HasForeignKey("SecondIngredientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("FirstIngredient"); - - b.Navigation("Result"); - - b.Navigation("SecondIngredient"); - }); - - modelBuilder.Entity("Elements.Data.Models.Suggestion", b => - { - b.HasOne("Elements.Data.Models.Element", "FirstElement") - .WithMany() - .HasForeignKey("FirstElementId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Elements.Data.Models.Element", "SecondElement") - .WithMany() - .HasForeignKey("SecondElementId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Elements.Data.Models.User", null) - .WithMany("Suggestions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("FirstElement"); - - b.Navigation("SecondElement"); - }); - - modelBuilder.Entity("Elements.Data.Models.Vote", b => - { - b.HasOne("Elements.Data.Models.Suggestion", null) - .WithMany("Votes") - .HasForeignKey("SuggestionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Elements.Data.Models.User", null) - .WithMany("Votes") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Elements.Data.Models.Suggestion", b => - { - b.Navigation("Votes"); - }); - - modelBuilder.Entity("Elements.Data.Models.User", b => - { - b.Navigation("Elements"); - - b.Navigation("Suggestions"); - - b.Navigation("Votes"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/backend/Elements.Data/Migrations/20231024192803_Add creation dates.cs b/backend/Elements.Data/Migrations/20231024192803_Add creation dates.cs deleted file mode 100644 index 3612108..0000000 --- a/backend/Elements.Data/Migrations/20231024192803_Add creation dates.cs +++ /dev/null @@ -1,201 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Elements.Data.Migrations -{ - /// <inheritdoc /> - public partial class Addcreationdates : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Recipes_Elements_FirstIngredientId", - table: "Recipes"); - - migrationBuilder.DropForeignKey( - name: "FK_Recipes_Elements_ResultId", - table: "Recipes"); - - migrationBuilder.DropForeignKey( - name: "FK_Recipes_Elements_SecondIngredientId", - table: "Recipes"); - - migrationBuilder.RenameColumn( - name: "SecondIngredientId", - table: "Recipes", - newName: "SecondElementId"); - - migrationBuilder.RenameColumn( - name: "ResultId", - table: "Recipes", - newName: "ResultElementId"); - - migrationBuilder.RenameColumn( - name: "FirstIngredientId", - table: "Recipes", - newName: "FirstElementId"); - - migrationBuilder.RenameIndex( - name: "IX_Recipes_SecondIngredientId", - table: "Recipes", - newName: "IX_Recipes_SecondElementId"); - - migrationBuilder.RenameIndex( - name: "IX_Recipes_ResultId", - table: "Recipes", - newName: "IX_Recipes_ResultElementId"); - - migrationBuilder.RenameIndex( - name: "IX_Recipes_FirstIngredientId", - table: "Recipes", - newName: "IX_Recipes_FirstElementId"); - - migrationBuilder.AddColumn<DateTime>( - name: "CreationDate", - table: "Suggestions", - type: "TEXT", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn<DateTime>( - name: "CreationDate", - table: "Elements", - type: "TEXT", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.UpdateData( - table: "Elements", - keyColumn: "Id", - keyValue: 1, - column: "CreationDate", - value: new DateTime(2023, 10, 24, 19, 28, 3, 290, DateTimeKind.Utc).AddTicks(1750)); - - migrationBuilder.UpdateData( - table: "Elements", - keyColumn: "Id", - keyValue: 2, - column: "CreationDate", - value: new DateTime(2023, 10, 24, 19, 28, 3, 290, DateTimeKind.Utc).AddTicks(2880)); - - migrationBuilder.UpdateData( - table: "Elements", - keyColumn: "Id", - keyValue: 3, - column: "CreationDate", - value: new DateTime(2023, 10, 24, 19, 28, 3, 290, DateTimeKind.Utc).AddTicks(3350)); - - migrationBuilder.UpdateData( - table: "Elements", - keyColumn: "Id", - keyValue: 4, - column: "CreationDate", - value: new DateTime(2023, 10, 24, 19, 28, 3, 290, DateTimeKind.Utc).AddTicks(3790)); - - migrationBuilder.AddForeignKey( - name: "FK_Recipes_Elements_FirstElementId", - table: "Recipes", - column: "FirstElementId", - principalTable: "Elements", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Recipes_Elements_ResultElementId", - table: "Recipes", - column: "ResultElementId", - principalTable: "Elements", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Recipes_Elements_SecondElementId", - table: "Recipes", - column: "SecondElementId", - principalTable: "Elements", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Recipes_Elements_FirstElementId", - table: "Recipes"); - - migrationBuilder.DropForeignKey( - name: "FK_Recipes_Elements_ResultElementId", - table: "Recipes"); - - migrationBuilder.DropForeignKey( - name: "FK_Recipes_Elements_SecondElementId", - table: "Recipes"); - - migrationBuilder.DropColumn( - name: "CreationDate", - table: "Suggestions"); - - migrationBuilder.DropColumn( - name: "CreationDate", - table: "Elements"); - - migrationBuilder.RenameColumn( - name: "SecondElementId", - table: "Recipes", - newName: "SecondIngredientId"); - - migrationBuilder.RenameColumn( - name: "ResultElementId", - table: "Recipes", - newName: "ResultId"); - - migrationBuilder.RenameColumn( - name: "FirstElementId", - table: "Recipes", - newName: "FirstIngredientId"); - - migrationBuilder.RenameIndex( - name: "IX_Recipes_SecondElementId", - table: "Recipes", - newName: "IX_Recipes_SecondIngredientId"); - - migrationBuilder.RenameIndex( - name: "IX_Recipes_ResultElementId", - table: "Recipes", - newName: "IX_Recipes_ResultId"); - - migrationBuilder.RenameIndex( - name: "IX_Recipes_FirstElementId", - table: "Recipes", - newName: "IX_Recipes_FirstIngredientId"); - - migrationBuilder.AddForeignKey( - name: "FK_Recipes_Elements_FirstIngredientId", - table: "Recipes", - column: "FirstIngredientId", - principalTable: "Elements", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Recipes_Elements_ResultId", - table: "Recipes", - column: "ResultId", - principalTable: "Elements", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Recipes_Elements_SecondIngredientId", - table: "Recipes", - column: "SecondIngredientId", - principalTable: "Elements", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/backend/Elements.Data/Migrations/20231024192803_Add creation dates.Designer.cs b/backend/Elements.Data/Migrations/20231028175352_Initial.Designer.cs index ae7fa06..fbd1dbd 100644 --- a/backend/Elements.Data/Migrations/20231024192803_Add creation dates.Designer.cs +++ b/backend/Elements.Data/Migrations/20231028175352_Initial.Designer.cs @@ -5,43 +5,50 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Elements.Data.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("20231024192803_Add creation dates")] - partial class Addcreationdates + [Migration("20231028175352_Initial")] + partial class Initial { /// <inheritdoc /> protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.12"); + modelBuilder + .HasAnnotation("ProductVersion", "7.0.12") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("Elements.Data.Models.Element", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); b.Property<DateTime>("CreationDate") - .HasColumnType("TEXT"); + .HasColumnType("timestamp with time zone"); b.Property<byte[]>("IconPng") .IsRequired() - .HasColumnType("BLOB"); + .HasColumnType("bytea"); b.Property<string>("Name") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("text"); b.Property<int>("State") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<int>("UserId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -53,7 +60,7 @@ namespace Elements.Data.Migrations new { Id = 1, - CreationDate = new DateTime(2023, 10, 24, 19, 28, 3, 290, DateTimeKind.Utc).AddTicks(1750), + CreationDate = new DateTime(2023, 10, 28, 17, 53, 52, 688, DateTimeKind.Utc).AddTicks(9070), IconPng = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 249, 95, 224, 252, 159, 129, 2, 192, 194, 64, 33, 24, 53, 96, 212, 128, 81, 3, 6, 139, 1, 0, 119, 65, 2, 242, 233, 108, 215, 141, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, Name = "Fire", State = 1, @@ -62,7 +69,7 @@ namespace Elements.Data.Migrations new { Id = 2, - CreationDate = new DateTime(2023, 10, 24, 19, 28, 3, 290, DateTimeKind.Utc).AddTicks(2880), + CreationDate = new DateTime(2023, 10, 28, 17, 53, 52, 689, DateTimeKind.Utc).AddTicks(230), IconPng = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 81, 156, 246, 249, 63, 3, 5, 128, 133, 129, 66, 48, 106, 192, 168, 1, 163, 6, 12, 22, 3, 0, 85, 67, 2, 234, 36, 203, 134, 16, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, Name = "Water", State = 1, @@ -71,7 +78,7 @@ namespace Elements.Data.Migrations new { Id = 3, - CreationDate = new DateTime(2023, 10, 24, 19, 28, 3, 290, DateTimeKind.Utc).AddTicks(3350), + CreationDate = new DateTime(2023, 10, 28, 17, 53, 52, 689, DateTimeKind.Utc).AddTicks(720), IconPng = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 30, 73, 68, 65, 84, 120, 156, 99, 217, 125, 239, 247, 127, 6, 10, 0, 11, 3, 133, 96, 212, 128, 81, 3, 70, 13, 24, 44, 6, 0, 0, 10, 221, 3, 212, 197, 89, 182, 174, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, Name = "Air", State = 1, @@ -80,7 +87,7 @@ namespace Elements.Data.Migrations new { Id = 4, - CreationDate = new DateTime(2023, 10, 24, 19, 28, 3, 290, DateTimeKind.Utc).AddTicks(3790), + CreationDate = new DateTime(2023, 10, 28, 17, 53, 52, 689, DateTimeKind.Utc).AddTicks(1160), IconPng = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 137, 117, 48, 255, 207, 64, 1, 96, 97, 160, 16, 140, 26, 48, 106, 192, 168, 1, 131, 197, 0, 0, 242, 75, 2, 20, 1, 55, 196, 168, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, Name = "Ground", State = 1, @@ -92,16 +99,18 @@ namespace Elements.Data.Migrations { b.Property<int>("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); b.Property<int>("FirstElementId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<int>("ResultElementId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<int>("SecondElementId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -118,30 +127,32 @@ namespace Elements.Data.Migrations { b.Property<int>("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); b.Property<DateTime>("CreationDate") - .HasColumnType("TEXT"); + .HasColumnType("timestamp with time zone"); b.Property<int>("FirstElementId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<byte[]>("Icon") .IsRequired() - .HasColumnType("BLOB"); + .HasColumnType("bytea"); b.Property<string>("Name") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("text"); b.Property<int>("SecondElementId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<int>("UserId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<DateTime>("VotingEnd") - .HasColumnType("TEXT"); + .HasColumnType("timestamp with time zone"); b.HasKey("Id"); @@ -158,15 +169,17 @@ namespace Elements.Data.Migrations { b.Property<int>("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); b.Property<string>("GoogleId") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("text"); b.Property<string>("Name") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("text"); b.HasKey("Id"); @@ -185,13 +198,15 @@ namespace Elements.Data.Migrations { b.Property<int>("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); b.Property<int>("SuggestionId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<int>("UserId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.HasKey("Id"); diff --git a/backend/Elements.Data/Migrations/20231022191811_Initial.cs b/backend/Elements.Data/Migrations/20231028175352_Initial.cs index 5885c27..1169982 100644 --- a/backend/Elements.Data/Migrations/20231022191811_Initial.cs +++ b/backend/Elements.Data/Migrations/20231028175352_Initial.cs @@ -1,5 +1,6 @@ using System; using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable @@ -17,10 +18,10 @@ namespace Elements.Data.Migrations name: "Users", columns: table => new { - Id = table.Column<int>(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - GoogleId = table.Column<string>(type: "TEXT", nullable: false), - Name = table.Column<string>(type: "TEXT", nullable: false) + Id = table.Column<int>(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + GoogleId = table.Column<string>(type: "text", nullable: false), + Name = table.Column<string>(type: "text", nullable: false) }, constraints: table => { @@ -31,12 +32,13 @@ namespace Elements.Data.Migrations name: "Elements", columns: table => new { - Id = table.Column<int>(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - UserId = table.Column<int>(type: "INTEGER", nullable: false), - Name = table.Column<string>(type: "TEXT", nullable: false), - State = table.Column<int>(type: "INTEGER", nullable: false), - IconPng = table.Column<byte[]>(type: "BLOB", nullable: false) + Id = table.Column<int>(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CreationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), + UserId = table.Column<int>(type: "integer", nullable: false), + Name = table.Column<string>(type: "text", nullable: false), + State = table.Column<int>(type: "integer", nullable: false), + IconPng = table.Column<byte[]>(type: "bytea", nullable: false) }, constraints: table => { @@ -53,30 +55,30 @@ namespace Elements.Data.Migrations name: "Recipes", columns: table => new { - Id = table.Column<int>(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - FirstIngredientId = table.Column<int>(type: "INTEGER", nullable: false), - SecondIngredientId = table.Column<int>(type: "INTEGER", nullable: false), - ResultId = table.Column<int>(type: "INTEGER", nullable: false) + Id = table.Column<int>(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + FirstElementId = table.Column<int>(type: "integer", nullable: false), + SecondElementId = table.Column<int>(type: "integer", nullable: false), + ResultElementId = table.Column<int>(type: "integer", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Recipes", x => x.Id); table.ForeignKey( - name: "FK_Recipes_Elements_FirstIngredientId", - column: x => x.FirstIngredientId, + name: "FK_Recipes_Elements_FirstElementId", + column: x => x.FirstElementId, principalTable: "Elements", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_Recipes_Elements_ResultId", - column: x => x.ResultId, + name: "FK_Recipes_Elements_ResultElementId", + column: x => x.ResultElementId, principalTable: "Elements", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_Recipes_Elements_SecondIngredientId", - column: x => x.SecondIngredientId, + name: "FK_Recipes_Elements_SecondElementId", + column: x => x.SecondElementId, principalTable: "Elements", principalColumn: "Id", onDelete: ReferentialAction.Cascade); @@ -86,14 +88,15 @@ namespace Elements.Data.Migrations name: "Suggestions", columns: table => new { - Id = table.Column<int>(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Name = table.Column<string>(type: "TEXT", nullable: false), - Icon = table.Column<byte[]>(type: "BLOB", nullable: false), - FirstElementId = table.Column<int>(type: "INTEGER", nullable: false), - SecondElementId = table.Column<int>(type: "INTEGER", nullable: false), - VotingEnd = table.Column<DateTime>(type: "TEXT", nullable: false), - UserId = table.Column<int>(type: "INTEGER", nullable: false) + Id = table.Column<int>(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CreationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), + Name = table.Column<string>(type: "text", nullable: false), + Icon = table.Column<byte[]>(type: "bytea", nullable: false), + FirstElementId = table.Column<int>(type: "integer", nullable: false), + SecondElementId = table.Column<int>(type: "integer", nullable: false), + VotingEnd = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), + UserId = table.Column<int>(type: "integer", nullable: false) }, constraints: table => { @@ -122,10 +125,10 @@ namespace Elements.Data.Migrations name: "Votes", columns: table => new { - Id = table.Column<int>(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - UserId = table.Column<int>(type: "INTEGER", nullable: false), - SuggestionId = table.Column<int>(type: "INTEGER", nullable: false) + Id = table.Column<int>(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column<int>(type: "integer", nullable: false), + SuggestionId = table.Column<int>(type: "integer", nullable: false) }, constraints: table => { @@ -151,13 +154,13 @@ namespace Elements.Data.Migrations migrationBuilder.InsertData( table: "Elements", - columns: new[] { "Id", "IconPng", "Name", "State", "UserId" }, + columns: new[] { "Id", "CreationDate", "IconPng", "Name", "State", "UserId" }, values: new object[,] { - { 1, new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 249, 95, 224, 252, 159, 129, 2, 192, 194, 64, 33, 24, 53, 96, 212, 128, 81, 3, 6, 139, 1, 0, 119, 65, 2, 242, 233, 108, 215, 141, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, "Fire", 1, 1 }, - { 2, new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 81, 156, 246, 249, 63, 3, 5, 128, 133, 129, 66, 48, 106, 192, 168, 1, 163, 6, 12, 22, 3, 0, 85, 67, 2, 234, 36, 203, 134, 16, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, "Water", 1, 1 }, - { 3, new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 30, 73, 68, 65, 84, 120, 156, 99, 217, 125, 239, 247, 127, 6, 10, 0, 11, 3, 133, 96, 212, 128, 81, 3, 70, 13, 24, 44, 6, 0, 0, 10, 221, 3, 212, 197, 89, 182, 174, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, "Air", 1, 1 }, - { 4, new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 137, 117, 48, 255, 207, 64, 1, 96, 97, 160, 16, 140, 26, 48, 106, 192, 168, 1, 131, 197, 0, 0, 242, 75, 2, 20, 1, 55, 196, 168, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, "Ground", 1, 1 } + { 1, new DateTime(2023, 10, 28, 17, 53, 52, 688, DateTimeKind.Utc).AddTicks(9070), new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 249, 95, 224, 252, 159, 129, 2, 192, 194, 64, 33, 24, 53, 96, 212, 128, 81, 3, 6, 139, 1, 0, 119, 65, 2, 242, 233, 108, 215, 141, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, "Fire", 1, 1 }, + { 2, new DateTime(2023, 10, 28, 17, 53, 52, 689, DateTimeKind.Utc).AddTicks(230), new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 81, 156, 246, 249, 63, 3, 5, 128, 133, 129, 66, 48, 106, 192, 168, 1, 163, 6, 12, 22, 3, 0, 85, 67, 2, 234, 36, 203, 134, 16, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, "Water", 1, 1 }, + { 3, new DateTime(2023, 10, 28, 17, 53, 52, 689, DateTimeKind.Utc).AddTicks(720), new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 30, 73, 68, 65, 84, 120, 156, 99, 217, 125, 239, 247, 127, 6, 10, 0, 11, 3, 133, 96, 212, 128, 81, 3, 70, 13, 24, 44, 6, 0, 0, 10, 221, 3, 212, 197, 89, 182, 174, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, "Air", 1, 1 }, + { 4, new DateTime(2023, 10, 28, 17, 53, 52, 689, DateTimeKind.Utc).AddTicks(1160), new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 137, 117, 48, 255, 207, 64, 1, 96, 97, 160, 16, 140, 26, 48, 106, 192, 168, 1, 131, 197, 0, 0, 242, 75, 2, 20, 1, 55, 196, 168, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, "Ground", 1, 1 } }); migrationBuilder.CreateIndex( @@ -166,19 +169,19 @@ namespace Elements.Data.Migrations column: "UserId"); migrationBuilder.CreateIndex( - name: "IX_Recipes_FirstIngredientId", + name: "IX_Recipes_FirstElementId", table: "Recipes", - column: "FirstIngredientId"); + column: "FirstElementId"); migrationBuilder.CreateIndex( - name: "IX_Recipes_ResultId", + name: "IX_Recipes_ResultElementId", table: "Recipes", - column: "ResultId"); + column: "ResultElementId"); migrationBuilder.CreateIndex( - name: "IX_Recipes_SecondIngredientId", + name: "IX_Recipes_SecondElementId", table: "Recipes", - column: "SecondIngredientId"); + column: "SecondElementId"); migrationBuilder.CreateIndex( name: "IX_Suggestions_FirstElementId", diff --git a/backend/Elements.Data/Migrations/ApplicationDbContextModelSnapshot.cs b/backend/Elements.Data/Migrations/ApplicationDbContextModelSnapshot.cs index 7b88425..779ed10 100644 --- a/backend/Elements.Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/backend/Elements.Data/Migrations/ApplicationDbContextModelSnapshot.cs @@ -4,6 +4,7 @@ using Elements.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable @@ -15,30 +16,36 @@ namespace Elements.Data.Migrations protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.12"); + modelBuilder + .HasAnnotation("ProductVersion", "7.0.12") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("Elements.Data.Models.Element", b => { b.Property<int>("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); b.Property<DateTime>("CreationDate") - .HasColumnType("TEXT"); + .HasColumnType("timestamp with time zone"); b.Property<byte[]>("IconPng") .IsRequired() - .HasColumnType("BLOB"); + .HasColumnType("bytea"); b.Property<string>("Name") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("text"); b.Property<int>("State") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<int>("UserId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -50,7 +57,7 @@ namespace Elements.Data.Migrations new { Id = 1, - CreationDate = new DateTime(2023, 10, 24, 19, 28, 3, 290, DateTimeKind.Utc).AddTicks(1750), + CreationDate = new DateTime(2023, 10, 28, 17, 53, 52, 688, DateTimeKind.Utc).AddTicks(9070), IconPng = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 249, 95, 224, 252, 159, 129, 2, 192, 194, 64, 33, 24, 53, 96, 212, 128, 81, 3, 6, 139, 1, 0, 119, 65, 2, 242, 233, 108, 215, 141, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, Name = "Fire", State = 1, @@ -59,7 +66,7 @@ namespace Elements.Data.Migrations new { Id = 2, - CreationDate = new DateTime(2023, 10, 24, 19, 28, 3, 290, DateTimeKind.Utc).AddTicks(2880), + CreationDate = new DateTime(2023, 10, 28, 17, 53, 52, 689, DateTimeKind.Utc).AddTicks(230), IconPng = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 81, 156, 246, 249, 63, 3, 5, 128, 133, 129, 66, 48, 106, 192, 168, 1, 163, 6, 12, 22, 3, 0, 85, 67, 2, 234, 36, 203, 134, 16, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, Name = "Water", State = 1, @@ -68,7 +75,7 @@ namespace Elements.Data.Migrations new { Id = 3, - CreationDate = new DateTime(2023, 10, 24, 19, 28, 3, 290, DateTimeKind.Utc).AddTicks(3350), + CreationDate = new DateTime(2023, 10, 28, 17, 53, 52, 689, DateTimeKind.Utc).AddTicks(720), IconPng = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 30, 73, 68, 65, 84, 120, 156, 99, 217, 125, 239, 247, 127, 6, 10, 0, 11, 3, 133, 96, 212, 128, 81, 3, 70, 13, 24, 44, 6, 0, 0, 10, 221, 3, 212, 197, 89, 182, 174, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, Name = "Air", State = 1, @@ -77,7 +84,7 @@ namespace Elements.Data.Migrations new { Id = 4, - CreationDate = new DateTime(2023, 10, 24, 19, 28, 3, 290, DateTimeKind.Utc).AddTicks(3790), + CreationDate = new DateTime(2023, 10, 28, 17, 53, 52, 689, DateTimeKind.Utc).AddTicks(1160), IconPng = new byte[] { 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 16, 0, 0, 0, 16, 8, 6, 0, 0, 0, 31, 243, 255, 97, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 29, 73, 68, 65, 84, 120, 156, 99, 137, 117, 48, 255, 207, 64, 1, 96, 97, 160, 16, 140, 26, 48, 106, 192, 168, 1, 131, 197, 0, 0, 242, 75, 2, 20, 1, 55, 196, 168, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130 }, Name = "Ground", State = 1, @@ -89,16 +96,18 @@ namespace Elements.Data.Migrations { b.Property<int>("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); b.Property<int>("FirstElementId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<int>("ResultElementId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<int>("SecondElementId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -115,30 +124,32 @@ namespace Elements.Data.Migrations { b.Property<int>("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); b.Property<DateTime>("CreationDate") - .HasColumnType("TEXT"); + .HasColumnType("timestamp with time zone"); b.Property<int>("FirstElementId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<byte[]>("Icon") .IsRequired() - .HasColumnType("BLOB"); + .HasColumnType("bytea"); b.Property<string>("Name") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("text"); b.Property<int>("SecondElementId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<int>("UserId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<DateTime>("VotingEnd") - .HasColumnType("TEXT"); + .HasColumnType("timestamp with time zone"); b.HasKey("Id"); @@ -155,15 +166,17 @@ namespace Elements.Data.Migrations { b.Property<int>("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); b.Property<string>("GoogleId") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("text"); b.Property<string>("Name") .IsRequired() - .HasColumnType("TEXT"); + .HasColumnType("text"); b.HasKey("Id"); @@ -182,13 +195,15 @@ namespace Elements.Data.Migrations { b.Property<int>("Id") .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); b.Property<int>("SuggestionId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.Property<int>("UserId") - .HasColumnType("INTEGER"); + .HasColumnType("integer"); b.HasKey("Id"); |
