...
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Hushian.Domain.Entites;
|
||||
using Identity.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
|
||||
@@ -7,30 +8,40 @@ namespace Hushian.Persistence
|
||||
public class HushianDbContext : DbContext
|
||||
{
|
||||
public HushianDbContext(DbContextOptions<HushianDbContext> options)
|
||||
:base(options)
|
||||
: base(options)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
#region Table
|
||||
public DbSet<Company> Companies { get; set; }
|
||||
public DbSet<Conversation> Conversations { get; set; }
|
||||
public DbSet<ConversationResponse> ConversationItems { get; set; }
|
||||
public DbSet<Group> Groups { get; set; }
|
||||
public DbSet<Exper> Expers { get; set; }
|
||||
public DbSet<ExperGroup> EG { get; set; }
|
||||
public DbSet<Company> Companies { get; set; }
|
||||
public DbSet<Conversation> Conversations { get; set; }
|
||||
public DbSet<ConversationResponse> ConversationItems { get; set; }
|
||||
public DbSet<Group> Groups { get; set; }
|
||||
public DbSet<Exper> Expers { get; set; }
|
||||
public DbSet<ExperGroup> EG { get; set; }
|
||||
public DbSet<User> Users { get; set; }
|
||||
public DbSet<VerificationCode > verificationCodes { get; set; }
|
||||
#endregion
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<ExperGroup>().HasKey(c => new { c.ExperID, c.GroupID });
|
||||
modelBuilder.Entity<ExperGroup>().HasOne(eg => eg.Exper)
|
||||
.WithMany(e => e.EG)
|
||||
.HasForeignKey(eg => eg.ExperID)
|
||||
.OnDelete(DeleteBehavior.ClientCascade);
|
||||
|
||||
modelBuilder.Entity<ExperGroup>()
|
||||
.HasOne(eg => eg.Group)
|
||||
.WithMany(g => g.EG)
|
||||
.HasForeignKey(eg => eg.GroupID)
|
||||
.OnDelete(DeleteBehavior.ClientCascade);
|
||||
modelBuilder
|
||||
.ApplyConfigurationsFromAssembly(typeof(HushianDbContext).Assembly);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
425
Infrastructure/Persistence/Migrations/20250724132732_InitalDB.Designer.cs
generated
Normal file
425
Infrastructure/Persistence/Migrations/20250724132732_InitalDB.Designer.cs
generated
Normal file
@@ -0,0 +1,425 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Hushian.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
[DbContext(typeof(HushianDbContext))]
|
||||
[Migration("20250724132732_InitalDB")]
|
||||
partial class InitalDB
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullNameManager")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Verified")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("WebSite")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("allowBot")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<byte[]>("logo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("CompanyContentInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("FinishedDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("Conversations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ConversationID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<byte[]>("FileContent")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("FileName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FileType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsRead")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ReadDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("ConversationID");
|
||||
|
||||
b.HasIndex("ExperID");
|
||||
|
||||
b.ToTable("ConversationItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Expers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.Property<int>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("ExperID", "GroupID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.ToTable("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<byte[]>("img")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "company")
|
||||
.WithMany("CompanyContentInfos")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany()
|
||||
.HasForeignKey("GroupID");
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.User", "User")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
|
||||
b.Navigation("Group");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Conversation", "conversation")
|
||||
.WithMany("ConversationResponses")
|
||||
.HasForeignKey("ConversationID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany()
|
||||
.HasForeignKey("ExperID");
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("conversation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Expers")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("ExperID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("GroupID")
|
||||
.OnDelete(DeleteBehavior.NoAction)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("Group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Groups")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Navigation("CompanyContentInfos");
|
||||
|
||||
b.Navigation("Conversations");
|
||||
|
||||
b.Navigation("Expers");
|
||||
|
||||
b.Navigation("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Navigation("ConversationResponses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Navigation("Conversations");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
287
Infrastructure/Persistence/Migrations/20250724132732_InitalDB.cs
Normal file
287
Infrastructure/Persistence/Migrations/20250724132732_InitalDB.cs
Normal file
@@ -0,0 +1,287 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitalDB : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Companies",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Password = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FullName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FullNameManager = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
WebSite = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
logo = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
||||
Available = table.Column<bool>(type: "bit", nullable: false),
|
||||
allowBot = table.Column<bool>(type: "bit", nullable: false),
|
||||
Verified = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Companies", x => x.ID);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
FullName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.ID);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CompanyContentInfo",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CompanyID = table.Column<int>(type: "int", nullable: false),
|
||||
Content = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CompanyContentInfo", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_CompanyContentInfo_Companies_CompanyID",
|
||||
column: x => x.CompanyID,
|
||||
principalTable: "Companies",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Expers",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CompanyID = table.Column<int>(type: "int", nullable: false),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
FullName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
UserName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Password = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Available = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Expers", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_Expers_Companies_CompanyID",
|
||||
column: x => x.CompanyID,
|
||||
principalTable: "Companies",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Groups",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CompanyID = table.Column<int>(type: "int", nullable: false),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
img = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
||||
Info = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Available = table.Column<bool>(type: "bit", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Groups", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_Groups_Companies_CompanyID",
|
||||
column: x => x.CompanyID,
|
||||
principalTable: "Companies",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Conversations",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CompanyID = table.Column<int>(type: "int", nullable: false),
|
||||
UserID = table.Column<int>(type: "int", nullable: false),
|
||||
GroupID = table.Column<int>(type: "int", nullable: true),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
FinishedDateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Conversations", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_Conversations_Companies_CompanyID",
|
||||
column: x => x.CompanyID,
|
||||
principalTable: "Companies",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Conversations_Groups_GroupID",
|
||||
column: x => x.GroupID,
|
||||
principalTable: "Groups",
|
||||
principalColumn: "ID");
|
||||
table.ForeignKey(
|
||||
name: "FK_Conversations_Users_UserID",
|
||||
column: x => x.UserID,
|
||||
principalTable: "Users",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EG",
|
||||
columns: table => new
|
||||
{
|
||||
ExperID = table.Column<int>(type: "int", nullable: false),
|
||||
GroupID = table.Column<int>(type: "int", nullable: false),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EG", x => new { x.ExperID, x.GroupID });
|
||||
table.ForeignKey(
|
||||
name: "FK_EG_Expers_ExperID",
|
||||
column: x => x.ExperID,
|
||||
principalTable: "Expers",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_EG_Groups_GroupID",
|
||||
column: x => x.GroupID,
|
||||
principalTable: "Groups",
|
||||
principalColumn: "ID");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ConversationItems",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
ConversationID = table.Column<int>(type: "int", nullable: false),
|
||||
ExperID = table.Column<int>(type: "int", nullable: true),
|
||||
IsRead = table.Column<bool>(type: "bit", nullable: false),
|
||||
Type = table.Column<int>(type: "int", nullable: false),
|
||||
Text = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FileName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
FileType = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
FileContent = table.Column<byte[]>(type: "varbinary(max)", nullable: true),
|
||||
ReadDateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ConversationItems", x => x.ID);
|
||||
table.ForeignKey(
|
||||
name: "FK_ConversationItems_Conversations_ConversationID",
|
||||
column: x => x.ConversationID,
|
||||
principalTable: "Conversations",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_ConversationItems_Expers_ExperID",
|
||||
column: x => x.ExperID,
|
||||
principalTable: "Expers",
|
||||
principalColumn: "ID");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CompanyContentInfo_CompanyID",
|
||||
table: "CompanyContentInfo",
|
||||
column: "CompanyID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConversationItems_ConversationID",
|
||||
table: "ConversationItems",
|
||||
column: "ConversationID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConversationItems_ExperID",
|
||||
table: "ConversationItems",
|
||||
column: "ExperID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Conversations_CompanyID",
|
||||
table: "Conversations",
|
||||
column: "CompanyID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Conversations_GroupID",
|
||||
table: "Conversations",
|
||||
column: "GroupID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Conversations_UserID",
|
||||
table: "Conversations",
|
||||
column: "UserID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_EG_GroupID",
|
||||
table: "EG",
|
||||
column: "GroupID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Expers_CompanyID",
|
||||
table: "Expers",
|
||||
column: "CompanyID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Groups_CompanyID",
|
||||
table: "Groups",
|
||||
column: "CompanyID");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CompanyContentInfo");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ConversationItems");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EG");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Conversations");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Expers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Groups");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Companies");
|
||||
}
|
||||
}
|
||||
}
|
425
Infrastructure/Persistence/Migrations/20250724140236_changetbeg.Designer.cs
generated
Normal file
425
Infrastructure/Persistence/Migrations/20250724140236_changetbeg.Designer.cs
generated
Normal file
@@ -0,0 +1,425 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Hushian.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
[DbContext(typeof(HushianDbContext))]
|
||||
[Migration("20250724140236_changetbeg")]
|
||||
partial class changetbeg
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullNameManager")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Verified")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("WebSite")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("allowBot")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<byte[]>("logo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("CompanyContentInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("FinishedDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("Conversations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ConversationID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<byte[]>("FileContent")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("FileName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FileType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsRead")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ReadDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("ConversationID");
|
||||
|
||||
b.HasIndex("ExperID");
|
||||
|
||||
b.ToTable("ConversationItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Expers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.Property<int>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("ExperID", "GroupID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.ToTable("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<byte[]>("img")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "company")
|
||||
.WithMany("CompanyContentInfos")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany()
|
||||
.HasForeignKey("GroupID");
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.User", "User")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
|
||||
b.Navigation("Group");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Conversation", "conversation")
|
||||
.WithMany("ConversationResponses")
|
||||
.HasForeignKey("ConversationID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany()
|
||||
.HasForeignKey("ExperID");
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("conversation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Expers")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("ExperID")
|
||||
.OnDelete(DeleteBehavior.ClientCascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("GroupID")
|
||||
.OnDelete(DeleteBehavior.ClientCascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("Group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Groups")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Navigation("CompanyContentInfos");
|
||||
|
||||
b.Navigation("Conversations");
|
||||
|
||||
b.Navigation("Expers");
|
||||
|
||||
b.Navigation("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Navigation("ConversationResponses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Navigation("Conversations");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class changetbeg : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_EG_Expers_ExperID",
|
||||
table: "EG");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_EG_Expers_ExperID",
|
||||
table: "EG",
|
||||
column: "ExperID",
|
||||
principalTable: "Expers",
|
||||
principalColumn: "ID");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_EG_Expers_ExperID",
|
||||
table: "EG");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_EG_Expers_ExperID",
|
||||
table: "EG",
|
||||
column: "ExperID",
|
||||
principalTable: "Expers",
|
||||
principalColumn: "ID",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
452
Infrastructure/Persistence/Migrations/20250724183709_tbverification.Designer.cs
generated
Normal file
452
Infrastructure/Persistence/Migrations/20250724183709_tbverification.Designer.cs
generated
Normal file
@@ -0,0 +1,452 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Hushian.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
[DbContext(typeof(HushianDbContext))]
|
||||
[Migration("20250724183709_tbverification")]
|
||||
partial class tbverification
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullNameManager")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Verified")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("WebSite")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("allowBot")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<byte[]>("logo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("CompanyContentInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("FinishedDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("Conversations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ConversationID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<byte[]>("FileContent")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("FileName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FileType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsRead")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ReadDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("ConversationID");
|
||||
|
||||
b.HasIndex("ExperID");
|
||||
|
||||
b.ToTable("ConversationItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Expers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.Property<int>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("ExperID", "GroupID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.ToTable("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<byte[]>("img")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Identity.Models.VerificationCode", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("verificationCodes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "company")
|
||||
.WithMany("CompanyContentInfos")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany()
|
||||
.HasForeignKey("GroupID");
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.User", "User")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
|
||||
b.Navigation("Group");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Conversation", "conversation")
|
||||
.WithMany("ConversationResponses")
|
||||
.HasForeignKey("ConversationID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany()
|
||||
.HasForeignKey("ExperID");
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("conversation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Expers")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("ExperID")
|
||||
.OnDelete(DeleteBehavior.ClientCascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("GroupID")
|
||||
.OnDelete(DeleteBehavior.ClientCascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("Group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Groups")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Navigation("CompanyContentInfos");
|
||||
|
||||
b.Navigation("Conversations");
|
||||
|
||||
b.Navigation("Expers");
|
||||
|
||||
b.Navigation("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Navigation("ConversationResponses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Navigation("Conversations");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class tbverification : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "verificationCodes",
|
||||
columns: table => new
|
||||
{
|
||||
ID = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Type = table.Column<int>(type: "int", nullable: false),
|
||||
Code = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Cdatetime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_verificationCodes", x => x.ID);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "verificationCodes");
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,449 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Hushian.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Hushian.Persistence.Migrations
|
||||
{
|
||||
[DbContext(typeof(HushianDbContext))]
|
||||
partial class HushianDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FullNameManager")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("Verified")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("WebSite")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("allowBot")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<byte[]>("logo")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Content")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("CompanyContentInfo");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime?>("FinishedDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int?>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("UserID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.HasIndex("UserID");
|
||||
|
||||
b.ToTable("Conversations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ConversationID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<byte[]>("FileContent")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.Property<string>("FileName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FileType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsRead")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime?>("ReadDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Text")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("ConversationID");
|
||||
|
||||
b.HasIndex("ExperID");
|
||||
|
||||
b.ToTable("ConversationItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Expers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.Property<int>("ExperID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GroupID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("ExperID", "GroupID");
|
||||
|
||||
b.HasIndex("GroupID");
|
||||
|
||||
b.ToTable("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<bool>("Available")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CompanyID")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Info")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<byte[]>("img")
|
||||
.HasColumnType("varbinary(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.HasIndex("CompanyID");
|
||||
|
||||
b.ToTable("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("Users");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Identity.Models.VerificationCode", b =>
|
||||
{
|
||||
b.Property<int>("ID")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
||||
|
||||
b.Property<DateTime>("Cdatetime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("ID");
|
||||
|
||||
b.ToTable("verificationCodes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "company")
|
||||
.WithMany("CompanyContentInfos")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany()
|
||||
.HasForeignKey("GroupID");
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.User", "User")
|
||||
.WithMany("Conversations")
|
||||
.HasForeignKey("UserID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
|
||||
b.Navigation("Group");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Conversation", "conversation")
|
||||
.WithMany("ConversationResponses")
|
||||
.HasForeignKey("ConversationID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany()
|
||||
.HasForeignKey("ExperID");
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("conversation");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Expers")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Exper", "Exper")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("ExperID")
|
||||
.OnDelete(DeleteBehavior.ClientCascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Hushian.Domain.Entites.Group", "Group")
|
||||
.WithMany("EG")
|
||||
.HasForeignKey("GroupID")
|
||||
.OnDelete(DeleteBehavior.ClientCascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Exper");
|
||||
|
||||
b.Navigation("Group");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.HasOne("Hushian.Domain.Entites.Company", "Company")
|
||||
.WithMany("Groups")
|
||||
.HasForeignKey("CompanyID")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Company");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Company", b =>
|
||||
{
|
||||
b.Navigation("CompanyContentInfos");
|
||||
|
||||
b.Navigation("Conversations");
|
||||
|
||||
b.Navigation("Expers");
|
||||
|
||||
b.Navigation("Groups");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>
|
||||
{
|
||||
b.Navigation("ConversationResponses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Exper", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.Group", b =>
|
||||
{
|
||||
b.Navigation("EG");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Hushian.Domain.Entites.User", b =>
|
||||
{
|
||||
b.Navigation("Conversations");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user