// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using line_gestao_api.Data; #nullable disable namespace line_gestao_api.Migrations { [DbContext(typeof(AppDbContext))] [Migration("20260123151338_AddIdentityAndTenantsV2")] partial class AddIdentityAndTenantsV2 { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "10.0.1") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("text"); b.Property("Name") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("NormalizedName") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasDatabaseName("RoleNameIndex"); b.ToTable("AspNetRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("text"); b.Property("ClaimValue") .HasColumnType("text"); b.Property("RoleId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("text"); b.Property("ClaimValue") .HasColumnType("text"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") .HasColumnType("text"); b.Property("ProviderKey") .HasColumnType("text"); b.Property("ProviderDisplayName") .HasColumnType("text"); b.Property("UserId") .HasColumnType("uuid"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") .HasColumnType("uuid"); b.Property("RoleId") .HasColumnType("uuid"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("AspNetUserRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") .HasColumnType("uuid"); b.Property("LoginProvider") .HasColumnType("text"); b.Property("Name") .HasColumnType("text"); b.Property("Value") .HasColumnType("text"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens", (string)null); }); modelBuilder.Entity("line_gestao_api.Models.ApplicationUser", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("AccessFailedCount") .HasColumnType("integer"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("text"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("Email") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("EmailConfirmed") .HasColumnType("boolean"); b.Property("IsActive") .HasColumnType("boolean"); b.Property("LockoutEnabled") .HasColumnType("boolean"); b.Property("LockoutEnd") .HasColumnType("timestamp with time zone"); b.Property("Name") .IsRequired() .HasMaxLength(120) .HasColumnType("character varying(120)"); b.Property("NormalizedEmail") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("NormalizedUserName") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("PasswordHash") .HasColumnType("text"); b.Property("PhoneNumber") .HasColumnType("text"); b.Property("PhoneNumberConfirmed") .HasColumnType("boolean"); b.Property("SecurityStamp") .HasColumnType("text"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("TwoFactorEnabled") .HasColumnType("boolean"); b.Property("UserName") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.HasKey("Id"); b.HasIndex("NormalizedEmail") .HasDatabaseName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasDatabaseName("UserNameIndex"); b.HasIndex("TenantId", "NormalizedEmail") .IsUnique(); b.ToTable("AspNetUsers", (string)null); }); modelBuilder.Entity("line_gestao_api.Models.BillingClient", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Aparelho") .HasColumnType("text"); b.Property("Cliente") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("FormaPagamento") .HasColumnType("text"); b.Property("FranquiaLine") .HasColumnType("numeric"); b.Property("FranquiaVivo") .HasColumnType("numeric"); b.Property("Item") .HasColumnType("integer"); b.Property("Lucro") .HasColumnType("numeric"); b.Property("QtdLinhas") .HasColumnType("integer"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("Tipo") .IsRequired() .HasMaxLength(2) .HasColumnType("character varying(2)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("ValorContratoLine") .HasColumnType("numeric"); b.Property("ValorContratoVivo") .HasColumnType("numeric"); b.HasKey("Id"); b.HasIndex("Cliente"); b.HasIndex("Item"); b.HasIndex("TenantId"); b.HasIndex("Tipo"); b.HasIndex("Tipo", "Cliente"); b.ToTable("billing_clients", (string)null); }); modelBuilder.Entity("line_gestao_api.Models.MobileLine", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Cedente") .HasMaxLength(150) .HasColumnType("character varying(150)"); b.Property("Chip") .HasMaxLength(40) .HasColumnType("character varying(40)"); b.Property("Cliente") .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("Conta") .HasMaxLength(80) .HasColumnType("character varying(80)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("DataBloqueio") .HasColumnType("timestamp with time zone"); b.Property("DataEntregaCliente") .HasColumnType("timestamp with time zone"); b.Property("DataEntregaOpera") .HasColumnType("timestamp with time zone"); b.Property("Desconto") .HasColumnType("numeric"); b.Property("FranquiaGestao") .HasColumnType("numeric"); b.Property("FranquiaLine") .HasColumnType("numeric"); b.Property("FranquiaVivo") .HasColumnType("numeric"); b.Property("GestaoVozDados") .HasColumnType("numeric"); b.Property("Item") .HasColumnType("integer"); b.Property("Linha") .HasMaxLength(30) .HasColumnType("character varying(30)"); b.Property("LocacaoAp") .HasColumnType("numeric"); b.Property("Lucro") .HasColumnType("numeric"); b.Property("Modalidade") .HasMaxLength(80) .HasColumnType("character varying(80)"); b.Property("PlanoContrato") .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("Skeelo") .HasColumnType("numeric"); b.Property("Skil") .HasMaxLength(80) .HasColumnType("character varying(80)"); b.Property("Solicitante") .HasMaxLength(150) .HasColumnType("character varying(150)"); b.Property("Status") .HasMaxLength(80) .HasColumnType("character varying(80)"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("Usuario") .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("ValorContratoLine") .HasColumnType("numeric"); b.Property("ValorContratoVivo") .HasColumnType("numeric"); b.Property("ValorPlanoVivo") .HasColumnType("numeric"); b.Property("VencConta") .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("VivoGestaoDispositivo") .HasColumnType("numeric"); b.Property("VivoNewsPlus") .HasColumnType("numeric"); b.Property("VivoTravelMundo") .HasColumnType("numeric"); b.HasKey("Id"); b.HasIndex("Chip"); b.HasIndex("Cliente"); b.HasIndex("Skil"); b.HasIndex("Status"); b.HasIndex("Usuario"); b.HasIndex("TenantId", "Linha") .IsUnique(); b.ToTable("MobileLines"); }); modelBuilder.Entity("line_gestao_api.Models.MuregLine", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("DataDaMureg") .HasColumnType("timestamp with time zone"); b.Property("ICCID") .HasMaxLength(40) .HasColumnType("character varying(40)"); b.Property("Item") .HasColumnType("integer"); b.Property("LinhaAntiga") .HasMaxLength(30) .HasColumnType("character varying(30)"); b.Property("LinhaNova") .HasMaxLength(30) .HasColumnType("character varying(30)"); b.Property("MobileLineId") .HasColumnType("uuid"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("ICCID"); b.HasIndex("Item"); b.HasIndex("LinhaAntiga"); b.HasIndex("LinhaNova"); b.HasIndex("MobileLineId"); b.HasIndex("TenantId"); b.ToTable("MuregLines"); }); modelBuilder.Entity("line_gestao_api.Models.Notification", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Cliente") .HasColumnType("text"); b.Property("Data") .HasColumnType("timestamp with time zone"); b.Property("DedupKey") .IsRequired() .HasColumnType("text"); b.Property("DiasParaVencer") .HasColumnType("integer"); b.Property("Lida") .HasColumnType("boolean"); b.Property("LidaEm") .HasColumnType("timestamp with time zone"); b.Property("Linha") .HasColumnType("text"); b.Property("Mensagem") .IsRequired() .HasColumnType("text"); b.Property("ReferenciaData") .HasColumnType("timestamp with time zone"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("Tipo") .IsRequired() .HasColumnType("text"); b.Property("Titulo") .IsRequired() .HasColumnType("text"); b.Property("UserId") .HasColumnType("uuid"); b.Property("Usuario") .HasColumnType("text"); b.Property("VigenciaLineId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("Cliente"); b.HasIndex("Data"); b.HasIndex("DedupKey") .IsUnique(); b.HasIndex("Lida"); b.HasIndex("TenantId"); b.HasIndex("UserId"); b.HasIndex("VigenciaLineId"); b.ToTable("Notifications"); }); modelBuilder.Entity("line_gestao_api.Models.Tenant", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("Tenants"); }); modelBuilder.Entity("line_gestao_api.Models.TrocaNumeroLine", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("DataTroca") .HasColumnType("timestamp with time zone"); b.Property("ICCID") .HasColumnType("text"); b.Property("Item") .HasColumnType("integer"); b.Property("LinhaAntiga") .HasColumnType("text"); b.Property("LinhaNova") .HasColumnType("text"); b.Property("Motivo") .HasColumnType("text"); b.Property("Observacao") .HasColumnType("text"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("DataTroca"); b.HasIndex("ICCID"); b.HasIndex("Item"); b.HasIndex("LinhaAntiga"); b.HasIndex("LinhaNova"); b.HasIndex("TenantId"); b.ToTable("TrocaNumeroLines"); }); modelBuilder.Entity("line_gestao_api.Models.UserData", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Celular") .HasColumnType("text"); b.Property("Cliente") .HasColumnType("text"); b.Property("Cpf") .HasColumnType("text"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("DataNascimento") .HasColumnType("timestamp with time zone"); b.Property("Email") .HasColumnType("text"); b.Property("Endereco") .HasColumnType("text"); b.Property("Item") .HasColumnType("integer"); b.Property("Linha") .HasColumnType("text"); b.Property("Rg") .HasColumnType("text"); b.Property("TelefoneFixo") .HasColumnType("text"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("Cliente"); b.HasIndex("Cpf"); b.HasIndex("Email"); b.HasIndex("Item"); b.HasIndex("Linha"); b.HasIndex("TenantId"); b.ToTable("UserDatas"); }); modelBuilder.Entity("line_gestao_api.Models.VigenciaLine", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("Cliente") .HasColumnType("text"); b.Property("Conta") .HasColumnType("text"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("DtEfetivacaoServico") .HasColumnType("timestamp with time zone"); b.Property("DtTerminoFidelizacao") .HasColumnType("timestamp with time zone"); b.Property("Item") .HasColumnType("integer"); b.Property("Linha") .HasColumnType("text"); b.Property("PlanoContrato") .HasColumnType("text"); b.Property("TenantId") .HasColumnType("uuid"); b.Property("Total") .HasColumnType("numeric"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.Property("Usuario") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("Cliente"); b.HasIndex("DtTerminoFidelizacao"); b.HasIndex("Item"); b.HasIndex("Linha"); b.HasIndex("TenantId"); b.ToTable("VigenciaLines"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.HasOne("line_gestao_api.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.HasOne("line_gestao_api.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("line_gestao_api.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.HasOne("line_gestao_api.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("line_gestao_api.Models.MuregLine", b => { b.HasOne("line_gestao_api.Models.MobileLine", "MobileLine") .WithMany("Muregs") .HasForeignKey("MobileLineId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.Navigation("MobileLine"); }); modelBuilder.Entity("line_gestao_api.Models.Notification", b => { b.HasOne("line_gestao_api.Models.ApplicationUser", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Restrict); b.HasOne("line_gestao_api.Models.VigenciaLine", "VigenciaLine") .WithMany() .HasForeignKey("VigenciaLineId") .OnDelete(DeleteBehavior.Restrict); b.Navigation("User"); b.Navigation("VigenciaLine"); }); modelBuilder.Entity("line_gestao_api.Models.MobileLine", b => { b.Navigation("Muregs"); }); #pragma warning restore 612, 618 } } }