Foxchat.NET/Foxchat.Identity/Migrations/20240512225835_Init.Designer.cs
2024-05-14 03:51:31 +02:00

253 lines
9.4 KiB
C#

// <auto-generated />
using System;
using Foxchat.Identity.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Foxchat.Identity.Migrations
{
[DbContext(typeof(IdentityContext))]
[Migration("20240512225835_Init")]
partial class Init
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("AccountChatInstance", b =>
{
b.Property<Guid>("AccountsId")
.HasColumnType("uuid")
.HasColumnName("accounts_id");
b.Property<Guid>("ChatInstancesId")
.HasColumnType("uuid")
.HasColumnName("chat_instances_id");
b.HasKey("AccountsId", "ChatInstancesId")
.HasName("pk_account_chat_instance");
b.HasIndex("ChatInstancesId")
.HasDatabaseName("ix_account_chat_instance_chat_instances_id");
b.ToTable("account_chat_instance", (string)null);
});
modelBuilder.Entity("Foxchat.Core.Database.Instance", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("PrivateKey")
.IsRequired()
.HasColumnType("text")
.HasColumnName("private_key");
b.Property<string>("PublicKey")
.IsRequired()
.HasColumnType("text")
.HasColumnName("public_key");
b.HasKey("Id")
.HasName("pk_instance");
b.ToTable("instance", (string)null);
});
modelBuilder.Entity("Foxchat.Identity.Database.Models.Account", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<string>("Avatar")
.HasColumnType("text")
.HasColumnName("avatar");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text")
.HasColumnName("email");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text")
.HasColumnName("password");
b.Property<int>("Role")
.HasColumnType("integer")
.HasColumnName("role");
b.Property<string>("Username")
.IsRequired()
.HasColumnType("text")
.HasColumnName("username");
b.HasKey("Id")
.HasName("pk_accounts");
b.HasIndex("Email")
.IsUnique()
.HasDatabaseName("ix_accounts_email");
b.HasIndex("Username")
.IsUnique()
.HasDatabaseName("ix_accounts_username");
b.ToTable("accounts", (string)null);
});
modelBuilder.Entity("Foxchat.Identity.Database.Models.ChatInstance", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<string>("BaseUrl")
.IsRequired()
.HasColumnType("text")
.HasColumnName("base_url");
b.Property<string>("Domain")
.IsRequired()
.HasColumnType("text")
.HasColumnName("domain");
b.Property<string>("PublicKey")
.IsRequired()
.HasColumnType("text")
.HasColumnName("public_key");
b.Property<string>("Reason")
.HasColumnType("text")
.HasColumnName("reason");
b.Property<int>("Status")
.HasColumnType("integer")
.HasColumnName("status");
b.HasKey("Id")
.HasName("pk_chat_instances");
b.HasIndex("Domain")
.IsUnique()
.HasDatabaseName("ix_chat_instances_domain");
b.ToTable("chat_instances", (string)null);
});
modelBuilder.Entity("Foxchat.Identity.Database.Models.GuildAccount", b =>
{
b.Property<Guid>("ChatInstanceId")
.HasColumnType("uuid")
.HasColumnName("chat_instance_id");
b.Property<string>("GuildId")
.HasColumnType("text")
.HasColumnName("guild_id");
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.HasKey("ChatInstanceId", "GuildId", "AccountId")
.HasName("pk_guild_accounts");
b.HasIndex("AccountId")
.HasDatabaseName("ix_guild_accounts_account_id");
b.ToTable("guild_accounts", (string)null);
});
modelBuilder.Entity("Foxchat.Identity.Database.Models.Token", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.HasKey("Id")
.HasName("pk_tokens");
b.HasIndex("AccountId")
.HasDatabaseName("ix_tokens_account_id");
b.ToTable("tokens", (string)null);
});
modelBuilder.Entity("AccountChatInstance", b =>
{
b.HasOne("Foxchat.Identity.Database.Models.Account", null)
.WithMany()
.HasForeignKey("AccountsId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_account_chat_instance_accounts_accounts_id");
b.HasOne("Foxchat.Identity.Database.Models.ChatInstance", null)
.WithMany()
.HasForeignKey("ChatInstancesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_account_chat_instance_chat_instances_chat_instances_id");
});
modelBuilder.Entity("Foxchat.Identity.Database.Models.GuildAccount", b =>
{
b.HasOne("Foxchat.Identity.Database.Models.Account", "Account")
.WithMany()
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_guild_accounts_accounts_account_id");
b.HasOne("Foxchat.Identity.Database.Models.ChatInstance", "ChatInstance")
.WithMany()
.HasForeignKey("ChatInstanceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_guild_accounts_chat_instances_chat_instance_id");
b.Navigation("Account");
b.Navigation("ChatInstance");
});
modelBuilder.Entity("Foxchat.Identity.Database.Models.Token", b =>
{
b.HasOne("Foxchat.Identity.Database.Models.Account", "Account")
.WithMany("Tokens")
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_tokens_accounts_account_id");
b.Navigation("Account");
});
modelBuilder.Entity("Foxchat.Identity.Database.Models.Account", b =>
{
b.Navigation("Tokens");
});
#pragma warning restore 612, 618
}
}
}