This commit is contained in:
Jöran Malek 2024-04-05 12:31:34 +02:00
parent 4c2b5cca93
commit 43b4d50e43
28 changed files with 674 additions and 249 deletions

View file

@ -15,23 +15,23 @@ namespace InkForge.Sqlite.Migrations
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.2");
modelBuilder.HasAnnotation("ProductVersion", "8.0.3");
modelBuilder.Entity("InkForge.Data.Blob", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<byte[]>("Content")
b.Property<byte[]>("Value")
.IsRequired()
.HasColumnType("BLOB");
b.HasKey("Id");
b.ToTable("Blobs");
b.ToTable("Blobs", (string)null);
});
modelBuilder.Entity("InkForge.Data.Infrastructure.MetadataEntity", b =>
modelBuilder.Entity("InkForge.Data.MetadataEntity", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
@ -42,63 +42,34 @@ namespace InkForge.Sqlite.Migrations
b.HasKey("Id");
b.ToTable("Metadata");
b.ToTable("Metadata", (string)null);
});
modelBuilder.Entity("InkForge.Data.Infrastructure.MetadataVersionEntity", b =>
{
b.Property<int?>("Version")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Version");
b.HasIndex("Id", "Version")
.IsUnique();
b.ToTable("MetadataHistory");
});
modelBuilder.Entity("InkForge.Data.Infrastructure.NoteEntity", b =>
modelBuilder.Entity("InkForge.Data.NoteEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int?>("ParentId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Notes");
b.HasIndex("ParentId");
b.ToTable("Notes", (string)null);
});
modelBuilder.Entity("InkForge.Data.Infrastructure.NoteVersionEntity", b =>
modelBuilder.Entity("InkForge.Data.NoteEntity", b =>
{
b.Property<int?>("Version")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.HasOne("InkForge.Data.NoteEntity", "Parent")
.WithMany()
.HasForeignKey("ParentId");
b.Property<int>("Id")
.HasColumnType("INTEGER");
b.HasKey("Version");
b.HasIndex("Id", "Version")
.IsUnique();
b.ToTable("NoteVersions");
});
modelBuilder.Entity("InkForge.Data.Infrastructure.NoteEntity", b =>
{
b.OwnsOne("InkForge.Data.Domain.Note", "Value", b1 =>
b.OwnsOne("InkForge.Data.NoteEntity.Value#InkForge.Data.Note", "Value", b1 =>
{
b1.Property<int>("ParentId")
b1.Property<int>("NoteEntityId")
.HasColumnType("INTEGER");
b1.Property<string>("ContentId")
@ -118,64 +89,11 @@ namespace InkForge.Sqlite.Migrations
b1.Property<DateTimeOffset>("Updated")
.HasColumnType("TEXT");
b1.HasKey("ParentId");
b1.HasKey("NoteEntityId");
b1.HasIndex("ContentId");
b1.ToTable("Notes");
b1.HasOne("InkForge.Data.Blob", "Content")
.WithMany()
.HasForeignKey("ContentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b1.WithOwner("Parent")
.HasForeignKey("ParentId");
b1.Navigation("Content");
b1.Navigation("Parent");
});
b.Navigation("Value")
.IsRequired();
});
modelBuilder.Entity("InkForge.Data.Infrastructure.NoteVersionEntity", b =>
{
b.OwnsOne("InkForge.Data.Domain.Note", "Value", b1 =>
{
b1.Property<int>("NoteVersionEntityVersion")
.HasColumnType("INTEGER");
b1.Property<string>("ContentId")
.IsRequired()
.HasColumnType("TEXT");
b1.Property<DateTimeOffset>("Created")
.HasColumnType("TEXT");
b1.Property<DateTimeOffset?>("Deleted")
.HasColumnType("TEXT");
b1.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b1.Property<int?>("ParentId")
.HasColumnType("INTEGER");
b1.Property<DateTimeOffset>("Updated")
.HasColumnType("TEXT");
b1.HasKey("NoteVersionEntityVersion");
b1.HasIndex("ContentId");
b1.HasIndex("ParentId");
b1.ToTable("NoteVersions");
b1.ToTable("Notes", (string)null);
b1.HasOne("InkForge.Data.Blob", "Content")
.WithMany()
@ -184,17 +102,13 @@ namespace InkForge.Sqlite.Migrations
.IsRequired();
b1.WithOwner()
.HasForeignKey("NoteVersionEntityVersion");
b1.HasOne("InkForge.Data.Infrastructure.NoteEntity", "Parent")
.WithMany()
.HasForeignKey("ParentId");
.HasForeignKey("NoteEntityId");
b1.Navigation("Content");
b1.Navigation("Parent");
});
b.Navigation("Parent");
b.Navigation("Value")
.IsRequired();
});