// <auto-generated />
using System;
using Blahblah.FlowerStory.Server.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;

#nullable disable

namespace Blahblah.FlowerStory.Server.Migrations
{
    [DbContext(typeof(FlowerDatabase))]
    partial class FlowerDatabaseModelSnapshot : ModelSnapshot
    {
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder.HasAnnotation("ProductVersion", "7.0.9");

            modelBuilder.Entity("Blahblah.FlowerStory.Server.Data.Model.FlowerItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER")
                        .HasColumnName("fid");

                    b.Property<int>("CategoryId")
                        .HasColumnType("INTEGER")
                        .HasColumnName("categoryid");

                    b.Property<decimal?>("Cost")
                        .HasColumnType("real")
                        .HasColumnName("cost");

                    b.Property<long>("DateBuyUnixTime")
                        .HasColumnType("INTEGER")
                        .HasColumnName("datebuy")
                        .HasAnnotation("Relational:JsonPropertyName", "dateBuy");

                    b.Property<double?>("Latitude")
                        .HasColumnType("REAL")
                        .HasColumnName("latitude");

                    b.Property<double?>("Longitude")
                        .HasColumnType("REAL")
                        .HasColumnName("longitude");

                    b.Property<string>("Memo")
                        .HasColumnType("TEXT")
                        .HasColumnName("memo");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("TEXT")
                        .HasColumnName("name");

                    b.Property<int>("OwnerId")
                        .HasColumnType("INTEGER")
                        .HasColumnName("uid");

                    b.Property<string>("Purchase")
                        .HasColumnType("TEXT")
                        .HasColumnName("purchase");

                    b.HasKey("Id");

                    b.HasIndex("OwnerId");

