// <auto-generated />
using System;
using EnqueueIt.Oracle;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Oracle.EntityFrameworkCore.Metadata;

namespace EnqueueIt.Oracle.Migrations
{
    [DbContext(typeof(EnqueueItDbContext))]
    [Migration("20230414075953_CreateEnqueueItDatabase")]
    partial class CreateEnqueueItDatabase
    {
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("ProductVersion", "5.0.17")
                .HasAnnotation("Oracle:ValueGenerationStrategy", OracleValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("EnqueueIt.Sql.BackgroundJobItem", b =>
                {
                    b.Property<string>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("CHAR(36)")
                        .HasColumnName("id");

                    b.Property<DateTime?>("CompletedAt")
                        .HasColumnType("TIMESTAMP(7)")
                        .HasColumnName("completed_at");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("TIMESTAMP(7)")
                        .HasColumnName("created_at");

                    b.Property<string>("JobError")
                        .HasColumnType("NVARCHAR2(2000)")
                        .HasColumnName("job_error");

                    b.Property<string>("JobId")
                        .HasColumnType("CHAR(36)")
                        .HasColumnName("job_id");

                    b.Property<DateTime?>("LastActivity")
                        .HasColumnType("TIMESTAMP(7)")
                        .HasColumnName("last_activity");

                    b.Property<string>("Logs")
                        .HasColumnType("NVARCHAR2(2000)")
                        .HasColumnName("logs");

                    b.Property<string>("ProcessedBy")
                        .HasColumnType("CHAR(36)")
                        .HasColumnName("processed_by");

                    b.Property<string>("Server")
                        .HasColumnType("NVARCHAR2(2000)")
                        .HasColumnName("server");

                    b.Property<DateTime?>("StartedAt")
                        .HasColumnType("TIMESTAMP(7)")
                        .HasColumnName("started_at");

                    b.Property<int>("Status")
                        .HasColumnType("NUMBER(10)")
                        .HasColumnName("status");

                    b.HasKey("Id")
                        .HasName("pk_background_jobs");

                    b.HasIndex("JobId")
                        .HasDatabaseName("ix_background_jobs_job_id");

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

            modelBuilder.Entity("EnqueueIt.Sql.JobItem", b =>
                {
                    b.Property<string>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("CHAR(36)")
                        .HasColumnName("id");

                    b.Property<bool>("Active")
                        .HasColumnType("NUMBER(1)")
                        .HasColumnName("active");

                    b.Property<string>("AfterBackgroundJobIds")
                        .HasColumnType("NVARCHAR2(2000)")
                        .HasColumnName("after_background_job_ids");

                    b.Property<string>("AppName")
                        .HasColumnType("NVARCHAR2(2000)")
                        .HasColumnName("app_name");

                    b.Property<string>("Argument")
                        .HasColumnType("NVARCHAR2(2000)")
                        .HasColumnName("argument");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("TIMESTAMP(7)")
                        .HasColumnName("created_at");

                    b.Property<bool>("IsRecurring")
                        .HasColumnType("NUMBER(1)")
                        .HasColumnName("is_recurring");

                    b.Property<string>("Name")
                        .HasColumnType("NVARCHAR2(2000)")
                        .HasColumnName("name");

                    b.Property<string>("Queue")
                        .HasColumnType("NVARCHAR2(2000)")
                        .HasColumnName("queue");

                    b.Property<string>("Recurring")
                        .HasColumnType("NVARCHAR2(2000)")
                        .HasColumnName("recurring");

                    b.Property<DateTime?>("StartAt")
                        .HasColumnType("TIMESTAMP(7)")
                        .HasColumnName("start_at");

                    b.Property<int>("Tries")
                        .HasColumnType("NUMBER(10)")
                        .HasColumnName("tries");

                    b.Property<int>("Type")
                        .HasColumnType("NUMBER(10)")
                        .HasColumnName("type");

                    b.HasKey("Id")
                        .HasName("pk_jobs");

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

            modelBuilder.Entity("EnqueueIt.Sql.BackgroundJobItem", b =>
                {
                    b.HasOne("EnqueueIt.Sql.JobItem", "Job")
                        .WithMany("BackgroundJobs")
                        .HasForeignKey("JobId")
                        .HasConstraintName("fk_background_jobs_jobs_job_id")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

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

            modelBuilder.Entity("EnqueueIt.Sql.JobItem", b =>
                {
                    b.Navigation("BackgroundJobs");
                });
#pragma warning restore 612, 618
        }
    }
}
