primera version estable
This commit is contained in:
105
bdEmtusa/dbcontext/EmtusaContext.cs
Normal file
105
bdEmtusa/dbcontext/EmtusaContext.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
// <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);
|
||||
}
|
||||
Reference in New Issue
Block a user