                    b.ToTable("flowers");
                });

            modelBuilder.Entity("Blahblah.FlowerStory.Server.Data.Model.PhotoItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER")
                        .HasColumnName("pid");

                    b.Property<long>("DateUploadUnixTime")
                        .HasColumnType("INTEGER")
                        .HasColumnName("dateupload")
                        .HasAnnotation("Relational:JsonPropertyName", "dateUpload");

                    b.Property<string>("FileName")
                        .IsRequired()
                        .HasColumnType("TEXT")
                        .HasColumnName("filename");

                    b.Property<string>("FileType")
                        .IsRequired()
                        .HasColumnType("TEXT")
                        .HasColumnName("filetype");

                    b.Property<int?>("FlowerId")
                        .HasColumnType("INTEGER")
                        .HasColumnName("fid");

                    b.Property<int?>("Height")
                        .HasColumnType("INTEGER")
                        .HasColumnName("height");

                    b.Property<int>("OwnerId")
                        .HasColumnType("INTEGER")
                        .HasColumnName("uid");

                    b.Property<string>("Path")
                        .IsRequired()
                        .HasColumnType("TEXT")
                        .HasColumnName("path");

                    b.Property<int?>("RecordId")
                        .HasColumnType("INTEGER")
                        .HasColumnName("rid");

                    b.Property<int?>("Width")
                        .HasColumnType("INTEGER")
                        .HasColumnName("width");

                    b.HasKey("Id");

                    b.HasIndex("FlowerId");

                    b.HasIndex("OwnerId");

                    b.HasIndex("RecordId");

                    b.ToTable("photos");
                });

            modelBuilder.Entity("Blahblah.FlowerStory.Server.Data.Model.RecordItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER")
                        .HasColumnName("rid");

                    b.Property<int?>("ByUserId")
                        .HasColumnType("INTEGER")
                        .HasColumnName("byuid");

                    b.Property<string>("ByUserName")
                        .HasColumnType("TEXT")
                        .HasColumnName("byname");

                    b.Property<long>("DateUnixTime")
                        .HasColumnType("INTEGER")
                        .HasColumnName("date")
                        .HasAnnotation("Relational:JsonPropertyName", "date");

                    b.Property<int>("EventId")
                        .HasColumnType("INTEGER")
                        .HasColumnName("eid");

                    b.Property<int>("FlowerId")
                        .HasColumnType("INTEGER")
                        .HasColumnName("fid");

                    b.Property<double?>("Latitude")
                        .HasColumnType("REAL")
                        .HasColumnName("latitude");

                    b.Property<double?>("Longitude")
                        .HasColumnType("REAL")
                        .HasColumnName("longitude");

                    b.Property<string>("Memo")
                        .HasColumnType("TEXT")
                        .HasColumnName("memo");

                    b.Property<int>("OwnerId")
                        .HasColumnType("INTEGER")
                        .HasColumnName("uid");

                    b.HasKey("Id");

                    b.HasIndex("FlowerId");

                    b.HasIndex("OwnerId");

                    b.ToTable("records");
                });

            modelBuilder.Entity("Blahblah.FlowerStory.Server.Data.Model.TokenItem", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("TEXT")
                        .HasColumnName("tid");

                    b.Property<long>("ActiveDateUnixTime")
                        .HasColumnType("INTEGER")
                        .HasColumnName("activedate")
                        .HasAnnotation("Relational:JsonPropertyName", "activeDate");

                    b.Property<string>("ClientAgent")
                        .HasColumnType("TEXT")
                        .HasColumnName("clientagent");

                    b.Property<string>("ClientApp")
                        .HasColumnType("TEXT")
                        .HasColumnName("clientapp");

                    b.Property<string>("DeviceId")
                        .HasColumnType("TEXT")
                        .HasColumnName("deviceid");

                    b.Property<long>("ExpireDateUnixTime")
                        .HasColumnType("INTEGER")
                        .HasColumnName("expiredate")
                        .HasAnnotation("Relational:JsonPropertyName", "expireDate");

                    b.Property<int>("ExpireSeconds")
                        .HasColumnType("INTEGER")
                        .HasColumnName("expiresecs");

                    b.Property<long>("LogonDateUnixTime")
                        .HasColumnType("INTEGER")
                        .HasColumnName("logondate")
                        .HasAnnotation("Relational:JsonPropertyName", "logonDate");

                    b.Property<int>("UserId")
                        .HasColumnType("INTEGER")
                        .HasColumnName("uid");

                    b.Property<string>("VerifyCode")
                        .HasColumnType("TEXT")
                        .HasColumnName("verifycode");

                    b.HasKey("Id");

                    b.ToTable("tokens");
                });

            modelBuilder.Entity("Blahblah.FlowerStory.Server.Data.Model.UserItem", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER")
                        .HasColumnName("uid");

                    b.Property<long?>("ActiveDateUnixTime")
                        .HasColumnType("INTEGER")
                        .HasColumnName("activedate");

                    b.Property<byte[]>("Avatar")
                        .HasColumnType("BLOB")
                        .HasColumnName("avatar");

                    b.Property<string>("Email")
                        .HasColumnType("TEXT")
                        .HasColumnName("email");

                    b.Property<int>("Level")
                        .HasColumnType("INTEGER")
                        .HasColumnName("level");

                    b.Property<string>("Mobile")
                        .HasColumnType("TEXT")
                        .HasColumnName("mobile");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("TEXT")
                        .HasColumnName("name");

                    b.Property<string>("Password")
                        .IsRequired()
                        .HasColumnType("TEXT")
                        .HasColumnName("password");

                    b.Property<long>("RegisterDateUnixTime")
                        .HasColumnType("INTEGER")
                        .HasColumnName("regdate")
                        .HasAnnotation("Relational:JsonPropertyName", "registerDate");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("TEXT")
                        .HasColumnName("id");

                    b.HasKey("Id");

                    b.ToTable("users");
                });

            modelBuilder.Entity("Blahblah.FlowerStory.Server.Data.Model.FlowerItem", b =>
                {
                    b.HasOne("Blahblah.FlowerStory.Server.Data.Model.UserItem", "Owner")
                        .WithMany()
                        .HasForeignKey("OwnerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Owner");
                });

            modelBuilder.Entity("Blahblah.FlowerStory.Server.Data.Model.PhotoItem", b =>
                {
                    b.HasOne("Blahblah.FlowerStory.Server.Data.Model.FlowerItem", "Flower")
                        .WithMany("Photos")
                        .HasForeignKey("FlowerId");

                    b.HasOne("Blahblah.FlowerStory.Server.Data.Model.UserItem", "Owner")
                        .WithMany()
                        .HasForeignKey("OwnerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Blahblah.FlowerStory.Server.Data.Model.RecordItem", "Record")
                        .WithMany("Photos")
                        .HasForeignKey("RecordId");

                    b.Navigation("Flower");

                    b.Navigation("Owner");

                    b.Navigation("Record");
                });

            modelBuilder.Entity("Blahblah.FlowerStory.Server.Data.Model.RecordItem", b =>
                {
                    b.HasOne("Blahblah.FlowerStory.Server.Data.Model.FlowerItem", "Flower")
                        .WithMany()
                        .HasForeignKey("FlowerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Blahblah.FlowerStory.Server.Data.Model.UserItem", "Owner")
                        .WithMany()
                        .HasForeignKey("OwnerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Flower");

                    b.Navigation("Owner");
                });

            modelBuilder.Entity("Blahblah.FlowerStory.Server.Data.Model.FlowerItem", b =>
                {
                    b.Navigation("Photos");
                });

            modelBuilder.Entity("Blahblah.FlowerStory.Server.Data.Model.RecordItem", b =>
                {
                    b.Navigation("Photos");
                });
#pragma warning restore 612, 618
        }
    }
}
