InkForge/shared/migrations/InkForge.Sqlite/Migrations/20240401_Initial.Designer.cs
2024-05-02 21:44:13 +02:00

120 lines
3.9 KiB
C#

// <auto-generated />
using System;
using InkForge.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace InkForge.Sqlite.Migrations
{
[DbContext(typeof(NoteDbContext))]
[Migration("20240401_Initial")]
partial class _20240401_Initial
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.3");
modelBuilder.Entity("InkForge.Data.Blob", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<byte[]>("Value")
.IsRequired()
.HasColumnType("BLOB");
b.HasKey("Id");
b.ToTable("Blobs");
});
modelBuilder.Entity("InkForge.Data.MetadataEntity", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<string>("Value")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Metadata");
});
modelBuilder.Entity("InkForge.Data.NoteEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int?>("ParentId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("ParentId");
b.ToTable("Notes");
});
modelBuilder.Entity("InkForge.Data.NoteEntity", b =>
{
b.HasOne("InkForge.Data.NoteEntity", "Parent")
.WithMany()
.HasForeignKey("ParentId");
b.OwnsOne("InkForge.Data.Note", "Value", b1 =>
{
b1.Property<int>("NoteEntityId")
.HasColumnType("INTEGER");
b1.Property<int>("ContentId")
.HasColumnType("INTEGER");
b1.Property<DateTimeOffset>("Created")
.HasColumnType("TEXT");
b1.Property<DateTimeOffset?>("Deleted")
.HasColumnType("TEXT");
b1.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b1.Property<DateTimeOffset>("Updated")
.HasColumnType("TEXT");
b1.HasKey("NoteEntityId");
b1.HasIndex("ContentId")
.IsUnique();
b1.ToTable("Notes");
b1.HasOne("InkForge.Data.Blob", null)
.WithOne()
.HasForeignKey("InkForge.Data.NoteEntity.Value#InkForge.Data.Note", "ContentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b1.WithOwner()
.HasForeignKey("NoteEntityId");
});
b.Navigation("Parent");
b.Navigation("Value")
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}