//
#nullable disable
using System;
using IOL.GreatOffice.Api.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace IOL.GreatOffice.Api.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20220319144958_ModifiedAt")]
partial class ModifiedAt
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("IOL.GreatOffice.Data.Database.ForgotPasswordRequest", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property("ModifiedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("modified_at");
b.Property("UserId")
.HasColumnType("uuid")
.HasColumnName("user_id");
b.HasKey("Id")
.HasName("pk_forgot_password_requests");
b.HasIndex("UserId")
.HasDatabaseName("ix_forgot_password_requests_user_id");
b.ToTable("forgot_password_requests", (string)null);
});
modelBuilder.Entity("IOL.GreatOffice.Data.Database.GithubUserMapping", b =>
{
b.Property("GithubId")
.HasColumnType("text")
.HasColumnName("github_id");
b.Property("Email")
.HasColumnType("text")
.HasColumnName("email");
b.Property("RefreshToken")
.HasColumnType("text")
.HasColumnName("refresh_token");
b.Property("UserId")
.HasColumnType("uuid")
.HasColumnName("user_id");
b.HasKey("GithubId")
.HasName("pk_github_user_mappings");
b.HasIndex("UserId")
.HasDatabaseName("ix_github_user_mappings_user_id");
b.ToTable("github_user_mappings", (string)null);
});
modelBuilder.Entity("IOL.GreatOffice.Data.Database.TimeCategory", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property("Color")
.HasColumnType("text")
.HasColumnName("color");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property("ModifiedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("modified_at");
b.Property("Name")
.HasColumnType("text")
.HasColumnName("name");
b.Property("UserId")
.HasColumnType("uuid")
.HasColumnName("user_id");
b.HasKey("Id")
.HasName("pk_time_categories");
b.ToTable("time_categories", (string)null);
});
modelBuilder.Entity("IOL.GreatOffice.Data.Database.TimeEntry", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property("CategoryId")
.HasColumnType("uuid")
.HasColumnName("category_id");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property("Description")
.HasColumnType("text")
.HasColumnName("description");
b.Property("ModifiedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("modified_at");
b.Property("Start")
.HasColumnType("timestamp with time zone")
.HasColumnName("start");
b.Property("Stop")
.HasColumnType("timestamp with time zone")
.HasColumnName("stop");
b.Property("UserId")
.HasColumnType("uuid")
.HasColumnName("user_id");
b.HasKey("Id")
.HasName("pk_time_entries");
b.HasIndex("CategoryId")
.HasDatabaseName("ix_time_entries_category_id");
b.ToTable("time_entries", (string)null);
});
modelBuilder.Entity("IOL.GreatOffice.Data.Database.TimeLabel", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property("Color")
.HasColumnType("text")
.HasColumnName("color");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property("ModifiedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("modified_at");
b.Property("Name")
.HasColumnType("text")
.HasColumnName("name");
b.Property("UserId")
.HasColumnType("uuid")
.HasColumnName("user_id");
b.HasKey("Id")
.HasName("pk_time_labels");
b.ToTable("time_labels", (string)null);
});
modelBuilder.Entity("IOL.GreatOffice.Data.Database.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property("ModifiedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("modified_at");
b.Property("Password")
.HasColumnType("text")
.HasColumnName("password");
b.Property("Username")
.HasColumnType("text")
.HasColumnName("username");
b.HasKey("Id")
.HasName("pk_users");
b.ToTable("users", (string)null);
});
modelBuilder.Entity("TimeEntryTimeLabel", b =>
{
b.Property("EntriesId")
.HasColumnType("uuid")
.HasColumnName("entries_id");
b.Property("LabelsId")
.HasColumnType("uuid")
.HasColumnName("labels_id");
b.HasKey("EntriesId", "LabelsId")
.HasName("pk_time_entry_time_label");
b.HasIndex("LabelsId")
.HasDatabaseName("ix_time_entry_time_label_labels_id");
b.ToTable("time_entry_time_label", (string)null);
});
modelBuilder.Entity("IOL.GreatOffice.Data.Database.ForgotPasswordRequest", b =>
{
b.HasOne("IOL.GreatOffice.Data.Database.User", "User")
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_forgot_password_requests_users_user_id");
b.Navigation("User");
});
modelBuilder.Entity("IOL.GreatOffice.Data.Database.GithubUserMapping", b =>
{
b.HasOne("IOL.GreatOffice.Data.Database.User", "User")
.WithMany()
.HasForeignKey("UserId")
.HasConstraintName("fk_github_user_mappings_users_user_id");
b.Navigation("User");
});
modelBuilder.Entity("IOL.GreatOffice.Data.Database.TimeEntry", b =>
{
b.HasOne("IOL.GreatOffice.Data.Database.TimeCategory", "Category")
.WithMany()
.HasForeignKey("CategoryId")
.HasConstraintName("fk_time_entries_time_categories_category_id");
b.Navigation("Category");
});
modelBuilder.Entity("TimeEntryTimeLabel", b =>
{
b.HasOne("IOL.GreatOffice.Data.Database.TimeEntry", null)
.WithMany()
.HasForeignKey("EntriesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_time_entry_time_label_time_entries_entries_id");
b.HasOne("IOL.GreatOffice.Data.Database.TimeLabel", null)
.WithMany()
.HasForeignKey("LabelsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_time_entry_time_label_time_labels_labels_id");
});
#pragma warning restore 612, 618
}
}
}