Fixed dockerfiles and fixed chapter upserts
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-07-17 10:16:32 -04:00
parent d98324c11e
commit e4529e11c0
15 changed files with 659 additions and 12 deletions

View File

@@ -0,0 +1,268 @@
// <auto-generated />
using System;
using DBConnection.Contexts;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace DBConnection.Migrations.Sqlite
{
[DbContext(typeof(SqliteAppDbContext))]
[Migration("20220717133151_Fix up UserNovel model and add index on User Email")]
partial class FixupUserNovelmodelandaddindexonUserEmail
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.7");
modelBuilder.Entity("NovelTag", b =>
{
b.Property<string>("NovelsUrl")
.HasColumnType("TEXT");
b.Property<string>("TagsTagValue")
.HasColumnType("TEXT");
b.HasKey("NovelsUrl", "TagsTagValue");
b.HasIndex("TagsTagValue");
b.ToTable("NovelTag");
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.Author", b =>
{
b.Property<string>("Url")
.HasColumnType("TEXT");
b.Property<DateTime>("DateCreated")
.HasColumnType("TEXT");
b.Property<DateTime>("DateModified")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Url");
b.ToTable("Authors");
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.Chapter", b =>
{
b.Property<string>("Url")
.HasColumnType("TEXT");
b.Property<int>("ChapterNumber")
.HasColumnType("INTEGER");
b.Property<string>("Content")
.HasColumnType("TEXT");
b.Property<DateTime>("DateCreated")
.HasColumnType("TEXT");
b.Property<DateTime>("DateModified")
.HasColumnType("TEXT");
b.Property<DateTime?>("DatePosted")
.HasColumnType("TEXT");
b.Property<DateTime?>("DateUpdated")
.HasColumnType("TEXT");
b.Property<DateTime?>("LastContentFetch")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("NovelUrl")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("RawContent")
.HasColumnType("TEXT");
b.HasKey("Url");
b.HasIndex("NovelUrl");
b.ToTable("Chapters");
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.Novel", b =>
{
b.Property<string>("Url")
.HasColumnType("TEXT");
b.Property<string>("AuthorUrl")
.HasColumnType("TEXT");
b.Property<DateTime>("DateCreated")
.HasColumnType("TEXT");
b.Property<DateTime>("DateModified")
.HasColumnType("TEXT");
b.Property<DateTime>("DatePosted")
.HasColumnType("TEXT");
b.Property<Guid>("Guid")
.HasColumnType("TEXT");
b.Property<DateTime>("LastUpdated")
.HasColumnType("TEXT");
b.Property<int>("Status")
.HasColumnType("INTEGER");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Url");
b.HasIndex("AuthorUrl");
b.HasIndex("Guid");
b.ToTable("Novels");
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.Tag", b =>
{
b.Property<string>("TagValue")
.HasColumnType("TEXT");
b.Property<DateTime>("DateCreated")
.HasColumnType("TEXT");
b.Property<DateTime>("DateModified")
.HasColumnType("TEXT");
b.HasKey("TagValue");
b.ToTable("Tags");
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<DateTime>("DateCreated")
.HasColumnType("TEXT");
b.Property<DateTime>("DateModified")
.HasColumnType("TEXT");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("Email");
b.ToTable("Users");
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.UserNovel", b =>
{
b.Property<string>("NovelUrl")
.HasColumnType("TEXT");
b.Property<int>("UserId")
.HasColumnType("INTEGER");
b.Property<int>("LastChapterRead")
.HasColumnType("INTEGER");
b.HasKey("NovelUrl", "UserId");
b.HasIndex("UserId");
b.ToTable("UserNovels");
});
modelBuilder.Entity("NovelTag", b =>
{
b.HasOne("Treestar.Shared.Models.DBDomain.Novel", null)
.WithMany()
.HasForeignKey("NovelsUrl")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Treestar.Shared.Models.DBDomain.Tag", null)
.WithMany()
.HasForeignKey("TagsTagValue")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.Chapter", b =>
{
b.HasOne("Treestar.Shared.Models.DBDomain.Novel", "Novel")
.WithMany("Chapters")
.HasForeignKey("NovelUrl")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Novel");
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.Novel", b =>
{
b.HasOne("Treestar.Shared.Models.DBDomain.Author", "Author")
.WithMany("Novels")
.HasForeignKey("AuthorUrl");
b.Navigation("Author");
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.UserNovel", b =>
{
b.HasOne("Treestar.Shared.Models.DBDomain.Novel", "Novel")
.WithMany()
.HasForeignKey("NovelUrl")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Treestar.Shared.Models.DBDomain.User", "User")
.WithMany("WatchedNovels")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Novel");
b.Navigation("User");
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.Author", b =>
{
b.Navigation("Novels");
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.Novel", b =>
{
b.Navigation("Chapters");
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.User", b =>
{
b.Navigation("WatchedNovels");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DBConnection.Migrations.Sqlite
{
public partial class FixupUserNovelmodelandaddindexonUserEmail : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateIndex(
name: "IX_Users_Email",
table: "Users",
column: "Email");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Users_Email",
table: "Users");
}
}
}

View File

@@ -169,6 +169,8 @@ namespace DBConnection.Migrations.Sqlite
b.HasKey("Id");
b.HasIndex("Email");
b.ToTable("Users");
});
@@ -207,11 +209,13 @@ namespace DBConnection.Migrations.Sqlite
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.Chapter", b =>
{
b.HasOne("Treestar.Shared.Models.DBDomain.Novel", null)
b.HasOne("Treestar.Shared.Models.DBDomain.Novel", "Novel")
.WithMany("Chapters")
.HasForeignKey("NovelUrl")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Novel");
});
modelBuilder.Entity("Treestar.Shared.Models.DBDomain.Novel", b =>