2561 lines
107 KiB
C#
2561 lines
107 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using bdGrupoSanchoToro.db;
|
|
|
|
namespace bdGrupoSanchoToro.dbcontext;
|
|
|
|
public partial class GrupoSanchoToroContext : DbContext
|
|
{
|
|
public GrupoSanchoToroContext(DbContextOptions<GrupoSanchoToroContext> options)
|
|
: base(options)
|
|
{
|
|
}
|
|
|
|
public virtual DbSet<albaranes> albaranes { get; set; }
|
|
|
|
public virtual DbSet<almacenes> almacenes { get; set; }
|
|
|
|
public virtual DbSet<aplicacionesasientos> aplicacionesasientos { get; set; }
|
|
|
|
public virtual DbSet<apuntes> apuntes { get; set; }
|
|
|
|
public virtual DbSet<apuntesmodelo> apuntesmodelo { get; set; }
|
|
|
|
public virtual DbSet<articulos> articulos { get; set; }
|
|
|
|
public virtual DbSet<asientos> asientos { get; set; }
|
|
|
|
public virtual DbSet<asientosmodelos> asientosmodelos { get; set; }
|
|
|
|
public virtual DbSet<autorizacionesgrupos> autorizacionesgrupos { get; set; }
|
|
|
|
public virtual DbSet<autorizacionesusuarios> autorizacionesusuarios { get; set; }
|
|
|
|
public virtual DbSet<bancos> bancos { get; set; }
|
|
|
|
public virtual DbSet<cajas> cajas { get; set; }
|
|
|
|
public virtual DbSet<celdasinformescontables> celdasinformescontables { get; set; }
|
|
|
|
public virtual DbSet<codigospostales> codigospostales { get; set; }
|
|
|
|
public virtual DbSet<conceptosapuntes> conceptosapuntes { get; set; }
|
|
|
|
public virtual DbSet<conciliacionesbancarias> conciliacionesbancarias { get; set; }
|
|
|
|
public virtual DbSet<correos> correos { get; set; }
|
|
|
|
public virtual DbSet<cuentas> cuentas { get; set; }
|
|
|
|
public virtual DbSet<cuentasceldasinformescontables> cuentasceldasinformescontables { get; set; }
|
|
|
|
public virtual DbSet<cuentascorreo> cuentascorreo { get; set; }
|
|
|
|
public virtual DbSet<desglosetiposofertas> desglosetiposofertas { get; set; }
|
|
|
|
public virtual DbSet<detallepresupuesto> detallepresupuesto { get; set; }
|
|
|
|
public virtual DbSet<detallesalbaranes> detallesalbaranes { get; set; }
|
|
|
|
public virtual DbSet<detallesfacturas> detallesfacturas { get; set; }
|
|
|
|
public virtual DbSet<detallesfacturasrecibidas> detallesfacturasrecibidas { get; set; }
|
|
|
|
public virtual DbSet<documentosfacturas> documentosfacturas { get; set; }
|
|
|
|
public virtual DbSet<documentosfacturasrecibidas> documentosfacturasrecibidas { get; set; }
|
|
|
|
public virtual DbSet<documentospresupuestos> documentospresupuestos { get; set; }
|
|
|
|
public virtual DbSet<ejercicioscontables> ejercicioscontables { get; set; }
|
|
|
|
public virtual DbSet<empresas> empresas { get; set; }
|
|
|
|
public virtual DbSet<entidades> entidades { get; set; }
|
|
|
|
public virtual DbSet<enumeraciones> enumeraciones { get; set; }
|
|
|
|
public virtual DbSet<eventos> eventos { get; set; }
|
|
|
|
public virtual DbSet<expedientesarticulos> expedientesarticulos { get; set; }
|
|
|
|
public virtual DbSet<expedientesentidades> expedientesentidades { get; set; }
|
|
|
|
public virtual DbSet<extractosbancarios> extractosbancarios { get; set; }
|
|
|
|
public virtual DbSet<facturas> facturas { get; set; }
|
|
|
|
public virtual DbSet<facturasrecibidas> facturasrecibidas { get; set; }
|
|
|
|
public virtual DbSet<familias> familias { get; set; }
|
|
|
|
public virtual DbSet<ficheros> ficheros { get; set; }
|
|
|
|
public virtual DbSet<ficherosadjuntos> ficherosadjuntos { get; set; }
|
|
|
|
public virtual DbSet<ficherosconfiguracion> ficherosconfiguracion { get; set; }
|
|
|
|
public virtual DbSet<fiestas> fiestas { get; set; }
|
|
|
|
public virtual DbSet<gruasparticulares> gruasparticulares { get; set; }
|
|
|
|
public virtual DbSet<gruposenumeraciones> gruposenumeraciones { get; set; }
|
|
|
|
public virtual DbSet<gruposusuarios> gruposusuarios { get; set; }
|
|
|
|
public virtual DbSet<informescontables> informescontables { get; set; }
|
|
|
|
public virtual DbSet<logs> logs { get; set; }
|
|
|
|
public virtual DbSet<marcas> marcas { get; set; }
|
|
|
|
public virtual DbSet<menus> menus { get; set; }
|
|
|
|
public virtual DbSet<movimientosbancarios> movimientosbancarios { get; set; }
|
|
|
|
public virtual DbSet<movimientoscaja> movimientoscaja { get; set; }
|
|
|
|
public virtual DbSet<municipios> municipios { get; set; }
|
|
|
|
public virtual DbSet<permisos> permisos { get; set; }
|
|
|
|
public virtual DbSet<plantillas> plantillas { get; set; }
|
|
|
|
public virtual DbSet<presupuestos> presupuestos { get; set; }
|
|
|
|
public virtual DbSet<procesos> procesos { get; set; }
|
|
|
|
public virtual DbSet<productos> productos { get; set; }
|
|
|
|
public virtual DbSet<provincias> provincias { get; set; }
|
|
|
|
public virtual DbSet<seriesfacturas> seriesfacturas { get; set; }
|
|
|
|
public virtual DbSet<stocks> stocks { get; set; }
|
|
|
|
public virtual DbSet<tablaalturas> tablaalturas { get; set; }
|
|
|
|
public virtual DbSet<tablaplumas> tablaplumas { get; set; }
|
|
|
|
public virtual DbSet<tablas> tablas { get; set; }
|
|
|
|
public virtual DbSet<tiposofertas> tiposofertas { get; set; }
|
|
|
|
public virtual DbSet<trabajadores> trabajadores { get; set; }
|
|
|
|
public virtual DbSet<usuarios> usuarios { get; set; }
|
|
|
|
public virtual DbSet<v_albaranesextendidos> v_albaranesextendidos { get; set; }
|
|
|
|
public virtual DbSet<v_apuntesagrupados> v_apuntesagrupados { get; set; }
|
|
|
|
public virtual DbSet<v_apuntesextendidos> v_apuntesextendidos { get; set; }
|
|
|
|
public virtual DbSet<versionesgruas> versionesgruas { get; set; }
|
|
|
|
public virtual DbSet<vf_cuentas> vf_cuentas { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder
|
|
.UseCollation("utf8mb4_0900_ai_ci")
|
|
.HasCharSet("utf8mb4");
|
|
|
|
modelBuilder.Entity<albaranes>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idAlbaran).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idAlmacenOrigen, "albaranes_almacenes01_idx");
|
|
|
|
entity.HasIndex(e => e.idAlmacenDestino, "albaranes_almacenes02_idx");
|
|
|
|
entity.HasIndex(e => e.idEntidad, "albaranes_entidades_idx");
|
|
|
|
entity.HasIndex(e => e.CodigoMunicipioCarga, "albaranes_municipios01_idx");
|
|
|
|
entity.HasIndex(e => e.CodigoMunicipioDescarga, "albaranes_municipios_02_idx");
|
|
|
|
entity.HasIndex(e => e.idPresupuesto, "albaranes_presupuestos_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "albaranes_usuarios_idx");
|
|
|
|
entity.Property(e => e.Cargadores)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoMunicipioCarga)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoMunicipioDescarga)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoPostalCarga)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoPostalDescarga)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Descargadores)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.EmailCarga)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.EmailDescarga)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.FechaCarga).HasColumnType("datetime");
|
|
entity.Property(e => e.FechaDescarga).HasColumnType("datetime");
|
|
entity.Property(e => e.LugarCarga)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.LugarDescarga)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono1Carga)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono1Descarga)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono2Carga)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono2Descarga)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.CodigoMunicipioCargaNavigation).WithMany(p => p.albaranesCodigoMunicipioCargaNavigation)
|
|
.HasForeignKey(d => d.CodigoMunicipioCarga)
|
|
.HasConstraintName("albaranes_municipios_01");
|
|
|
|
entity.HasOne(d => d.CodigoMunicipioDescargaNavigation).WithMany(p => p.albaranesCodigoMunicipioDescargaNavigation)
|
|
.HasForeignKey(d => d.CodigoMunicipioDescarga)
|
|
.HasConstraintName("albaranes_municipios_02");
|
|
|
|
entity.HasOne(d => d.idAlmacenDestinoNavigation).WithMany(p => p.albaranesidAlmacenDestinoNavigation)
|
|
.HasForeignKey(d => d.idAlmacenDestino)
|
|
.HasConstraintName("albaranes_almacenes02");
|
|
|
|
entity.HasOne(d => d.idAlmacenOrigenNavigation).WithMany(p => p.albaranesidAlmacenOrigenNavigation)
|
|
.HasForeignKey(d => d.idAlmacenOrigen)
|
|
.HasConstraintName("albaranes_almacenes01");
|
|
|
|
entity.HasOne(d => d.idEntidadNavigation).WithMany(p => p.albaranes)
|
|
.HasForeignKey(d => d.idEntidad)
|
|
.HasConstraintName("albaranes_entidades");
|
|
|
|
entity.HasOne(d => d.idPresupuestoNavigation).WithMany(p => p.albaranes)
|
|
.HasForeignKey(d => d.idPresupuesto)
|
|
.HasConstraintName("albaranes_presupuestos");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.albaranes)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("albaranes_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<almacenes>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idAlmacen).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idEmpresa, "almacenes_empresas_idx");
|
|
|
|
entity.HasIndex(e => e.CodigoMunicipio, "almacenes_municipios_idx");
|
|
|
|
entity.Property(e => e.CodigoMunicipio)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoPostal)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(80)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Direccion)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Email)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Encargados)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono1)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.CodigoMunicipioNavigation).WithMany(p => p.almacenes)
|
|
.HasForeignKey(d => d.CodigoMunicipio)
|
|
.HasConstraintName("almacenes_municipios");
|
|
|
|
entity.HasOne(d => d.idEmpresaNavigation).WithMany(p => p.almacenes)
|
|
.HasForeignKey(d => d.idEmpresa)
|
|
.HasConstraintName("almacenes_empresas");
|
|
});
|
|
|
|
modelBuilder.Entity<aplicacionesasientos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idAplicacionAsiento).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idAsiento, "asientos_idx");
|
|
|
|
entity.HasOne(d => d.idAsientoNavigation).WithMany(p => p.aplicacionesasientos)
|
|
.HasForeignKey(d => d.idAsiento)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("asientos");
|
|
});
|
|
|
|
modelBuilder.Entity<apuntes>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idApunte).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idAsiento, "apuntes_asientos_idx");
|
|
|
|
entity.HasIndex(e => e.idConcepto, "apuntes_conceptosapuntes_idx");
|
|
|
|
entity.HasIndex(e => e.idConciliacion, "apuntes_conciliacionesbancarias_idx");
|
|
|
|
entity.HasIndex(e => e.idCuenta, "apuntes_cuentas_idx");
|
|
|
|
entity.Property(e => e.Concepto).HasMaxLength(200);
|
|
entity.Property(e => e.FechaPunteo).HasColumnType("datetime");
|
|
entity.Property(e => e.NumeroDocumento).HasMaxLength(30);
|
|
|
|
entity.HasOne(d => d.idAsientoNavigation).WithMany(p => p.apuntes)
|
|
.HasForeignKey(d => d.idAsiento)
|
|
.HasConstraintName("apuntes_asientos");
|
|
|
|
entity.HasOne(d => d.idConceptoNavigation).WithMany(p => p.apuntes)
|
|
.HasForeignKey(d => d.idConcepto)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("apuntes_conceptosapuntes");
|
|
|
|
entity.HasOne(d => d.idConciliacionNavigation).WithMany(p => p.apuntes)
|
|
.HasForeignKey(d => d.idConciliacion)
|
|
.HasConstraintName("apuntes_conciliacionesbancarias");
|
|
|
|
entity.HasOne(d => d.idCuentaNavigation).WithMany(p => p.apuntes)
|
|
.HasForeignKey(d => d.idCuenta)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("apuntes_cuentas");
|
|
});
|
|
|
|
modelBuilder.Entity<apuntesmodelo>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idApunteModelo).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idAsientoModelo, "apuntesmodelos_asientosmodelos_idx");
|
|
|
|
entity.HasIndex(e => e.idConcepto, "apuntesmodelos_conceptosapuntes_idx");
|
|
|
|
entity.Property(e => e.Concepto).HasMaxLength(200);
|
|
entity.Property(e => e.NumeroCuenta).HasMaxLength(10);
|
|
entity.Property(e => e.NumeroDocumento).HasMaxLength(30);
|
|
|
|
entity.HasOne(d => d.idAsientoModeloNavigation).WithMany(p => p.apuntesmodelo)
|
|
.HasForeignKey(d => d.idAsientoModelo)
|
|
.HasConstraintName("apuntesmodelos_asientosmodelos");
|
|
|
|
entity.HasOne(d => d.idConceptoNavigation).WithMany(p => p.apuntesmodelo)
|
|
.HasForeignKey(d => d.idConcepto)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("apuntesmodelos_conceptosapuntes");
|
|
});
|
|
|
|
modelBuilder.Entity<articulos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idArticulo).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idDetalleFra, "articulos_detallesfacturas");
|
|
|
|
entity.HasIndex(e => e.idDetalleFraVenta, "articulos_facturasrecibidas_idx");
|
|
|
|
entity.HasIndex(e => e.idFichero, "articulos_ficheros_idx");
|
|
|
|
entity.HasIndex(e => new { e.idProducto, e.CodigoArticulo }, "articulos_productos_codigoarticulo").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idProducto, "articulos_productos_idx");
|
|
|
|
entity.HasIndex(e => e.idProveedor, "articulos_proveedores_idx");
|
|
|
|
entity.Property(e => e.CodigoArticulo)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Matricula).HasMaxLength(20);
|
|
entity.Property(e => e.NumeroSerie)
|
|
.HasMaxLength(40)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Observaciones).HasMaxLength(200);
|
|
|
|
entity.HasOne(d => d.idDetalleFraNavigation).WithMany(p => p.articulos)
|
|
.HasForeignKey(d => d.idDetalleFra)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("articulos_detallesfacturas");
|
|
|
|
entity.HasOne(d => d.idDetalleFraVentaNavigation).WithMany(p => p.articulos)
|
|
.HasForeignKey(d => d.idDetalleFraVenta)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("articulos_facturasrecibidas");
|
|
|
|
entity.HasOne(d => d.idFicheroNavigation).WithMany(p => p.articulos)
|
|
.HasForeignKey(d => d.idFichero)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("articulos_ficheros");
|
|
|
|
entity.HasOne(d => d.idProductoNavigation).WithMany(p => p.articulos)
|
|
.HasForeignKey(d => d.idProducto)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("articulos_productos");
|
|
|
|
entity.HasOne(d => d.idProveedorNavigation).WithMany(p => p.articulos)
|
|
.HasForeignKey(d => d.idProveedor)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("articulos_proveedores");
|
|
});
|
|
|
|
modelBuilder.Entity<asientos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idAsiento).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idAsientoModelo, "asientos_asientosmodelo_idx");
|
|
|
|
entity.HasIndex(e => e.idEjercicio, "asientos_ejercicioscontables_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "asientos_usuarios_idx");
|
|
|
|
entity.Property(e => e.FechaPunteo).HasColumnType("datetime");
|
|
|
|
entity.HasOne(d => d.idAsientoModeloNavigation).WithMany(p => p.asientos)
|
|
.HasForeignKey(d => d.idAsientoModelo)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("asientos_asientosmodelo");
|
|
|
|
entity.HasOne(d => d.idEjercicioNavigation).WithMany(p => p.asientos)
|
|
.HasForeignKey(d => d.idEjercicio)
|
|
.HasConstraintName("asientos_ejercicioscontables");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.asientos)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("asientos_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<asientosmodelos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idAsientoModelo).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idUsuario, "asientosmodelos_usuarios_idx");
|
|
|
|
entity.Property(e => e.Codigo).HasMaxLength(6);
|
|
entity.Property(e => e.Descripcion).HasMaxLength(100);
|
|
entity.Property(e => e.FechaIntroduccion).HasColumnType("datetime");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.asientosmodelos)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("asientosmodelos_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<autorizacionesgrupos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idAutorizaciongrupo).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idGrupo, "autorizacionesgrupos_gruposusuarios_idx");
|
|
|
|
entity.HasIndex(e => new { e.idPermiso, e.idGrupo }, "autorizacionesgrupos_permisos_idx").IsUnique();
|
|
|
|
entity.HasOne(d => d.idGrupoNavigation).WithMany(p => p.autorizacionesgrupos)
|
|
.HasForeignKey(d => d.idGrupo)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("autorizacionesgrupos_gruposusuarios");
|
|
|
|
entity.HasOne(d => d.idPermisoNavigation).WithMany(p => p.autorizacionesgrupos)
|
|
.HasForeignKey(d => d.idPermiso)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("autorizacionesgrupos_permisos");
|
|
});
|
|
|
|
modelBuilder.Entity<autorizacionesusuarios>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idAutorizaciones).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "autorizaciones_grupos_idx");
|
|
|
|
entity.HasIndex(e => new { e.idPermiso, e.idUsuario }, "autorizacionesusuarios_permisos_idx").IsUnique();
|
|
|
|
entity.HasOne(d => d.idPermisoNavigation).WithMany(p => p.autorizacionesusuarios)
|
|
.HasForeignKey(d => d.idPermiso)
|
|
.HasConstraintName("autorizacionesusuarios_permisos");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.autorizacionesusuarios)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("autorizacionesusuarios_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<bancos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.Codigo).HasName("PRIMARY");
|
|
|
|
entity.Property(e => e.Codigo)
|
|
.HasMaxLength(4)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.BIC)
|
|
.HasMaxLength(11)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Nombre)
|
|
.HasMaxLength(145)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
});
|
|
|
|
modelBuilder.Entity<cajas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idCaja).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idEmpresa, "cajas_empresas_idx");
|
|
|
|
entity.HasIndex(e => e.idPermiso, "cajas_permisos_idx");
|
|
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.FechaBaja).HasColumnType("datetime");
|
|
entity.Property(e => e.FechaCierre).HasColumnType("datetime");
|
|
entity.Property(e => e.IBAN)
|
|
.HasMaxLength(24)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.SufijoBancario)
|
|
.HasMaxLength(3)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.idEmpresaNavigation).WithMany(p => p.cajas)
|
|
.HasForeignKey(d => d.idEmpresa)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("cajas_empresas");
|
|
|
|
entity.HasOne(d => d.idPermisoNavigation).WithMany(p => p.cajas)
|
|
.HasForeignKey(d => d.idPermiso)
|
|
.HasConstraintName("cajas_permisos");
|
|
});
|
|
|
|
modelBuilder.Entity<celdasinformescontables>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idCelda).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idInformeContable, "celdasinformescontables_informescontables_idx");
|
|
|
|
entity.Property(e => e.Columna).HasMaxLength(4);
|
|
entity.Property(e => e.NombreCampo).HasMaxLength(45);
|
|
entity.Property(e => e.Observaciones).HasMaxLength(100);
|
|
|
|
entity.HasOne(d => d.idInformeContableNavigation).WithMany(p => p.celdasinformescontables)
|
|
.HasForeignKey(d => d.idInformeContable)
|
|
.HasConstraintName("celdasinformescontables_informescontables");
|
|
});
|
|
|
|
modelBuilder.Entity<codigospostales>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idCodigoPostal).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => new { e.CodigoPostal, e.CodigoMunicipio }, "codigopostal_codigomunicipio").IsUnique();
|
|
|
|
entity.HasIndex(e => e.CodigoMunicipio, "codigospostales_municipios_idx");
|
|
|
|
entity.Property(e => e.CodigoMunicipio)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoPostal)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.DescripcionAdicional)
|
|
.HasMaxLength(60)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.CodigoMunicipioNavigation).WithMany(p => p.codigospostales)
|
|
.HasForeignKey(d => d.CodigoMunicipio)
|
|
.HasConstraintName("cp_municipios");
|
|
});
|
|
|
|
modelBuilder.Entity<conceptosapuntes>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idConcepto).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
|
|
|
entity.Property(e => e.Codigo).HasMaxLength(10);
|
|
entity.Property(e => e.Concepto).HasMaxLength(200);
|
|
});
|
|
|
|
modelBuilder.Entity<conciliacionesbancarias>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idConciliacion).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idCaja, "conciliacionesbancarias_cajas_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "conciliacionesbancarias_usuarios_idx");
|
|
|
|
entity.Property(e => e.FechaConciliacion).HasColumnType("datetime");
|
|
|
|
entity.HasOne(d => d.idCajaNavigation).WithMany(p => p.conciliacionesbancarias)
|
|
.HasForeignKey(d => d.idCaja)
|
|
.HasConstraintName("conciliacionesbancarias_cajas");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.conciliacionesbancarias)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.HasConstraintName("conciliacionesbancarias_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<correos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idcorreo).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.FechaAnulacion, "FechaAnulacion");
|
|
|
|
entity.HasIndex(e => e.FechaAvisoError, "FechaAvisoError");
|
|
|
|
entity.HasIndex(e => e.FechaEnvio, "FechaEnvio");
|
|
|
|
entity.HasIndex(e => e.FechaUltimoIntento, "FechaUltimoIntento");
|
|
|
|
entity.HasIndex(e => e.Asunto, "IN_Asunto");
|
|
|
|
entity.HasIndex(e => new { e.CodigoAplicacion, e.idAplicacion }, "aplicacion");
|
|
|
|
entity.HasIndex(e => e.idcuenta, "correos_cuentas");
|
|
|
|
entity.HasIndex(e => e.idEntidad, "correos_entidades_idx");
|
|
|
|
entity.HasIndex(e => e.idFicheroAdjunto, "correos_ficheros");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "correos_usuarios_idx");
|
|
|
|
entity.Property(e => e.Asunto)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoAplicacion)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Copia)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CopiaOculta)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Cuerpo)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Destinatario)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.DireccionRespuesta)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.FechaAnulacion).HasColumnType("datetime");
|
|
entity.Property(e => e.FechaAvisoError).HasColumnType("datetime");
|
|
entity.Property(e => e.FechaCreacion).HasColumnType("datetime");
|
|
entity.Property(e => e.FechaEnvio).HasColumnType("datetime");
|
|
entity.Property(e => e.FechaUltimoIntento).HasColumnType("datetime");
|
|
entity.Property(e => e.MensajeError)
|
|
.HasMaxLength(512)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Remitente)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.RutaFicheroAdjunto)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.idEntidadNavigation).WithMany(p => p.correos)
|
|
.HasForeignKey(d => d.idEntidad)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("correos_entidades");
|
|
|
|
entity.HasOne(d => d.idFicheroAdjuntoNavigation).WithMany(p => p.correos)
|
|
.HasForeignKey(d => d.idFicheroAdjunto)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("correos_ficheros");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.correos)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("correos_usuarios");
|
|
|
|
entity.HasOne(d => d.idcuentaNavigation).WithMany(p => p.correos)
|
|
.HasForeignKey(d => d.idcuenta)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("correos_cuentas");
|
|
});
|
|
|
|
modelBuilder.Entity<cuentas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idCuenta).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idEjercicio, "cuentas_ejercicioscontables_idx");
|
|
|
|
entity.HasIndex(e => e.idEmpresaAmortizacion, "cuentas_enumeraciones_01_Empresa_idx");
|
|
|
|
entity.Property(e => e.Denominacion)
|
|
.HasMaxLength(150)
|
|
.HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.Mote).HasMaxLength(40);
|
|
entity.Property(e => e.NumeroCuenta).HasMaxLength(10);
|
|
entity.Property(e => e.Observaciones).HasMaxLength(200);
|
|
|
|
entity.HasOne(d => d.idEjercicioNavigation).WithMany(p => p.cuentas)
|
|
.HasForeignKey(d => d.idEjercicio)
|
|
.HasConstraintName("cuentas_ejercicioscontables");
|
|
|
|
entity.HasOne(d => d.idEmpresaAmortizacionNavigation).WithMany(p => p.cuentas)
|
|
.HasForeignKey(d => d.idEmpresaAmortizacion)
|
|
.HasConstraintName("cuentas_enumeraciones_01_Empresa");
|
|
});
|
|
|
|
modelBuilder.Entity<cuentasceldasinformescontables>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idCuenta).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idCelda, "cuentasceldasinformescontables_celdasinformescontables_idx");
|
|
|
|
entity.Property(e => e.NumeroCuenta).HasMaxLength(8);
|
|
|
|
entity.HasOne(d => d.idCeldaNavigation).WithMany(p => p.cuentasceldasinformescontables)
|
|
.HasForeignKey(d => d.idCelda)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("cuentasceldasinformescontables_celdasinformescontables");
|
|
});
|
|
|
|
modelBuilder.Entity<cuentascorreo>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idCuenta).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => new { e.Codigo, e.idEmpresa }, "Codigo_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idEmpresa, "cuentascorreos_empresas_idx");
|
|
|
|
entity.Property(e => e.Codigo)
|
|
.HasMaxLength(20)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.CuentaCorreo)
|
|
.HasMaxLength(255)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Password)
|
|
.HasMaxLength(45)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Remitente)
|
|
.HasMaxLength(255)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.ResponderA)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.ServidorSMTP)
|
|
.HasMaxLength(100)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.idEmpresa).HasDefaultValueSql("'0'");
|
|
|
|
entity.HasOne(d => d.idEmpresaNavigation).WithMany(p => p.cuentascorreo)
|
|
.HasForeignKey(d => d.idEmpresa)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("cuentascorreos_empresas");
|
|
});
|
|
|
|
modelBuilder.Entity<desglosetiposofertas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idDesglose).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idTipoOferta, "desglosetiposofertas_idx");
|
|
|
|
entity.HasIndex(e => e.idProducto, "desglosetiposofertas_productos_idx");
|
|
|
|
entity.HasOne(d => d.idProductoNavigation).WithMany(p => p.desglosetiposofertas)
|
|
.HasForeignKey(d => d.idProducto)
|
|
.HasConstraintName("desglosetiposofertas_productos");
|
|
|
|
entity.HasOne(d => d.idTipoOfertaNavigation).WithMany(p => p.desglosetiposofertas)
|
|
.HasForeignKey(d => d.idTipoOferta)
|
|
.HasConstraintName("desglosetiposofertas_tiposofertas");
|
|
});
|
|
|
|
modelBuilder.Entity<detallepresupuesto>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idDetallePresupuesto).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idPresupuesto, "detallepresupuesto_Presupuestos_idx");
|
|
|
|
entity.HasIndex(e => e.idArticulo, "detallepresupuesto_articulos");
|
|
|
|
entity.HasIndex(e => e.idProducto, "detallepresupuesto_productos_idx");
|
|
|
|
entity.Property(e => e.Cantidad).HasDefaultValueSql("'1'");
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.idArticuloNavigation).WithMany(p => p.detallepresupuesto)
|
|
.HasForeignKey(d => d.idArticulo)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("detallepresupuesto_articulos");
|
|
|
|
entity.HasOne(d => d.idPresupuestoNavigation).WithMany(p => p.detallepresupuesto)
|
|
.HasForeignKey(d => d.idPresupuesto)
|
|
.HasConstraintName("detallespresupuesto_presupuestos");
|
|
|
|
entity.HasOne(d => d.idProductoNavigation).WithMany(p => p.detallepresupuesto)
|
|
.HasForeignKey(d => d.idProducto)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("detallepresupuesto_productos");
|
|
});
|
|
|
|
modelBuilder.Entity<detallesalbaranes>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idDetalle).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idAlbaran, "detallesalbaranes_albaranes_idx");
|
|
|
|
entity.HasIndex(e => e.idAlbaranRecogida, "detallesalbaranes_albaranrecogida_idx");
|
|
|
|
entity.HasIndex(e => e.idArticulo, "detallesalbaranes_articulos_idx");
|
|
|
|
entity.HasIndex(e => e.idUltimaFactura, "detallesalbaranes_facturas_idx");
|
|
|
|
entity.HasIndex(e => e.idProducto, "detallesalbaranes_productos_idx");
|
|
|
|
entity.HasOne(d => d.idAlbaranNavigation).WithMany(p => p.detallesalbaranesidAlbaranNavigation)
|
|
.HasForeignKey(d => d.idAlbaran)
|
|
.HasConstraintName("detallesalbaranes_albaranes");
|
|
|
|
entity.HasOne(d => d.idAlbaranRecogidaNavigation).WithMany(p => p.detallesalbaranesidAlbaranRecogidaNavigation)
|
|
.HasForeignKey(d => d.idAlbaranRecogida)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("detallesalbaranes_albaranrecogida");
|
|
|
|
entity.HasOne(d => d.idArticuloNavigation).WithMany(p => p.detallesalbaranes)
|
|
.HasForeignKey(d => d.idArticulo)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("detallesalbaranes_articulos");
|
|
|
|
entity.HasOne(d => d.idProductoNavigation).WithMany(p => p.detallesalbaranes)
|
|
.HasForeignKey(d => d.idProducto)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("detallesalbaranes_productos");
|
|
|
|
entity.HasOne(d => d.idUltimaFacturaNavigation).WithMany(p => p.detallesalbaranes)
|
|
.HasForeignKey(d => d.idUltimaFactura)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("detallesalbaranes_facturas");
|
|
});
|
|
|
|
modelBuilder.Entity<detallesfacturas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idDetalle).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idDetallePresupuesto, "detallesfacturas_detallespresupuestos_idx");
|
|
|
|
entity.HasIndex(e => e.idFactura, "detallesfacturas_facturas_idx");
|
|
|
|
entity.HasIndex(e => e.idDetalleRTF, "detallesfacturas_ficheros_idx");
|
|
|
|
entity.HasIndex(e => e.idProducto, "detallesfacturas_productos_idx");
|
|
|
|
entity.HasIndex(e => e.idTipoIVA, "detallesfacturas_tiposiva_idx");
|
|
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(255)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
|
|
entity.HasOne(d => d.idDetallePresupuestoNavigation).WithMany(p => p.detallesfacturas)
|
|
.HasForeignKey(d => d.idDetallePresupuesto)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("detallesfacturas_detallespresupuestos");
|
|
|
|
entity.HasOne(d => d.idDetalleRTFNavigation).WithMany(p => p.detallesfacturas)
|
|
.HasForeignKey(d => d.idDetalleRTF)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("detallesfacturas_ficheros");
|
|
|
|
entity.HasOne(d => d.idFacturaNavigation).WithMany(p => p.detallesfacturas)
|
|
.HasForeignKey(d => d.idFactura)
|
|
.HasConstraintName("detallesfacturas_facturas");
|
|
|
|
entity.HasOne(d => d.idProductoNavigation).WithMany(p => p.detallesfacturas)
|
|
.HasForeignKey(d => d.idProducto)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("detallesfacturas_productos");
|
|
|
|
entity.HasOne(d => d.idTipoIVANavigation).WithMany(p => p.detallesfacturas)
|
|
.HasForeignKey(d => d.idTipoIVA)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("detallesfacturas_tiposiva");
|
|
});
|
|
|
|
modelBuilder.Entity<detallesfacturasrecibidas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idDetalle).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idFactura, "detallesfacturasrecibidas_facturas_idx");
|
|
|
|
entity.HasIndex(e => e.idProducto, "detallesfacturasrecibidas_productos_idx");
|
|
|
|
entity.HasIndex(e => e.idTipoIva, "detallesfacturasrecibidas_tiposiva_idx");
|
|
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(255)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
|
|
entity.HasOne(d => d.idFacturaNavigation).WithMany(p => p.detallesfacturasrecibidas)
|
|
.HasForeignKey(d => d.idFactura)
|
|
.HasConstraintName("detallesfacturasrecibidas_facturasrecibidas");
|
|
|
|
entity.HasOne(d => d.idProductoNavigation).WithMany(p => p.detallesfacturasrecibidas)
|
|
.HasForeignKey(d => d.idProducto)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("detallesfacturasrecibidas_productos");
|
|
|
|
entity.HasOne(d => d.idTipoIvaNavigation).WithMany(p => p.detallesfacturasrecibidas)
|
|
.HasForeignKey(d => d.idTipoIva)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("detallesfacturasrecibidas_tiposiva");
|
|
});
|
|
|
|
modelBuilder.Entity<documentosfacturas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idDocumento).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idFactura, "documentosfacturas_facturas_idx");
|
|
|
|
entity.HasIndex(e => e.idFichero, "documentosfacturas_ficheros_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "documentosfacturas_usuarios_idx");
|
|
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(225)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Fecha).HasColumnType("datetime");
|
|
|
|
entity.HasOne(d => d.idFacturaNavigation).WithMany(p => p.documentosfacturas)
|
|
.HasForeignKey(d => d.idFactura)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("documentosfacturas_facturas");
|
|
|
|
entity.HasOne(d => d.idFicheroNavigation).WithMany(p => p.documentosfacturas)
|
|
.HasForeignKey(d => d.idFichero)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("documentosfacturas_ficheros");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.documentosfacturas)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("documentosfacturas_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<documentosfacturasrecibidas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idDocumento).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idFactura, "documentosfacturasrecibidas_facturasrecibidas_idx");
|
|
|
|
entity.HasIndex(e => e.idFichero, "documentosfacturasrecibidas_ficheros_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "documentosfacturasrecibidas_usuarios_idx");
|
|
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(225)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Fecha).HasColumnType("datetime");
|
|
|
|
entity.HasOne(d => d.idFacturaNavigation).WithMany(p => p.documentosfacturasrecibidas)
|
|
.HasForeignKey(d => d.idFactura)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("documentosfacturasrecibidas_facturasrecibidas");
|
|
|
|
entity.HasOne(d => d.idFicheroNavigation).WithMany(p => p.documentosfacturasrecibidas)
|
|
.HasForeignKey(d => d.idFichero)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("documentosfacturasrecibidas_ficheros");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.documentosfacturasrecibidas)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("documentosfacturasrecibidas_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<documentospresupuestos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idDocumento).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idTipoDocumento, "documentosprespuestos_idx");
|
|
|
|
entity.HasIndex(e => e.idPresupuesto, "documentosprespuestos_presupuestos_idx");
|
|
|
|
entity.HasIndex(e => e.idFichero, "documentospresupuestos_presupuestos_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "documentospresupuestos_usuarios_idx");
|
|
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_bin")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Fecha).HasColumnType("datetime");
|
|
|
|
entity.HasOne(d => d.idFicheroNavigation).WithMany(p => p.documentospresupuestos)
|
|
.HasForeignKey(d => d.idFichero)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("documentospresupuestos_presupuestos");
|
|
|
|
entity.HasOne(d => d.idPresupuestoNavigation).WithMany(p => p.documentospresupuestos)
|
|
.HasForeignKey(d => d.idPresupuesto)
|
|
.HasConstraintName("documentosprespuestos_presupuestos");
|
|
|
|
entity.HasOne(d => d.idTipoDocumentoNavigation).WithMany(p => p.documentospresupuestos)
|
|
.HasForeignKey(d => d.idTipoDocumento)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("documentosprespuestos");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.documentospresupuestos)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("documentospresupuestos_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<ejercicioscontables>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idEjercicio).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idEmpresa, "ejercicioscontables_empresascontables_idx");
|
|
|
|
entity.Property(e => e.Descripcion).HasMaxLength(40);
|
|
entity.Property(e => e.NivelesCuentas).HasMaxLength(20);
|
|
|
|
entity.HasOne(d => d.idEmpresaNavigation).WithMany(p => p.ejercicioscontables)
|
|
.HasForeignKey(d => d.idEmpresa)
|
|
.HasConstraintName("ejercicioscontables_empresascontables");
|
|
});
|
|
|
|
modelBuilder.Entity<empresas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idEmpresa).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.RazonSocial, "RazonSocial_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idLogo1, "empresas_Logo1_idx");
|
|
|
|
entity.HasIndex(e => e.idLogo2, "empresas_Logo2_idx");
|
|
|
|
entity.Property(e => e.CIF)
|
|
.HasMaxLength(16)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Codigo).HasMaxLength(2);
|
|
entity.Property(e => e.Domicilio)
|
|
.HasMaxLength(100)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Poblacion)
|
|
.HasMaxLength(100)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.RazonSocial)
|
|
.HasMaxLength(100)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
|
|
entity.HasOne(d => d.idLogo1Navigation).WithMany(p => p.empresasidLogo1Navigation)
|
|
.HasForeignKey(d => d.idLogo1)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("empresas_Logo1");
|
|
|
|
entity.HasOne(d => d.idLogo2Navigation).WithMany(p => p.empresasidLogo2Navigation)
|
|
.HasForeignKey(d => d.idLogo2)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("empresas_Logo2");
|
|
});
|
|
|
|
modelBuilder.Entity<entidades>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idEntidad).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idUsuarioCreador, "entidades_01_usuarios_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuarioModificador, "entidades_02_usuarios_idx");
|
|
|
|
entity.HasIndex(e => e.idTipoPago, "entidades_TipoPagoEnumeraciones_idx");
|
|
|
|
entity.HasIndex(e => e.idEmpresa, "entidades_empresas_idx");
|
|
|
|
entity.HasIndex(e => e.CodigoMunicipio, "entidades_municipios_idx");
|
|
|
|
entity.HasIndex(e => e.idEntidad, "identidades_UNIQUE").IsUnique();
|
|
|
|
entity.Property(e => e.CodigoMunicipio)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoPostal)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Codigo_Cliente_Ant)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Codigo_Proveedor_Ant)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Direccion)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Email)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Email2)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.FAX)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.IBAN)
|
|
.HasMaxLength(45)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.NIF)
|
|
.HasMaxLength(20)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.PersonaContacto)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.RazonSocial)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono1)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono2)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono3)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.CodigoMunicipioNavigation).WithMany(p => p.entidades)
|
|
.HasForeignKey(d => d.CodigoMunicipio)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("entidades_municipios");
|
|
|
|
entity.HasOne(d => d.idEmpresaNavigation).WithMany(p => p.entidades)
|
|
.HasForeignKey(d => d.idEmpresa)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("entidades_empresas");
|
|
|
|
entity.HasOne(d => d.idTipoPagoNavigation).WithMany(p => p.entidades)
|
|
.HasForeignKey(d => d.idTipoPago)
|
|
.HasConstraintName("entidades_TipoPagoEnumeraciones");
|
|
|
|
entity.HasOne(d => d.idUsuarioCreadorNavigation).WithMany(p => p.entidadesidUsuarioCreadorNavigation)
|
|
.HasForeignKey(d => d.idUsuarioCreador)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("entidades_00_usuarios");
|
|
|
|
entity.HasOne(d => d.idUsuarioModificadorNavigation).WithMany(p => p.entidadesidUsuarioModificadorNavigation)
|
|
.HasForeignKey(d => d.idUsuarioModificador)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("entidades_01_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<enumeraciones>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idEnumeracion).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idGrupoEnumeracion, "enumeraciones_gruposenumeraciones_idx");
|
|
|
|
entity.Property(e => e.Codigo)
|
|
.HasMaxLength(40)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Fecha1).HasColumnType("datetime");
|
|
entity.Property(e => e.Fecha2).HasColumnType("datetime");
|
|
entity.Property(e => e.FechaBaja).HasColumnType("datetime");
|
|
entity.Property(e => e.ValorAlfabetico1)
|
|
.HasMaxLength(40)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.ValorAlfabetico2)
|
|
.HasMaxLength(40)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.ValorAlfabetico3)
|
|
.HasMaxLength(40)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.ValorAlfabetico4)
|
|
.HasMaxLength(40)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.ValorAlfabeticoLargo)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.idGrupoEnumeracionNavigation).WithMany(p => p.enumeraciones)
|
|
.HasForeignKey(d => d.idGrupoEnumeracion)
|
|
.HasConstraintName("enumeraciones_gruposenumeraciones");
|
|
});
|
|
|
|
modelBuilder.Entity<eventos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idEvento).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => new { e.idEntidad, e.Descripcion }, "eventos_descripcion_unique").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idEntidad, "obras_entidades_idx");
|
|
|
|
entity.HasIndex(e => e.CodigoMunicipio, "obras_municipios_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "obras_usuarios_idx");
|
|
|
|
entity.Property(e => e.CodigoMunicipio)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoPostal)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Direccion)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Email)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.PersonaContacto)
|
|
.HasMaxLength(80)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Telefono1)
|
|
.HasMaxLength(20)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Telefono2)
|
|
.HasMaxLength(20)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
|
|
entity.HasOne(d => d.CodigoMunicipioNavigation).WithMany(p => p.eventos)
|
|
.HasForeignKey(d => d.CodigoMunicipio)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("destinosmontajes_municipios");
|
|
|
|
entity.HasOne(d => d.idEntidadNavigation).WithMany(p => p.eventos)
|
|
.HasForeignKey(d => d.idEntidad)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("destinosmontajes_entidades");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.eventos)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.HasConstraintName("destinosmontajes_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<expedientesarticulos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idExpediente).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idEntidad, "expedientes_articulos_idx");
|
|
|
|
entity.HasIndex(e => e.idFichero, "expedientesarticulos_ficheros_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "expedientesarticulos_usuarios_idx");
|
|
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(225)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Fecha).HasColumnType("datetime");
|
|
|
|
entity.HasOne(d => d.idEntidadNavigation).WithMany(p => p.expedientesarticulos)
|
|
.HasForeignKey(d => d.idEntidad)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("expedientesarticulos_articulos");
|
|
|
|
entity.HasOne(d => d.idFicheroNavigation).WithMany(p => p.expedientesarticulos)
|
|
.HasForeignKey(d => d.idFichero)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("expedientesarticulos_ficheros");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.expedientesarticulos)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("expedientesarticulos_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<expedientesentidades>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idExpediente).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idEntidad, "expedientes_entidades_idx");
|
|
|
|
entity.HasIndex(e => e.idFichero, "expedientesentidades_ficheros_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "expedientesentidades_usuarios_idx");
|
|
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(225)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Fecha).HasColumnType("datetime");
|
|
|
|
entity.HasOne(d => d.idEntidadNavigation).WithMany(p => p.expedientesentidades)
|
|
.HasForeignKey(d => d.idEntidad)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("expedientesentidades_entidades");
|
|
|
|
entity.HasOne(d => d.idFicheroNavigation).WithMany(p => p.expedientesentidades)
|
|
.HasForeignKey(d => d.idFichero)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("expedientesentidades_ficheros");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.expedientesentidades)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("expedientesentidades_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<extractosbancarios>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idExtracto).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idCaja, "extractosbancarios_cajas_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "extractosbancarios_usuarios_idx");
|
|
|
|
entity.Property(e => e.FechaLectura).HasColumnType("datetime");
|
|
|
|
entity.HasOne(d => d.idCajaNavigation).WithMany(p => p.extractosbancarios)
|
|
.HasForeignKey(d => d.idCaja)
|
|
.HasConstraintName("extractosbancarios_cajas");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.extractosbancarios)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("extractosbancarios_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<facturas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idFactura).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idDatosClienteOriginal, "facturas_DatosOriginales_idx");
|
|
|
|
entity.HasIndex(e => e.idCliente, "facturas_clientes_idx");
|
|
|
|
entity.HasIndex(e => e.idEvento, "facturas_eventos_idx");
|
|
|
|
entity.HasIndex(e => e.FechaEnvioAsesoria, "facturas_fechaenvioasesoria");
|
|
|
|
entity.HasIndex(e => e.CodigoMunicipio, "facturas_municipios_idx");
|
|
|
|
entity.HasIndex(e => new { e.NumeroFactura, e.idSerieFactura }, "facturas_numerofactura").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idSerieFactura, "facturas_seriesfacturas_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "facturas_usuarios_idx");
|
|
|
|
entity.Property(e => e.BaseImponible1).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.BaseImponible2).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.BaseImponible3).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.CodigoMunicipio)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoPostal)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Direccion)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.FechaEmision).HasColumnType("datetime");
|
|
entity.Property(e => e.FechaEnvioAsesoria).HasColumnType("datetime");
|
|
entity.Property(e => e.NIF)
|
|
.HasMaxLength(20)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.NumeroFactura).HasMaxLength(18);
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.ObservacionesAImprimir)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.PorcentajeIVA1).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.PorcentajeIVA2).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.PorcentajeIVA3).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.RazonSocial)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.CodigoMunicipioNavigation).WithMany(p => p.facturas)
|
|
.HasForeignKey(d => d.CodigoMunicipio)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("facturas_municipios");
|
|
|
|
entity.HasOne(d => d.idClienteNavigation).WithMany(p => p.facturas)
|
|
.HasForeignKey(d => d.idCliente)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("facturas_clientes");
|
|
|
|
entity.HasOne(d => d.idDatosClienteOriginalNavigation).WithMany(p => p.facturas)
|
|
.HasForeignKey(d => d.idDatosClienteOriginal)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("facturas_DatosOriginales");
|
|
|
|
entity.HasOne(d => d.idEventoNavigation).WithMany(p => p.facturas)
|
|
.HasForeignKey(d => d.idEvento)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("facturas_eventos");
|
|
|
|
entity.HasOne(d => d.idSerieFacturaNavigation).WithMany(p => p.facturas)
|
|
.HasForeignKey(d => d.idSerieFactura)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("facturas_seriesfacturas");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.facturas)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("facturas_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<facturasrecibidas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idFactura).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idDatosProveedorOriginal, "facturasrecibidas_DatosOriginales_idx");
|
|
|
|
entity.HasIndex(e => e.idCategoria, "facturasrecibidas_categorias_idx");
|
|
|
|
entity.HasIndex(e => e.FechaEnvioAsesoria, "facturasrecibidas_fechaenvioasesoria");
|
|
|
|
entity.HasIndex(e => e.idFichero, "facturasrecibidas_ficheros_idx");
|
|
|
|
entity.HasIndex(e => new { e.NumeroFactura, e.idProveedor }, "facturasrecibidas_proveedor").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idProveedor, "facturasrecibidas_proveedores_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "facturasrecibidas_usuarios_idx");
|
|
|
|
entity.Property(e => e.BaseImponible1).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.BaseImponible2).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.BaseImponible3).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.CodigoMunicipio)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoPostal)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Direccion)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.FechaEnvioAsesoria).HasColumnType("datetime");
|
|
entity.Property(e => e.NIF)
|
|
.HasMaxLength(20)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.NumeroFactura)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.PorcentajeIVA1).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.PorcentajeIVA2).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.PorcentajeIVA3).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.RazonSocial)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.idCategoriaNavigation).WithMany(p => p.facturasrecibidas)
|
|
.HasForeignKey(d => d.idCategoria)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("facturasrecibidas_categorias");
|
|
|
|
entity.HasOne(d => d.idDatosProveedorOriginalNavigation).WithMany(p => p.facturasrecibidasidDatosProveedorOriginalNavigation)
|
|
.HasForeignKey(d => d.idDatosProveedorOriginal)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("facturasrecibidas_DatosOriginales");
|
|
|
|
entity.HasOne(d => d.idFicheroNavigation).WithMany(p => p.facturasrecibidasidFicheroNavigation)
|
|
.HasForeignKey(d => d.idFichero)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("facturasrecibidas_ficheros");
|
|
|
|
entity.HasOne(d => d.idProveedorNavigation).WithMany(p => p.facturasrecibidas)
|
|
.HasForeignKey(d => d.idProveedor)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("facturasrecibidas_proveedores");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.facturasrecibidas)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("facturasrecibidas_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<familias>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idFamilia).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idUsuario, "familias_usuarios_idx");
|
|
|
|
entity.Property(e => e.Codigo).HasMaxLength(10);
|
|
entity.Property(e => e.CuentaContableCompra).HasMaxLength(10);
|
|
entity.Property(e => e.CuentaContableCompraAlquiler).HasMaxLength(10);
|
|
entity.Property(e => e.CuentaContableVenta).HasMaxLength(10);
|
|
entity.Property(e => e.CuentaContableVentaAlquiler).HasMaxLength(10);
|
|
entity.Property(e => e.Descripcion).HasMaxLength(45);
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.familias)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.HasConstraintName("familias_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<ficheros>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idFichero).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Descripcion, "Descripcion");
|
|
|
|
entity.HasIndex(e => e.Fecha, "Fecha");
|
|
|
|
entity.HasIndex(e => e.idTipo, "ficheros_enumeraciones_idx");
|
|
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(80)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Fecha)
|
|
.HasDefaultValueSql("CURRENT_TIMESTAMP")
|
|
.HasColumnType("datetime");
|
|
entity.Property(e => e.NombreFichero)
|
|
.HasMaxLength(100)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(255)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
|
|
entity.HasOne(d => d.idTipoNavigation).WithMany(p => p.ficheros)
|
|
.HasForeignKey(d => d.idTipo)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("ficheros_enumeraciones");
|
|
});
|
|
|
|
modelBuilder.Entity<ficherosadjuntos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idFicheroAdjunto).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idCorreo, "ficherosadjuntos_correos_idx");
|
|
|
|
entity.HasIndex(e => e.idFichero, "ficherosadjuntos_ficheros_idx");
|
|
|
|
entity.HasOne(d => d.idCorreoNavigation).WithMany(p => p.ficherosadjuntos)
|
|
.HasForeignKey(d => d.idCorreo)
|
|
.HasConstraintName("ficherosadjuntos_correos");
|
|
|
|
entity.HasOne(d => d.idFicheroNavigation).WithMany(p => p.ficherosadjuntos)
|
|
.HasForeignKey(d => d.idFichero)
|
|
.HasConstraintName("ficherosadjuntos_ficheros");
|
|
});
|
|
|
|
modelBuilder.Entity<ficherosconfiguracion>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idFicheroConfiguracion).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => new { e.Codigo, e.idUsuario, e.Descripcion }, "Codigo").IsUnique();
|
|
|
|
entity.Property(e => e.Codigo)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Configuracion).HasColumnType("mediumblob");
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
});
|
|
|
|
modelBuilder.Entity<fiestas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idFiesta).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Fecha, "Fecha_UNIQUE").IsUnique();
|
|
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(50)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
});
|
|
|
|
modelBuilder.Entity<gruasparticulares>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idArticulo).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
|
|
|
entity.Property(e => e.idArticulo).ValueGeneratedNever();
|
|
entity.Property(e => e.Codigo).HasMaxLength(45);
|
|
|
|
entity.HasOne(d => d.idArticuloNavigation).WithOne(p => p.gruasparticulares)
|
|
.HasForeignKey<gruasparticulares>(d => d.idArticulo)
|
|
.HasConstraintName("gruasparticulares");
|
|
});
|
|
|
|
modelBuilder.Entity<gruposenumeraciones>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idGrupoEnumeracion).HasName("PRIMARY");
|
|
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(60)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Grupo)
|
|
.HasMaxLength(20)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
});
|
|
|
|
modelBuilder.Entity<gruposusuarios>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idGrupo).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
|
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(45)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
});
|
|
|
|
modelBuilder.Entity<informescontables>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idInforme).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idFichero, "informescontables_ficheros_idx");
|
|
|
|
entity.Property(e => e.Codigo).HasMaxLength(10);
|
|
entity.Property(e => e.Descripcion).HasMaxLength(100);
|
|
|
|
entity.HasOne(d => d.idFicheroNavigation).WithMany(p => p.informescontables)
|
|
.HasForeignKey(d => d.idFichero)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("informescontables_ficheros");
|
|
});
|
|
|
|
modelBuilder.Entity<logs>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idLog).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => new { e.id, e.Aplicacion }, "id");
|
|
|
|
entity.HasIndex(e => e.idLog, "idLog").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idRelacionado, "idRelacionado");
|
|
|
|
entity.Property(e => e.Aplicacion)
|
|
.HasMaxLength(50)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.FechaHora).HasColumnType("datetime");
|
|
entity.Property(e => e.Tabla)
|
|
.HasMaxLength(50)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Tipo)
|
|
.HasMaxLength(20)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Usuario)
|
|
.HasMaxLength(50)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.VersionPrograma)
|
|
.HasMaxLength(20)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.ip)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
});
|
|
|
|
modelBuilder.Entity<marcas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idMarca).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Marca, "Marca_UNIQUE").IsUnique();
|
|
|
|
entity.Property(e => e.Marca).HasMaxLength(45);
|
|
});
|
|
|
|
modelBuilder.Entity<menus>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idMenus).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idPermiso, "menus_permisos_idx");
|
|
|
|
entity.Property(e => e.Accion)
|
|
.HasMaxLength(500)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Ayuda)
|
|
.HasMaxLength(255)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Texto)
|
|
.HasMaxLength(60)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
|
|
entity.HasOne(d => d.idPermisoNavigation).WithMany(p => p.menus)
|
|
.HasForeignKey(d => d.idPermiso)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("menus_permisos");
|
|
});
|
|
|
|
modelBuilder.Entity<movimientosbancarios>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idMovimientoBancario).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idConciliacion, "movimientosbancarios_conciliaciones_idx");
|
|
|
|
entity.HasIndex(e => e.idExtractoBancario, "movimientosbancarios_extractosbancarios_idx");
|
|
|
|
entity.Property(e => e.CodigoConcepto)
|
|
.HasMaxLength(2)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.ConceptoPropio)
|
|
.HasMaxLength(3)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Detalle)
|
|
.HasMaxLength(500)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.NumeroDocumento)
|
|
.HasMaxLength(10)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.ReferenciaBanco)
|
|
.HasMaxLength(50)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
|
|
entity.HasOne(d => d.idConciliacionNavigation).WithMany(p => p.movimientosbancarios)
|
|
.HasForeignKey(d => d.idConciliacion)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("movimientosbancarios_conciliaciones");
|
|
|
|
entity.HasOne(d => d.idExtractoBancarioNavigation).WithMany(p => p.movimientosbancarios)
|
|
.HasForeignKey(d => d.idExtractoBancario)
|
|
.HasConstraintName("movimientosbancarios_extractosbancarios");
|
|
});
|
|
|
|
modelBuilder.Entity<movimientoscaja>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idMovimiento).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.FechaSupervision, "FechaSupervision");
|
|
|
|
entity.HasIndex(e => e.NumeroRecibo, "NumeroRecibo_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idUsuarioSupervisa, "movimientoscaja_01_usuariossupervisor_idx");
|
|
|
|
entity.HasIndex(e => e.idCaja, "movimientoscaja_cajas_idx");
|
|
|
|
entity.HasIndex(e => e.idConciliacion, "movimientoscaja_conciliacionesbancarias_idx");
|
|
|
|
entity.HasIndex(e => e.idFactura, "movimientoscaja_facturas_idx");
|
|
|
|
entity.HasIndex(e => e.idFacturaRecibida, "movimientoscaja_facturasrecibidas_idx");
|
|
|
|
entity.HasIndex(e => e.idFichero, "movimientoscaja_ficheros_idx");
|
|
|
|
entity.HasIndex(e => e.idMovimientoCierre, "movimientoscaja_movimientoscaja_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "movimientoscaja_usuarios_idx");
|
|
|
|
entity.Property(e => e.DocumentoPago)
|
|
.HasMaxLength(50)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Fecha).HasColumnType("datetime");
|
|
entity.Property(e => e.FechaCreacion).HasColumnType("datetime");
|
|
entity.Property(e => e.FechaSupervision).HasColumnType("datetime");
|
|
entity.Property(e => e.NumeroRecibo).HasMaxLength(22);
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.idCajaNavigation).WithMany(p => p.movimientoscaja)
|
|
.HasForeignKey(d => d.idCaja)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("movimientoscaja_cajas");
|
|
|
|
entity.HasOne(d => d.idConciliacionNavigation).WithMany(p => p.movimientoscaja)
|
|
.HasForeignKey(d => d.idConciliacion)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("movimientoscaja_conciliacionesbancarias");
|
|
|
|
entity.HasOne(d => d.idFacturaNavigation).WithMany(p => p.movimientoscaja)
|
|
.HasForeignKey(d => d.idFactura)
|
|
.HasConstraintName("movimientoscaja_facturas");
|
|
|
|
entity.HasOne(d => d.idFacturaRecibidaNavigation).WithMany(p => p.movimientoscaja)
|
|
.HasForeignKey(d => d.idFacturaRecibida)
|
|
.HasConstraintName("movimientoscaja_facturasrecibidas");
|
|
|
|
entity.HasOne(d => d.idFicheroNavigation).WithMany(p => p.movimientoscaja)
|
|
.HasForeignKey(d => d.idFichero)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("movimientoscaja_ficheros");
|
|
|
|
entity.HasOne(d => d.idMovimientoCierreNavigation).WithMany(p => p.InverseidMovimientoCierreNavigation)
|
|
.HasForeignKey(d => d.idMovimientoCierre)
|
|
.HasConstraintName("movimientoscaja_movimientoscaja");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.movimientoscajaidUsuarioNavigation)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("movimientoscaja_00_usuarios");
|
|
|
|
entity.HasOne(d => d.idUsuarioSupervisaNavigation).WithMany(p => p.movimientoscajaidUsuarioSupervisaNavigation)
|
|
.HasForeignKey(d => d.idUsuarioSupervisa)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("movimientoscaja_01_usuariossupervisor");
|
|
});
|
|
|
|
modelBuilder.Entity<municipios>(entity =>
|
|
{
|
|
entity.HasKey(e => e.CodigoMunicipio).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.CodigoMunicipio, "CodigoMunicipio_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.CodigoProvincia, "municipios_provincias_idx");
|
|
|
|
entity.Property(e => e.CodigoMunicipio)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoProvincia)
|
|
.HasMaxLength(2)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.DC)
|
|
.HasMaxLength(2)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Nombre)
|
|
.HasMaxLength(80)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.CodigoProvinciaNavigation).WithMany(p => p.municipios)
|
|
.HasForeignKey(d => d.CodigoProvincia)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("municipios_provincias");
|
|
});
|
|
|
|
modelBuilder.Entity<permisos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idPermiso).HasName("PRIMARY");
|
|
|
|
entity.Property(e => e.CodigoPermiso)
|
|
.HasMaxLength(50)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(100)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
});
|
|
|
|
modelBuilder.Entity<plantillas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idPlantilla).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.Descripcion, "DescripcionPlantilla_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idEmpresa, "plantillas_empresas_idx");
|
|
|
|
entity.HasIndex(e => e.idFichero, "plantillas_ficheros_idx");
|
|
|
|
entity.HasIndex(e => e.idGrupo, "plantillas_grupo_idx");
|
|
|
|
entity.HasIndex(e => e.idPermiso, "plantillas_permisos_idx");
|
|
|
|
entity.HasIndex(e => e.idTipo, "plantillas_tipo_idx");
|
|
|
|
entity.Property(e => e.Codigo)
|
|
.HasMaxLength(30)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(80)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(255)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.idEmpresa).HasDefaultValueSql("'0'");
|
|
|
|
entity.HasOne(d => d.idEmpresaNavigation).WithMany(p => p.plantillas)
|
|
.HasForeignKey(d => d.idEmpresa)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("plantillas_empresas");
|
|
|
|
entity.HasOne(d => d.idFicheroNavigation).WithMany(p => p.plantillas)
|
|
.HasForeignKey(d => d.idFichero)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("plantillas_ficheros");
|
|
|
|
entity.HasOne(d => d.idGrupoNavigation).WithMany(p => p.plantillas)
|
|
.HasForeignKey(d => d.idGrupo)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("plantillas_grupo");
|
|
|
|
entity.HasOne(d => d.idPermisoNavigation).WithMany(p => p.plantillas)
|
|
.HasForeignKey(d => d.idPermiso)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("plantillas_permisos");
|
|
});
|
|
|
|
modelBuilder.Entity<presupuestos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idPresupuesto).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idDatosClienteOriginal, "presupuestos_DatosOriginales_idx");
|
|
|
|
entity.HasIndex(e => e.idCliente, "presupuestos_clientes_idx");
|
|
|
|
entity.HasIndex(e => e.idEvento, "presupuestos_obras_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuario, "presupuestos_usuarios_idx");
|
|
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(255)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.idClienteNavigation).WithMany(p => p.presupuestos)
|
|
.HasForeignKey(d => d.idCliente)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("presupuestos_clientes");
|
|
|
|
entity.HasOne(d => d.idDatosClienteOriginalNavigation).WithMany(p => p.presupuestos)
|
|
.HasForeignKey(d => d.idDatosClienteOriginal)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("presupuestos_DatosOriginales");
|
|
|
|
entity.HasOne(d => d.idEventoNavigation).WithMany(p => p.presupuestos)
|
|
.HasForeignKey(d => d.idEvento)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("presupuestos_eventos");
|
|
|
|
entity.HasOne(d => d.idUsuarioNavigation).WithMany(p => p.presupuestos)
|
|
.HasForeignKey(d => d.idUsuario)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("presupuestos_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<procesos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idProceso).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idTipo, "procesos_01_Tipo_idx");
|
|
|
|
entity.HasIndex(e => e.idSubtipo, "procesos_02_SubTipo_idx");
|
|
|
|
entity.HasIndex(e => e.idFichero, "procesos_permisos_idx");
|
|
|
|
entity.HasIndex(e => e.idPermiso, "procesos_permisos_idx1");
|
|
|
|
entity.Property(e => e.Accion)
|
|
.HasMaxLength(512)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(255)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(512)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
|
|
entity.HasOne(d => d.idFicheroNavigation).WithMany(p => p.procesos)
|
|
.HasForeignKey(d => d.idFichero)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("procesos_ficheros");
|
|
|
|
entity.HasOne(d => d.idPermisoNavigation).WithMany(p => p.procesos)
|
|
.HasForeignKey(d => d.idPermiso)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("procesos_permisos");
|
|
|
|
entity.HasOne(d => d.idSubtipoNavigation).WithMany(p => p.procesosidSubtipoNavigation)
|
|
.HasForeignKey(d => d.idSubtipo)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("procesos_02_SubTipo");
|
|
|
|
entity.HasOne(d => d.idTipoNavigation).WithMany(p => p.procesosidTipoNavigation)
|
|
.HasForeignKey(d => d.idTipo)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("procesos_01_Tipo");
|
|
});
|
|
|
|
modelBuilder.Entity<productos>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idProducto).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.DescripcionAbreviada, "DescripcionAbreviada_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idUsuarioCreador, "productos_01_usuarios_idx");
|
|
|
|
entity.HasIndex(e => e.idUsuarioModificador, "productos_02_usuarios_idx");
|
|
|
|
entity.HasIndex(e => e.idEmpresa, "productos_empresas_idx");
|
|
|
|
entity.HasIndex(e => e.idFamilia, "productos_familias_idx");
|
|
|
|
entity.HasIndex(e => e.idMarca, "productos_marcas_idx");
|
|
|
|
entity.Property(e => e.Codigo).HasMaxLength(40);
|
|
entity.Property(e => e.CodigoBarras).HasMaxLength(16);
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(100)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.DescripcionAbreviada).HasMaxLength(45);
|
|
entity.Property(e => e.FechaBaja).HasColumnType("datetime");
|
|
entity.Property(e => e.Modelo).HasMaxLength(50);
|
|
entity.Property(e => e.Observaciones)
|
|
.HasMaxLength(300)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.PrecioVenta).HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.PrefijoNumeroSerie).HasMaxLength(8);
|
|
entity.Property(e => e.ReferenciaFabrica).HasMaxLength(45);
|
|
|
|
entity.HasOne(d => d.idEmpresaNavigation).WithMany(p => p.productos)
|
|
.HasForeignKey(d => d.idEmpresa)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("productos_empresas");
|
|
|
|
entity.HasOne(d => d.idFamiliaNavigation).WithMany(p => p.productos)
|
|
.HasForeignKey(d => d.idFamilia)
|
|
.HasConstraintName("productos_familias");
|
|
|
|
entity.HasOne(d => d.idMarcaNavigation).WithMany(p => p.productos)
|
|
.HasForeignKey(d => d.idMarca)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("productos_marcas");
|
|
|
|
entity.HasOne(d => d.idUsuarioCreadorNavigation).WithMany(p => p.productosidUsuarioCreadorNavigation)
|
|
.HasForeignKey(d => d.idUsuarioCreador)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("productos_01_usuarios");
|
|
|
|
entity.HasOne(d => d.idUsuarioModificadorNavigation).WithMany(p => p.productosidUsuarioModificadorNavigation)
|
|
.HasForeignKey(d => d.idUsuarioModificador)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("productos_02_usuarios");
|
|
});
|
|
|
|
modelBuilder.Entity<provincias>(entity =>
|
|
{
|
|
entity.HasKey(e => e.CodigoProvincia).HasName("PRIMARY");
|
|
|
|
entity.Property(e => e.CodigoProvincia)
|
|
.HasMaxLength(2)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Nombre)
|
|
.HasMaxLength(80)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
});
|
|
|
|
modelBuilder.Entity<seriesfacturas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idSerieFactura).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idEmpresa, "seriesfacturas_empresas_idx");
|
|
|
|
entity.HasIndex(e => new { e.Serie, e.idEmpresa }, "seriesfacturas_empresas_uq").IsUnique();
|
|
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.NumeroDigitos).HasDefaultValueSql("'6'");
|
|
entity.Property(e => e.Serie)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
|
|
entity.HasOne(d => d.idEmpresaNavigation).WithMany(p => p.seriesfacturas)
|
|
.HasForeignKey(d => d.idEmpresa)
|
|
.OnDelete(DeleteBehavior.ClientSetNull)
|
|
.HasConstraintName("seriesfacturas_empresas");
|
|
});
|
|
|
|
modelBuilder.Entity<stocks>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idStock).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => new { e.idAlmacen, e.idProducto }, "stocks_almacenes_productos_unq").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idProducto, "stocks_productos_idx");
|
|
|
|
entity.HasIndex(e => e.idAlmacen, "stocls_almacenes_idx");
|
|
|
|
entity.HasOne(d => d.idAlmacenNavigation).WithMany(p => p.stocks)
|
|
.HasForeignKey(d => d.idAlmacen)
|
|
.HasConstraintName("stocks_almacenes");
|
|
|
|
entity.HasOne(d => d.idProductoNavigation).WithMany(p => p.stocks)
|
|
.HasForeignKey(d => d.idProducto)
|
|
.HasConstraintName("stocks_productos");
|
|
});
|
|
|
|
modelBuilder.Entity<tablaalturas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idAltura).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idProducto, "FK_tablaalturas_productos_idx");
|
|
|
|
entity.HasIndex(e => e.idVersion, "FK_tablaalturas_versionesgruas_idx");
|
|
|
|
entity.Property(e => e.Observaciones).HasMaxLength(50);
|
|
|
|
entity.HasOne(d => d.idProductoNavigation).WithMany(p => p.tablaalturas)
|
|
.HasForeignKey(d => d.idProducto)
|
|
.HasConstraintName("FK_tablaalturas_productos");
|
|
|
|
entity.HasOne(d => d.idVersionNavigation).WithMany(p => p.tablaalturas)
|
|
.HasForeignKey(d => d.idVersion)
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.HasConstraintName("FK_tablaalturas_versionesgruas");
|
|
});
|
|
|
|
modelBuilder.Entity<tablaplumas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idPluma).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idProducto, "FK_tablaplumas_productos_idx");
|
|
|
|
entity.Property(e => e.Observaciones).HasMaxLength(50);
|
|
|
|
entity.HasOne(d => d.idProductoNavigation).WithMany(p => p.tablaplumas)
|
|
.HasForeignKey(d => d.idProducto)
|
|
.HasConstraintName("FK_tablaplumas_productos");
|
|
});
|
|
|
|
modelBuilder.Entity<tablas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idTabla).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
|
|
|
entity.Property(e => e.Codigo)
|
|
.HasMaxLength(20)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Descripcion)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
});
|
|
|
|
modelBuilder.Entity<tiposofertas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idTipoOferta).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Codigo, "Codigo_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.Descripcion, "Descripcion_UNIQUE").IsUnique();
|
|
|
|
entity.Property(e => e.Codigo).HasMaxLength(10);
|
|
entity.Property(e => e.Descripcion).HasMaxLength(60);
|
|
});
|
|
|
|
modelBuilder.Entity<trabajadores>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idTrabajador).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.RequiereFormato, "RequiereFormato_UNIQUE").IsUnique();
|
|
|
|
entity.Property(e => e.Apellidos)
|
|
.HasMaxLength(100)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.CIF)
|
|
.HasMaxLength(20)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.CorreoElectronico)
|
|
.HasMaxLength(60)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Domicilio).HasMaxLength(100);
|
|
entity.Property(e => e.Fax).HasMaxLength(20);
|
|
entity.Property(e => e.IBAN).HasMaxLength(35);
|
|
entity.Property(e => e.Iniciales).HasMaxLength(2);
|
|
entity.Property(e => e.Login).HasMaxLength(45);
|
|
entity.Property(e => e.Nombre)
|
|
.HasMaxLength(45)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.NumeroSeguridadSocial).HasMaxLength(14);
|
|
entity.Property(e => e.Observacion).HasMaxLength(100);
|
|
entity.Property(e => e.RequiereFormato).HasDefaultValueSql("b'0'");
|
|
entity.Property(e => e.Situacion).HasMaxLength(2);
|
|
entity.Property(e => e.Telefono1)
|
|
.HasMaxLength(20)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Telefono2)
|
|
.HasMaxLength(20)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
});
|
|
|
|
modelBuilder.Entity<usuarios>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idUsuario).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.Usuario, "Usuario_UNIQUE").IsUnique();
|
|
|
|
entity.HasIndex(e => e.idTema, "Usuarios_Temas_idx");
|
|
|
|
entity.HasIndex(e => e.idGrupo, "usuarios_gruposmenus");
|
|
|
|
entity.Property(e => e.Nombre)
|
|
.HasMaxLength(100)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.SHA1Passwd)
|
|
.HasMaxLength(40)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Usuario)
|
|
.HasMaxLength(30)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
|
|
entity.HasOne(d => d.idGrupoNavigation).WithMany(p => p.usuarios)
|
|
.HasForeignKey(d => d.idGrupo)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("Usuarios_GruposUsuarios");
|
|
|
|
entity.HasOne(d => d.idTemaNavigation).WithMany(p => p.usuarios)
|
|
.HasForeignKey(d => d.idTema)
|
|
.OnDelete(DeleteBehavior.SetNull)
|
|
.HasConstraintName("Usuarios_Temas");
|
|
});
|
|
|
|
modelBuilder.Entity<v_albaranesextendidos>(entity =>
|
|
{
|
|
entity
|
|
.HasNoKey()
|
|
.ToView("v_albaranesextendidos");
|
|
|
|
entity.Property(e => e.Cargadores)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoMunicipioCarga)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoMunicipioDescarga)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoMunicipioEvento)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoPostalCarga)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoPostalDescarga)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoPostalEvento)
|
|
.HasMaxLength(10)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.CodigoUsuario)
|
|
.HasMaxLength(30)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Descargadores)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.DescripcionEvento)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.DireccionEvento)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Email)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.EmailCarga)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.EmailDescarga)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.FechaCarga).HasColumnType("datetime");
|
|
entity.Property(e => e.FechaDescarga).HasColumnType("datetime");
|
|
entity.Property(e => e.LugarCarga)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.LugarDescarga)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.NIF)
|
|
.HasMaxLength(20)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.ObservacionesEvento)
|
|
.HasMaxLength(200)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.PersonaContactoEvento)
|
|
.HasMaxLength(80)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.RazonSocial)
|
|
.HasMaxLength(100)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono1)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono1Carga)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono1Descarga)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono1Evento)
|
|
.HasMaxLength(20)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Telefono2)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono2Carga)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono2Descarga)
|
|
.HasMaxLength(30)
|
|
.UseCollation("utf8mb3_general_ci")
|
|
.HasCharSet("utf8mb3");
|
|
entity.Property(e => e.Telefono2Evento)
|
|
.HasMaxLength(20)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.Usuario)
|
|
.HasMaxLength(100)
|
|
.UseCollation("latin1_swedish_ci")
|
|
.HasCharSet("latin1");
|
|
entity.Property(e => e.idEvento).HasDefaultValueSql("'0'");
|
|
});
|
|
|
|
modelBuilder.Entity<v_apuntesagrupados>(entity =>
|
|
{
|
|
entity
|
|
.HasNoKey()
|
|
.ToView("v_apuntesagrupados");
|
|
});
|
|
|
|
modelBuilder.Entity<v_apuntesextendidos>(entity =>
|
|
{
|
|
entity
|
|
.HasNoKey()
|
|
.ToView("v_apuntesextendidos");
|
|
|
|
entity.Property(e => e.Concepto).HasMaxLength(200);
|
|
entity.Property(e => e.FechaPunteo).HasColumnType("datetime");
|
|
entity.Property(e => e.NumeroDocumento).HasMaxLength(30);
|
|
});
|
|
|
|
modelBuilder.Entity<versionesgruas>(entity =>
|
|
{
|
|
entity.HasKey(e => e.idVersion).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.idProducto, "versiones_productos_idx");
|
|
|
|
entity.Property(e => e.Observaciones).HasMaxLength(50);
|
|
|
|
entity.HasOne(d => d.idProductoNavigation).WithMany(p => p.versionesgruas)
|
|
.HasForeignKey(d => d.idProducto)
|
|
.HasConstraintName("FK_versionesgruas_productos");
|
|
});
|
|
|
|
modelBuilder.Entity<vf_cuentas>(entity =>
|
|
{
|
|
entity
|
|
.HasNoKey()
|
|
.ToView("vf_cuentas");
|
|
|
|
entity.Property(e => e.Denominacion)
|
|
.HasMaxLength(150)
|
|
.HasDefaultValueSql("'0'");
|
|
entity.Property(e => e.Ejercicio).HasMaxLength(40);
|
|
entity.Property(e => e.Mote).HasMaxLength(40);
|
|
entity.Property(e => e.NumeroCuenta).HasMaxLength(10);
|
|
entity.Property(e => e.Observaciones).HasMaxLength(200);
|
|
});
|
|
|
|
OnModelCreatingPartial(modelBuilder);
|
|
}
|
|
|
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
|
}
|