106 lines
3.6 KiB
C#
106 lines
3.6 KiB
C#
// <auto-generated> This file has been auto generated by EF Core Power Tools. </autogenerated>
|
|
#nullable enable
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using bdEmtusa.db;
|
|
|
|
namespace bdEmtusa.dbcontext;
|
|
|
|
public partial class EmtusaContext : DbContext
|
|
{
|
|
public EmtusaContext(DbContextOptions<EmtusaContext> options)
|
|
: base(options)
|
|
{
|
|
}
|
|
|
|
public virtual DbSet<channels> channels { get; set; }
|
|
|
|
public virtual DbSet<configuracion> configuracion { get; set; }
|
|
|
|
public virtual DbSet<historico> historico { get; set; }
|
|
|
|
public virtual DbSet<items> items { get; set; }
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder
|
|
.UseCollation("utf8mb4_0900_ai_ci")
|
|
.HasCharSet("utf8mb4");
|
|
|
|
modelBuilder.Entity<channels>(entity =>
|
|
{
|
|
entity.HasKey(e => e.id).HasName("PRIMARY");
|
|
|
|
entity.Property(e => e.creacion)
|
|
.HasDefaultValueSql("CURRENT_TIMESTAMP")
|
|
.HasColumnType("datetime");
|
|
entity.Property(e => e.description).HasMaxLength(1024);
|
|
entity.Property(e => e.generator).HasMaxLength(128);
|
|
entity.Property(e => e.language).HasMaxLength(8);
|
|
entity.Property(e => e.lastBuildDate).HasColumnType("datetime");
|
|
entity.Property(e => e.link).HasMaxLength(4096);
|
|
entity.Property(e => e.modificacion)
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("datetime");
|
|
entity.Property(e => e.title).HasMaxLength(128);
|
|
});
|
|
|
|
modelBuilder.Entity<configuracion>(entity =>
|
|
{
|
|
entity.HasKey(e => e.id).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.codigo, "index_codigo").IsUnique();
|
|
|
|
entity.Property(e => e.codigo)
|
|
.HasMaxLength(128)
|
|
.HasDefaultValueSql("''");
|
|
entity.Property(e => e.grupo).HasMaxLength(128);
|
|
entity.Property(e => e.valor)
|
|
.HasMaxLength(1024)
|
|
.HasDefaultValueSql("''");
|
|
});
|
|
|
|
modelBuilder.Entity<historico>(entity =>
|
|
{
|
|
entity.HasKey(e => e.id).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.id_channel, "historico_fk_id_channel");
|
|
|
|
entity.HasIndex(e => e.id_item, "historico_fk_id_item");
|
|
|
|
entity.Property(e => e.fechaHora)
|
|
.HasDefaultValueSql("CURRENT_TIMESTAMP")
|
|
.HasColumnType("datetime");
|
|
});
|
|
|
|
modelBuilder.Entity<items>(entity =>
|
|
{
|
|
entity.HasKey(e => e.id).HasName("PRIMARY");
|
|
|
|
entity.HasIndex(e => e.id_channel, "FK_id_channel");
|
|
|
|
entity.Property(e => e.category).HasMaxLength(64);
|
|
entity.Property(e => e.creacion)
|
|
.HasDefaultValueSql("CURRENT_TIMESTAMP")
|
|
.HasColumnType("datetime");
|
|
entity.Property(e => e.guid).HasMaxLength(4096);
|
|
entity.Property(e => e.link).HasMaxLength(4096);
|
|
entity.Property(e => e.modificacion)
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("datetime");
|
|
entity.Property(e => e.pubDate).HasColumnType("datetime");
|
|
entity.Property(e => e.title).HasMaxLength(1024);
|
|
|
|
entity.HasOne(d => d.id_channelNavigation).WithMany(p => p.items)
|
|
.HasForeignKey(d => d.id_channel)
|
|
.HasConstraintName("FK_id_channel");
|
|
});
|
|
|
|
OnModelCreatingPartial(modelBuilder);
|
|
}
|
|
|
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
|
}
|