migracion: añadido entidades Auditoria
This commit is contained in:
@@ -35,6 +35,10 @@ public partial class AlquilaFacilContext : DbContext
|
||||
|
||||
public virtual DbSet<Grupo> Grupos { get; set; }
|
||||
|
||||
public virtual DbSet<Log> Logs { get; set; }
|
||||
|
||||
public virtual DbSet<LogDetalle> LogDetalles { get; set; }
|
||||
|
||||
public virtual DbSet<Notificacione> Notificaciones { get; set; }
|
||||
|
||||
public virtual DbSet<Permiso> Permisos { get; set; }
|
||||
@@ -417,6 +421,57 @@ public partial class AlquilaFacilContext : DbContext
|
||||
.HasColumnName("nombre");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Log>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.Fecha, e.Dniusuario }).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("Log");
|
||||
|
||||
entity.HasIndex(e => e.Dniusuario, "fk_log_clientes");
|
||||
|
||||
entity.Property(e => e.Fecha)
|
||||
.HasColumnType("datetime")
|
||||
.HasColumnName("fecha");
|
||||
entity.Property(e => e.Dniusuario)
|
||||
.HasColumnType("bigint(20)")
|
||||
.HasColumnName("dniusuario");
|
||||
entity.Property(e => e.Accion)
|
||||
.HasMaxLength(255)
|
||||
.HasColumnName("accion");
|
||||
|
||||
entity.HasOne(d => d.DniusuarioNavigation).WithMany(p => p.Logs)
|
||||
.HasForeignKey(d => d.Dniusuario)
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.HasConstraintName("fk_log_clientes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<LogDetalle>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.Fecha, e.Dniusuario, e.NombreTabla, e.Columna }).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("LogDetalle");
|
||||
|
||||
entity.Property(e => e.Fecha)
|
||||
.HasColumnType("datetime")
|
||||
.HasColumnName("fecha");
|
||||
entity.Property(e => e.Dniusuario)
|
||||
.HasColumnType("bigint(20)")
|
||||
.HasColumnName("dniusuario");
|
||||
entity.Property(e => e.NombreTabla).HasColumnName("nombreTabla");
|
||||
entity.Property(e => e.Columna).HasColumnName("columna");
|
||||
entity.Property(e => e.ValorAnterior)
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("valorAnterior");
|
||||
entity.Property(e => e.ValorNuevo)
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("valorNuevo");
|
||||
|
||||
entity.HasOne(d => d.Log).WithMany(p => p.LogDetalles)
|
||||
.HasForeignKey(d => new { d.Fecha, d.Dniusuario })
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.HasConstraintName("LogDetalle_ibfk_1");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Notificacione>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.Dnicliente, e.Fecha }).HasName("PRIMARY");
|
||||
|
||||
@@ -27,6 +27,8 @@ public partial class Cliente
|
||||
|
||||
public virtual ICollection<Contrato> ContratoDnipropietarioNavigations { get; set; } = new List<Contrato>();
|
||||
|
||||
public virtual ICollection<Log> Logs { get; set; } = new List<Log>();
|
||||
|
||||
public virtual ICollection<Notificacione> NotificacioneDniclienteNavigations { get; set; } = new List<Notificacione>();
|
||||
|
||||
public virtual ICollection<Notificacione> NotificacioneDniremitenteNavigations { get; set; } = new List<Notificacione>();
|
||||
|
||||
17
Entidades/Log.cs
Normal file
17
Entidades/Log.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Entidades;
|
||||
|
||||
public partial class Log
|
||||
{
|
||||
public DateTime Fecha { get; set; }
|
||||
|
||||
public long Dniusuario { get; set; }
|
||||
|
||||
public string Accion { get; set; } = null!;
|
||||
|
||||
public virtual Cliente DniusuarioNavigation { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<LogDetalle> LogDetalles { get; set; } = new List<LogDetalle>();
|
||||
}
|
||||
21
Entidades/Logdetalle.cs
Normal file
21
Entidades/Logdetalle.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Entidades;
|
||||
|
||||
public partial class LogDetalle
|
||||
{
|
||||
public DateTime Fecha { get; set; }
|
||||
|
||||
public long Dniusuario { get; set; }
|
||||
|
||||
public string NombreTabla { get; set; } = null!;
|
||||
|
||||
public string Columna { get; set; } = null!;
|
||||
|
||||
public string? ValorAnterior { get; set; }
|
||||
|
||||
public string? ValorNuevo { get; set; }
|
||||
|
||||
public virtual Log Log { get; set; } = null!;
|
||||
}
|
||||
Reference in New Issue
Block a user