Basic search outline config UI implemented.
This commit is contained in:
@@ -17,7 +17,7 @@ namespace Props.Data
|
||||
{
|
||||
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
||||
{
|
||||
public DbSet<QueryWordInfo> Keywords { get; set; }
|
||||
public DbSet<QueryWordInfo> QueryWords { get; set; }
|
||||
|
||||
public DbSet<ProductListingInfo> ProductListingInfos { get; set; }
|
||||
|
||||
@@ -43,14 +43,14 @@ namespace Props.Data
|
||||
);
|
||||
|
||||
modelBuilder.Entity<SearchOutline>()
|
||||
.Property(e => e.Enabled)
|
||||
.Property(e => e.DisabledShops)
|
||||
.HasConversion(
|
||||
v => JsonSerializer.Serialize(v, null),
|
||||
v => JsonSerializer.Deserialize<SearchOutline.ShopsDisabled>(v, null),
|
||||
new ValueComparer<SearchOutline.ShopsDisabled>(
|
||||
v => JsonSerializer.Deserialize<SearchOutline.ShopSelector>(v, null),
|
||||
new ValueComparer<SearchOutline.ShopSelector>(
|
||||
(a, b) => a.Equals(b),
|
||||
c => c.GetHashCode(),
|
||||
c => c.Copy()
|
||||
c => new SearchOutline.ShopSelector(c)
|
||||
)
|
||||
);
|
||||
|
||||
|
@@ -9,7 +9,7 @@ using Props.Data;
|
||||
namespace Props.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20210809194646_InitialCreate")]
|
||||
[Migration("20210817042955_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@@ -165,7 +165,6 @@ namespace Props.Data.Migrations
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ProfileName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
@@ -214,7 +213,7 @@ namespace Props.Data.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Keywords");
|
||||
b.ToTable("QueryWords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Props.Models.Search.SearchOutline", b =>
|
||||
@@ -223,11 +222,7 @@ namespace Props.Data.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ApplicationUserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Enabled")
|
||||
b.Property<string>("DisabledShops")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
@@ -238,13 +233,11 @@ namespace Props.Data.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("SearchOutlinePreferencesId")
|
||||
b.Property<int>("SearchOutlinePreferencesId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApplicationUserId");
|
||||
|
||||
b.HasIndex("SearchOutlinePreferencesId");
|
||||
|
||||
b.ToTable("SearchOutline");
|
||||
@@ -320,16 +313,14 @@ namespace Props.Data.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("ActiveSearchOutlineId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ApplicationUserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
b.Property<string>("NameOfLastUsed")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasIndex("ActiveSearchOutlineId");
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApplicationUserId")
|
||||
.IsUnique();
|
||||
@@ -440,33 +431,23 @@ namespace Props.Data.Migrations
|
||||
|
||||
modelBuilder.Entity("Props.Models.Search.SearchOutline", b =>
|
||||
{
|
||||
b.HasOne("Props.Models.User.ApplicationUser", "ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId")
|
||||
b.HasOne("Props.Models.User.SearchOutlinePreferences", "SearchOutlinePreferences")
|
||||
.WithMany("SearchOutlines")
|
||||
.HasForeignKey("SearchOutlinePreferencesId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Props.Models.User.SearchOutlinePreferences", null)
|
||||
.WithMany("SearchOutlines")
|
||||
.HasForeignKey("SearchOutlinePreferencesId");
|
||||
|
||||
b.Navigation("ApplicationUser");
|
||||
b.Navigation("SearchOutlinePreferences");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Props.Models.User.SearchOutlinePreferences", b =>
|
||||
{
|
||||
b.HasOne("Props.Models.Search.SearchOutline", "ActiveSearchOutline")
|
||||
.WithMany()
|
||||
.HasForeignKey("ActiveSearchOutlineId");
|
||||
|
||||
b.HasOne("Props.Models.User.ApplicationUser", "ApplicationUser")
|
||||
.WithOne("searchOutlinePreferences")
|
||||
.HasForeignKey("Props.Models.User.SearchOutlinePreferences", "ApplicationUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ActiveSearchOutline");
|
||||
|
||||
b.Navigation("ApplicationUser");
|
||||
});
|
||||
|
@@ -46,20 +46,6 @@ namespace Props.Data.Migrations
|
||||
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Keywords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Word = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Hits = table.Column<uint>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Keywords", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ProductListingInfos",
|
||||
columns: table => new
|
||||
@@ -76,6 +62,20 @@ namespace Props.Data.Migrations
|
||||
table.PrimaryKey("PK_ProductListingInfos", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "QueryWords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Word = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Hits = table.Column<uint>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_QueryWords", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetRoleClaims",
|
||||
columns: table => new
|
||||
@@ -211,7 +211,7 @@ namespace Props.Data.Migrations
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ApplicationUserId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Order = table.Column<string>(type: "TEXT", nullable: false),
|
||||
ProfileName = table.Column<string>(type: "TEXT", nullable: false)
|
||||
ProfileName = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -224,6 +224,26 @@ namespace Props.Data.Migrations
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SearchOutlinePreferences",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ApplicationUserId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
NameOfLastUsed = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SearchOutlinePreferences", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_SearchOutlinePreferences_AspNetUsers_ApplicationUserId",
|
||||
column: x => x.ApplicationUserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "QueryWordInfoQueryWordInfo",
|
||||
columns: table => new
|
||||
@@ -235,15 +255,15 @@ namespace Props.Data.Migrations
|
||||
{
|
||||
table.PrimaryKey("PK_QueryWordInfoQueryWordInfo", x => new { x.FollowingId, x.PrecedingId });
|
||||
table.ForeignKey(
|
||||
name: "FK_QueryWordInfoQueryWordInfo_Keywords_FollowingId",
|
||||
name: "FK_QueryWordInfoQueryWordInfo_QueryWords_FollowingId",
|
||||
column: x => x.FollowingId,
|
||||
principalTable: "Keywords",
|
||||
principalTable: "QueryWords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_QueryWordInfoQueryWordInfo_Keywords_PrecedingId",
|
||||
name: "FK_QueryWordInfoQueryWordInfo_QueryWords_PrecedingId",
|
||||
column: x => x.PrecedingId,
|
||||
principalTable: "Keywords",
|
||||
principalTable: "QueryWords",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
@@ -254,49 +274,22 @@ namespace Props.Data.Migrations
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ApplicationUserId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
SearchOutlinePreferencesId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Filters = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Enabled = table.Column<string>(type: "TEXT", nullable: false),
|
||||
SearchOutlinePreferencesId = table.Column<int>(type: "INTEGER", nullable: true)
|
||||
DisabledShops = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SearchOutline", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_SearchOutline_AspNetUsers_ApplicationUserId",
|
||||
column: x => x.ApplicationUserId,
|
||||
principalTable: "AspNetUsers",
|
||||
name: "FK_SearchOutline_SearchOutlinePreferences_SearchOutlinePreferencesId",
|
||||
column: x => x.SearchOutlinePreferencesId,
|
||||
principalTable: "SearchOutlinePreferences",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SearchOutlinePreferences",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ApplicationUserId = table.Column<string>(type: "TEXT", nullable: false),
|
||||
ActiveSearchOutlineId = table.Column<int>(type: "INTEGER", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SearchOutlinePreferences", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_SearchOutlinePreferences_AspNetUsers_ApplicationUserId",
|
||||
column: x => x.ApplicationUserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_SearchOutlinePreferences_SearchOutline_ActiveSearchOutlineId",
|
||||
column: x => x.ActiveSearchOutlineId,
|
||||
principalTable: "SearchOutline",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ApplicationPreferences_ApplicationUserId",
|
||||
table: "ApplicationPreferences",
|
||||
@@ -351,50 +344,20 @@ namespace Props.Data.Migrations
|
||||
column: "ApplicationUserId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SearchOutline_ApplicationUserId",
|
||||
table: "SearchOutline",
|
||||
column: "ApplicationUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SearchOutline_SearchOutlinePreferencesId",
|
||||
table: "SearchOutline",
|
||||
column: "SearchOutlinePreferencesId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SearchOutlinePreferences_ActiveSearchOutlineId",
|
||||
table: "SearchOutlinePreferences",
|
||||
column: "ActiveSearchOutlineId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SearchOutlinePreferences_ApplicationUserId",
|
||||
table: "SearchOutlinePreferences",
|
||||
column: "ApplicationUserId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_SearchOutline_SearchOutlinePreferences_SearchOutlinePreferencesId",
|
||||
table: "SearchOutline",
|
||||
column: "SearchOutlinePreferencesId",
|
||||
principalTable: "SearchOutlinePreferences",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_SearchOutline_AspNetUsers_ApplicationUserId",
|
||||
table: "SearchOutline");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_SearchOutlinePreferences_AspNetUsers_ApplicationUserId",
|
||||
table: "SearchOutlinePreferences");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_SearchOutline_SearchOutlinePreferences_SearchOutlinePreferencesId",
|
||||
table: "SearchOutline");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ApplicationPreferences");
|
||||
|
||||
@@ -422,20 +385,20 @@ namespace Props.Data.Migrations
|
||||
migrationBuilder.DropTable(
|
||||
name: "ResultsPreferences");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SearchOutline");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetRoles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Keywords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUsers");
|
||||
name: "QueryWords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SearchOutlinePreferences");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SearchOutline");
|
||||
name: "AspNetUsers");
|
||||
}
|
||||
}
|
||||
}
|
@@ -163,7 +163,6 @@ namespace Props.Data.Migrations
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ProfileName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
@@ -212,7 +211,7 @@ namespace Props.Data.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Keywords");
|
||||
b.ToTable("QueryWords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Props.Models.Search.SearchOutline", b =>
|
||||
@@ -221,11 +220,7 @@ namespace Props.Data.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ApplicationUserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Enabled")
|
||||
b.Property<string>("DisabledShops")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
@@ -236,13 +231,11 @@ namespace Props.Data.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("SearchOutlinePreferencesId")
|
||||
b.Property<int>("SearchOutlinePreferencesId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApplicationUserId");
|
||||
|
||||
b.HasIndex("SearchOutlinePreferencesId");
|
||||
|
||||
b.ToTable("SearchOutline");
|
||||
@@ -318,16 +311,14 @@ namespace Props.Data.Migrations
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("ActiveSearchOutlineId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ApplicationUserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
b.Property<string>("NameOfLastUsed")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasIndex("ActiveSearchOutlineId");
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApplicationUserId")
|
||||
.IsUnique();
|
||||
@@ -438,33 +429,23 @@ namespace Props.Data.Migrations
|
||||
|
||||
modelBuilder.Entity("Props.Models.Search.SearchOutline", b =>
|
||||
{
|
||||
b.HasOne("Props.Models.User.ApplicationUser", "ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId")
|
||||
b.HasOne("Props.Models.User.SearchOutlinePreferences", "SearchOutlinePreferences")
|
||||
.WithMany("SearchOutlines")
|
||||
.HasForeignKey("SearchOutlinePreferencesId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Props.Models.User.SearchOutlinePreferences", null)
|
||||
.WithMany("SearchOutlines")
|
||||
.HasForeignKey("SearchOutlinePreferencesId");
|
||||
|
||||
b.Navigation("ApplicationUser");
|
||||
b.Navigation("SearchOutlinePreferences");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Props.Models.User.SearchOutlinePreferences", b =>
|
||||
{
|
||||
b.HasOne("Props.Models.Search.SearchOutline", "ActiveSearchOutline")
|
||||
.WithMany()
|
||||
.HasForeignKey("ActiveSearchOutlineId");
|
||||
|
||||
b.HasOne("Props.Models.User.ApplicationUser", "ApplicationUser")
|
||||
.WithOne("searchOutlinePreferences")
|
||||
.HasForeignKey("Props.Models.User.SearchOutlinePreferences", "ApplicationUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ActiveSearchOutline");
|
||||
|
||||
b.Navigation("ApplicationUser");
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user