Update Happiness Task

This commit is contained in:
Chris Chen
2022-10-02 09:50:42 -07:00
parent b33c0d8286
commit f9a5dc5e34
43 changed files with 4904 additions and 623 deletions
+2 -3
View File
@@ -97,8 +97,8 @@ namespace Church.Net.DAL.EF
modelBuilder.Entity<PastoralDomainAutoReplys>()
.HasOne(tt => tt.PastoralDomain)
.WithMany(t => t.AutoReplyItemRelations)
.HasForeignKey(tt => tt.PastoralDomainCommunityAppId)
.HasPrincipalKey(tt => tt.CommunityAppId);
.HasForeignKey(tt => tt.PastoralDomainCommunityAppId);
//.HasPrincipalKey(tt => tt.L);
//modelBuilder.Entity<PastoralDomainMembers>()
// .HasOne(t => t.PastoralDomain)
@@ -126,7 +126,6 @@ namespace Church.Net.DAL.EF
public DbSet<PastoralDomain> PastoralDomains { get; set; }
public DbSet<WhoIsSpy> WhoIsSpy { get; set; }
public DbSet<Vocabulary> Vocabulary { get; set; }
public DbSet<HappinessGroup> HappinessGroups { get; set; }
public DbSet<HappinessBEST> HappinessBESTs { get; set; }
public DbSet<HappinessWeek> HappinessWeeks { get; set; }
public DbSet<CellGroupRoutineEvent> CellGroupRoutineEvents { get; set; }
@@ -0,0 +1,884 @@
// <auto-generated />
using System;
using Church.Net.DAL.EF;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
[DbContext(typeof(ChurchNetContext))]
[Migration("20221001111411_AddLineId")]
partial class AddLineId
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Church.Net.Entity.AddressInfo", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("City")
.HasColumnType("text");
b.Property<string>("State")
.HasColumnType("text");
b.Property<string>("Zip")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("AddressInfos");
});
modelBuilder.Entity("Church.Net.Entity.AutoReplyItem", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Command")
.HasColumnType("text");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("AutoReplyItems");
});
modelBuilder.Entity("Church.Net.Entity.Career", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.ToTable("Careers");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("PastoralDomainId")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("PastoralDomainId");
b.ToTable("CellGroupRoutineEvents");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventAttendee", b =>
{
b.Property<string>("EventId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("Id")
.HasColumnType("text")
.HasColumnOrder(1);
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<bool>("JoinPotluck")
.HasColumnType("boolean");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("PotluckItem")
.HasColumnType("text");
b.HasKey("EventId", "Id");
b.ToTable("CellGroupRoutineEventAttendees");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventPrayer", b =>
{
b.Property<string>("EventId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("MemberId")
.HasColumnType("text")
.HasColumnOrder(1);
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("Prayer")
.HasColumnType("text");
b.HasKey("EventId", "MemberId");
b.ToTable("CellGroupRoutineEventPrayers");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMember", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("AvatarImage")
.HasColumnType("text");
b.Property<bool>("Baptized")
.HasColumnType("boolean");
b.Property<DateTime?>("Birthday")
.HasColumnType("timestamp with time zone");
b.Property<string>("CareerId")
.HasColumnType("text");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("ComunityAppId")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTime?>("DateOfBaptized")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("DateOfWalkIn")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("FirstName")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("Gender")
.HasColumnType("integer");
b.Property<string>("LastName")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<bool>("Married")
.HasColumnType("boolean");
b.Property<string>("Password")
.HasColumnType("text");
b.Property<int>("Role")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("CareerId");
b.ToTable("FamilyMembers");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMemberOAuth", b =>
{
b.Property<string>("FamilyMemberId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("OAuthType")
.HasColumnType("text")
.HasColumnOrder(1);
b.Property<string>("OAuthAccessToken")
.HasColumnType("text");
b.HasKey("FamilyMemberId", "OAuthType");
b.ToTable("FamilyMemberOAuths");
});
modelBuilder.Entity("Church.Net.Entity.HappinessBEST", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Phone")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("HappinessBESTs");
});
modelBuilder.Entity("Church.Net.Entity.HappinessGroup", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<DateTime>("BeginTime")
.HasColumnType("timestamp with time zone");
b.Property<string>("CityAndZipCode")
.HasColumnType("text");
b.Property<string>("CommunityAppId")
.HasColumnType("text");
b.Property<string>("InvitationText")
.HasColumnType("text");
b.Property<string>("LineAccountId")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LineAccountId");
b.ToTable("HappinessGroups");
});
modelBuilder.Entity("Church.Net.Entity.HappinessTask", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Tasker")
.HasColumnType("text");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<string>("WeekId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("WeekId");
b.ToTable("HappinessTask");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("CityAndZipCode")
.HasColumnType("text");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<DateTime>("Date")
.HasColumnType("timestamp with time zone");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<string>("InvitationText")
.HasColumnType("text");
b.Property<int>("SEQ")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("HappinessWeeks");
});
modelBuilder.Entity("Church.Net.Entity.LineMessagingAccount", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("ChatToken")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<int>("Seq")
.HasColumnType("integer");
b.Property<int>("TotalUsage")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("LineMessagingAccounts");
});
modelBuilder.Entity("Church.Net.Entity.LogInfo", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("DetailMessage")
.HasColumnType("text");
b.Property<int>("Level")
.HasColumnType("integer");
b.Property<string>("Message")
.HasColumnType("text");
b.Property<string>("Source")
.HasColumnType("text");
b.Property<string>("StackTrace")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.Property<int>("TrackNo")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("TrackNo"));
b.Property<string>("Url")
.HasColumnType("text");
b.Property<string>("UserId")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("LogInfos");
});
modelBuilder.Entity("Church.Net.Entity.Messenger.LineMessageClient", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("ClientId")
.HasColumnType("text");
b.Property<bool>("IsGroup")
.HasColumnType("boolean");
b.Property<bool>("IsManager")
.HasColumnType("boolean");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("LineMessageClients");
});
modelBuilder.Entity("Church.Net.Entity.NewVisitor", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<DateTime?>("BirthDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("ComunityAppId")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Email")
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<string>("FirstName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("Gender")
.HasColumnType("integer");
b.Property<string>("LastName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Note")
.HasColumnType("text");
b.Property<string>("Phone")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<int?>("ReligionId")
.HasColumnType("integer");
b.Property<DateTime>("VisitingDate")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("ReligionId");
b.ToTable("NewVisitors");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("CommunityAppId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("Image1")
.HasColumnType("text");
b.Property<string>("Image2")
.HasColumnType("text");
b.Property<string>("Image3")
.HasColumnType("text");
b.Property<string>("Image4")
.HasColumnType("text");
b.Property<string>("Image5")
.HasColumnType("text");
b.Property<string>("LeaderMemberId")
.HasColumnType("text");
b.Property<string>("LineAccountId")
.HasColumnType("text");
b.Property<string>("LogoImage")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("ServiceAddressId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
b.HasIndex("LineAccountId");
b.HasIndex("ServiceAddressId");
b.ToTable("PastoralDomains");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainAutoReplys", b =>
{
b.Property<string>("PastoralDomainCommunityAppId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("AutoReplyItemId")
.HasColumnType("text")
.HasColumnOrder(1);
b.HasKey("PastoralDomainCommunityAppId", "AutoReplyItemId");
b.HasIndex("AutoReplyItemId");
b.ToTable("PastoralDomainAutoReplys");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainMembers", b =>
{
b.Property<string>("PastoralDomainId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("FamilyMemberId")
.HasColumnType("text")
.HasColumnOrder(1);
b.HasKey("PastoralDomainId", "FamilyMemberId");
b.HasIndex("FamilyMemberId");
b.ToTable("PastoralDomainMembers");
});
modelBuilder.Entity("Church.Net.Entity.Religion", b =>
{
b.Property<int>("ReligionId")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ReligionId"));
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("ReligionId");
b.ToTable("Religions");
});
modelBuilder.Entity("Church.Net.Entity.Vocabulary", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("DefinitionCh")
.IsRequired()
.HasColumnType("text");
b.Property<string>("DefinitionEn")
.IsRequired()
.HasColumnType("text");
b.Property<int>("FlashCardTimes")
.HasColumnType("integer");
b.Property<string>("ImagesUrl")
.HasColumnType("text");
b.Property<DateTime>("InsertDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("NounPlural")
.HasColumnType("text");
b.Property<int>("PartOfSpeech")
.HasColumnType("integer");
b.Property<bool>("PracticeApply")
.HasColumnType("boolean");
b.Property<DateTime>("PracticeDate")
.HasColumnType("timestamp with time zone");
b.Property<bool>("PracticeMemorized")
.HasColumnType("boolean");
b.Property<bool>("PracticeReview")
.HasColumnType("boolean");
b.Property<bool>("PracticeSelect")
.HasColumnType("boolean");
b.Property<string>("PracticeSentence")
.HasColumnType("text");
b.Property<int>("PracticeStage")
.HasColumnType("integer");
b.Property<bool>("PracticeVisualize")
.HasColumnType("boolean");
b.Property<string>("VerbParticiple")
.HasColumnType("text");
b.Property<string>("VerbPast")
.HasColumnType("text");
b.Property<string>("Word")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Vocabulary");
});
modelBuilder.Entity("Church.Net.Entity.WhoIsSpy", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Answer1Chs")
.HasColumnType("text");
b.Property<string>("Answer1Cht")
.HasColumnType("text");
b.Property<string>("Answer1En")
.HasColumnType("text");
b.Property<string>("Answer2Chs")
.HasColumnType("text");
b.Property<string>("Answer2Cht")
.HasColumnType("text");
b.Property<string>("Answer2En")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("WhoIsSpy");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "CellGroupInfo")
.WithMany()
.HasForeignKey("PastoralDomainId");
b.Navigation("CellGroupInfo");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventAttendee", b =>
{
b.HasOne("Church.Net.Entity.CellGroupRoutineEvent", "CellGroupRoutineEvent")
.WithMany("Attendees")
.HasForeignKey("EventId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CellGroupRoutineEvent");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventPrayer", b =>
{
b.HasOne("Church.Net.Entity.CellGroupRoutineEvent", "CellGroupRoutineEvent")
.WithMany("Prayers")
.HasForeignKey("EventId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CellGroupRoutineEvent");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMember", b =>
{
b.HasOne("Church.Net.Entity.Career", "Career")
.WithMany()
.HasForeignKey("CareerId");
b.Navigation("Career");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMemberOAuth", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", null)
.WithMany("OAuthInfos")
.HasForeignKey("FamilyMemberId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Church.Net.Entity.HappinessBEST", b =>
{
b.HasOne("Church.Net.Entity.HappinessGroup", "HappinessGroup")
.WithMany("BestList")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
});
modelBuilder.Entity("Church.Net.Entity.HappinessGroup", b =>
{
b.HasOne("Church.Net.Entity.LineMessagingAccount", "LineMessagingAccount")
.WithMany()
.HasForeignKey("LineAccountId");
b.Navigation("LineMessagingAccount");
});
modelBuilder.Entity("Church.Net.Entity.HappinessTask", b =>
{
b.HasOne("Church.Net.Entity.HappinessWeek", "HappinessWeek")
.WithMany("Tasks")
.HasForeignKey("WeekId");
b.Navigation("HappinessWeek");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.HasOne("Church.Net.Entity.HappinessGroup", "HappinessGroup")
.WithMany("Weeks")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
});
modelBuilder.Entity("Church.Net.Entity.NewVisitor", b =>
{
b.HasOne("Church.Net.Entity.Religion", "Religion")
.WithMany()
.HasForeignKey("ReligionId");
b.Navigation("Religion");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", "Leader")
.WithMany()
.HasForeignKey("LeaderMemberId");
b.HasOne("Church.Net.Entity.LineMessagingAccount", "LineMessagingAccount")
.WithMany()
.HasForeignKey("LineAccountId");
b.HasOne("Church.Net.Entity.AddressInfo", "ServiceAddress")
.WithMany()
.HasForeignKey("ServiceAddressId");
b.Navigation("Leader");
b.Navigation("LineMessagingAccount");
b.Navigation("ServiceAddress");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainAutoReplys", b =>
{
b.HasOne("Church.Net.Entity.AutoReplyItem", "FamilyMember")
.WithMany("AutoReplyItemRelations")
.HasForeignKey("AutoReplyItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Church.Net.Entity.PastoralDomain", "PastoralDomain")
.WithMany("AutoReplyItemRelations")
.HasForeignKey("PastoralDomainCommunityAppId")
.HasPrincipalKey("CommunityAppId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FamilyMember");
b.Navigation("PastoralDomain");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainMembers", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", "FamilyMember")
.WithMany("PastoralDomains")
.HasForeignKey("FamilyMemberId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Church.Net.Entity.PastoralDomain", "PastoralDomain")
.WithMany("Members")
.HasForeignKey("PastoralDomainId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FamilyMember");
b.Navigation("PastoralDomain");
});
modelBuilder.Entity("Church.Net.Entity.AutoReplyItem", b =>
{
b.Navigation("AutoReplyItemRelations");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.Navigation("Attendees");
b.Navigation("Prayers");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMember", b =>
{
b.Navigation("OAuthInfos");
b.Navigation("PastoralDomains");
});
modelBuilder.Entity("Church.Net.Entity.HappinessGroup", b =>
{
b.Navigation("BestList");
b.Navigation("Weeks");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.Navigation("Tasks");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,105 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddLineId : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "LineAccountId",
table: "PastoralDomains",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "LineAccountId",
table: "HappinessGroups",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "PastoralDomainId",
table: "CellGroupRoutineEvents",
type: "text",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_PastoralDomains_LineAccountId",
table: "PastoralDomains",
column: "LineAccountId");
migrationBuilder.CreateIndex(
name: "IX_HappinessGroups_LineAccountId",
table: "HappinessGroups",
column: "LineAccountId");
migrationBuilder.CreateIndex(
name: "IX_CellGroupRoutineEvents_PastoralDomainId",
table: "CellGroupRoutineEvents",
column: "PastoralDomainId");
migrationBuilder.AddForeignKey(
name: "FK_CellGroupRoutineEvents_PastoralDomains_PastoralDomainId",
table: "CellGroupRoutineEvents",
column: "PastoralDomainId",
principalTable: "PastoralDomains",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_HappinessGroups_LineMessagingAccounts_LineAccountId",
table: "HappinessGroups",
column: "LineAccountId",
principalTable: "LineMessagingAccounts",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PastoralDomains_LineMessagingAccounts_LineAccountId",
table: "PastoralDomains",
column: "LineAccountId",
principalTable: "LineMessagingAccounts",
principalColumn: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_CellGroupRoutineEvents_PastoralDomains_PastoralDomainId",
table: "CellGroupRoutineEvents");
migrationBuilder.DropForeignKey(
name: "FK_HappinessGroups_LineMessagingAccounts_LineAccountId",
table: "HappinessGroups");
migrationBuilder.DropForeignKey(
name: "FK_PastoralDomains_LineMessagingAccounts_LineAccountId",
table: "PastoralDomains");
migrationBuilder.DropIndex(
name: "IX_PastoralDomains_LineAccountId",
table: "PastoralDomains");
migrationBuilder.DropIndex(
name: "IX_HappinessGroups_LineAccountId",
table: "HappinessGroups");
migrationBuilder.DropIndex(
name: "IX_CellGroupRoutineEvents_PastoralDomainId",
table: "CellGroupRoutineEvents");
migrationBuilder.DropColumn(
name: "LineAccountId",
table: "PastoralDomains");
migrationBuilder.DropColumn(
name: "LineAccountId",
table: "HappinessGroups");
migrationBuilder.DropColumn(
name: "PastoralDomainId",
table: "CellGroupRoutineEvents");
}
}
}
@@ -0,0 +1,882 @@
// <auto-generated />
using System;
using Church.Net.DAL.EF;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
[DbContext(typeof(ChurchNetContext))]
[Migration("20221001120825_RemoveAutoReply")]
partial class RemoveAutoReply
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Church.Net.Entity.AddressInfo", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("City")
.HasColumnType("text");
b.Property<string>("State")
.HasColumnType("text");
b.Property<string>("Zip")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("AddressInfos");
});
modelBuilder.Entity("Church.Net.Entity.AutoReplyItem", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Command")
.HasColumnType("text");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("AutoReplyItems");
});
modelBuilder.Entity("Church.Net.Entity.Career", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.ToTable("Careers");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("PastoralDomainId")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("PastoralDomainId");
b.ToTable("CellGroupRoutineEvents");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventAttendee", b =>
{
b.Property<string>("EventId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("Id")
.HasColumnType("text")
.HasColumnOrder(1);
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<bool>("JoinPotluck")
.HasColumnType("boolean");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("PotluckItem")
.HasColumnType("text");
b.HasKey("EventId", "Id");
b.ToTable("CellGroupRoutineEventAttendees");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventPrayer", b =>
{
b.Property<string>("EventId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("MemberId")
.HasColumnType("text")
.HasColumnOrder(1);
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("Prayer")
.HasColumnType("text");
b.HasKey("EventId", "MemberId");
b.ToTable("CellGroupRoutineEventPrayers");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMember", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("AvatarImage")
.HasColumnType("text");
b.Property<bool>("Baptized")
.HasColumnType("boolean");
b.Property<DateTime?>("Birthday")
.HasColumnType("timestamp with time zone");
b.Property<string>("CareerId")
.HasColumnType("text");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("ComunityAppId")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTime?>("DateOfBaptized")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("DateOfWalkIn")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("FirstName")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("Gender")
.HasColumnType("integer");
b.Property<string>("LastName")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<bool>("Married")
.HasColumnType("boolean");
b.Property<string>("Password")
.HasColumnType("text");
b.Property<int>("Role")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("CareerId");
b.ToTable("FamilyMembers");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMemberOAuth", b =>
{
b.Property<string>("FamilyMemberId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("OAuthType")
.HasColumnType("text")
.HasColumnOrder(1);
b.Property<string>("OAuthAccessToken")
.HasColumnType("text");
b.HasKey("FamilyMemberId", "OAuthType");
b.ToTable("FamilyMemberOAuths");
});
modelBuilder.Entity("Church.Net.Entity.HappinessBEST", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Phone")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("HappinessBESTs");
});
modelBuilder.Entity("Church.Net.Entity.HappinessGroup", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<DateTime>("BeginTime")
.HasColumnType("timestamp with time zone");
b.Property<string>("CityAndZipCode")
.HasColumnType("text");
b.Property<string>("InvitationText")
.HasColumnType("text");
b.Property<string>("LineAccountId")
.HasColumnType("text");
b.Property<string>("LineGroupId")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LineAccountId");
b.ToTable("HappinessGroups");
});
modelBuilder.Entity("Church.Net.Entity.HappinessTask", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Tasker")
.HasColumnType("text");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<string>("WeekId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("WeekId");
b.ToTable("HappinessTask");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("CityAndZipCode")
.HasColumnType("text");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<DateTime>("Date")
.HasColumnType("timestamp with time zone");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<string>("InvitationText")
.HasColumnType("text");
b.Property<int>("SEQ")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("HappinessWeeks");
});
modelBuilder.Entity("Church.Net.Entity.LineMessagingAccount", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("ChatToken")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<int>("Seq")
.HasColumnType("integer");
b.Property<int>("TotalUsage")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("LineMessagingAccounts");
});
modelBuilder.Entity("Church.Net.Entity.LogInfo", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("DetailMessage")
.HasColumnType("text");
b.Property<int>("Level")
.HasColumnType("integer");
b.Property<string>("Message")
.HasColumnType("text");
b.Property<string>("Source")
.HasColumnType("text");
b.Property<string>("StackTrace")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.Property<int>("TrackNo")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("TrackNo"));
b.Property<string>("Url")
.HasColumnType("text");
b.Property<string>("UserId")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("LogInfos");
});
modelBuilder.Entity("Church.Net.Entity.Messenger.LineMessageClient", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("ClientId")
.HasColumnType("text");
b.Property<bool>("IsGroup")
.HasColumnType("boolean");
b.Property<bool>("IsManager")
.HasColumnType("boolean");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("LineMessageClients");
});
modelBuilder.Entity("Church.Net.Entity.NewVisitor", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<DateTime?>("BirthDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("ComunityAppId")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Email")
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<string>("FirstName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("Gender")
.HasColumnType("integer");
b.Property<string>("LastName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Note")
.HasColumnType("text");
b.Property<string>("Phone")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<int?>("ReligionId")
.HasColumnType("integer");
b.Property<DateTime>("VisitingDate")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("ReligionId");
b.ToTable("NewVisitors");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("Image1")
.HasColumnType("text");
b.Property<string>("Image2")
.HasColumnType("text");
b.Property<string>("Image3")
.HasColumnType("text");
b.Property<string>("Image4")
.HasColumnType("text");
b.Property<string>("Image5")
.HasColumnType("text");
b.Property<string>("LeaderMemberId")
.HasColumnType("text");
b.Property<string>("LineAccountId")
.HasColumnType("text");
b.Property<string>("LineGroupId")
.HasColumnType("text");
b.Property<string>("LogoImage")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("ServiceAddressId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
b.HasIndex("LineAccountId");
b.HasIndex("ServiceAddressId");
b.ToTable("PastoralDomains");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainAutoReplys", b =>
{
b.Property<string>("PastoralDomainCommunityAppId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("AutoReplyItemId")
.HasColumnType("text")
.HasColumnOrder(1);
b.HasKey("PastoralDomainCommunityAppId", "AutoReplyItemId");
b.HasIndex("AutoReplyItemId");
b.ToTable("PastoralDomainAutoReplys");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainMembers", b =>
{
b.Property<string>("PastoralDomainId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("FamilyMemberId")
.HasColumnType("text")
.HasColumnOrder(1);
b.HasKey("PastoralDomainId", "FamilyMemberId");
b.HasIndex("FamilyMemberId");
b.ToTable("PastoralDomainMembers");
});
modelBuilder.Entity("Church.Net.Entity.Religion", b =>
{
b.Property<int>("ReligionId")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ReligionId"));
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("ReligionId");
b.ToTable("Religions");
});
modelBuilder.Entity("Church.Net.Entity.Vocabulary", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("DefinitionCh")
.IsRequired()
.HasColumnType("text");
b.Property<string>("DefinitionEn")
.IsRequired()
.HasColumnType("text");
b.Property<int>("FlashCardTimes")
.HasColumnType("integer");
b.Property<string>("ImagesUrl")
.HasColumnType("text");
b.Property<DateTime>("InsertDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("NounPlural")
.HasColumnType("text");
b.Property<int>("PartOfSpeech")
.HasColumnType("integer");
b.Property<bool>("PracticeApply")
.HasColumnType("boolean");
b.Property<DateTime>("PracticeDate")
.HasColumnType("timestamp with time zone");
b.Property<bool>("PracticeMemorized")
.HasColumnType("boolean");
b.Property<bool>("PracticeReview")
.HasColumnType("boolean");
b.Property<bool>("PracticeSelect")
.HasColumnType("boolean");
b.Property<string>("PracticeSentence")
.HasColumnType("text");
b.Property<int>("PracticeStage")
.HasColumnType("integer");
b.Property<bool>("PracticeVisualize")
.HasColumnType("boolean");
b.Property<string>("VerbParticiple")
.HasColumnType("text");
b.Property<string>("VerbPast")
.HasColumnType("text");
b.Property<string>("Word")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Vocabulary");
});
modelBuilder.Entity("Church.Net.Entity.WhoIsSpy", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Answer1Chs")
.HasColumnType("text");
b.Property<string>("Answer1Cht")
.HasColumnType("text");
b.Property<string>("Answer1En")
.HasColumnType("text");
b.Property<string>("Answer2Chs")
.HasColumnType("text");
b.Property<string>("Answer2Cht")
.HasColumnType("text");
b.Property<string>("Answer2En")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("WhoIsSpy");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "CellGroupInfo")
.WithMany()
.HasForeignKey("PastoralDomainId");
b.Navigation("CellGroupInfo");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventAttendee", b =>
{
b.HasOne("Church.Net.Entity.CellGroupRoutineEvent", "CellGroupRoutineEvent")
.WithMany("Attendees")
.HasForeignKey("EventId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CellGroupRoutineEvent");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventPrayer", b =>
{
b.HasOne("Church.Net.Entity.CellGroupRoutineEvent", "CellGroupRoutineEvent")
.WithMany("Prayers")
.HasForeignKey("EventId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CellGroupRoutineEvent");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMember", b =>
{
b.HasOne("Church.Net.Entity.Career", "Career")
.WithMany()
.HasForeignKey("CareerId");
b.Navigation("Career");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMemberOAuth", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", null)
.WithMany("OAuthInfos")
.HasForeignKey("FamilyMemberId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Church.Net.Entity.HappinessBEST", b =>
{
b.HasOne("Church.Net.Entity.HappinessGroup", "HappinessGroup")
.WithMany("BestList")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
});
modelBuilder.Entity("Church.Net.Entity.HappinessGroup", b =>
{
b.HasOne("Church.Net.Entity.LineMessagingAccount", "LineMessagingAccount")
.WithMany()
.HasForeignKey("LineAccountId");
b.Navigation("LineMessagingAccount");
});
modelBuilder.Entity("Church.Net.Entity.HappinessTask", b =>
{
b.HasOne("Church.Net.Entity.HappinessWeek", "HappinessWeek")
.WithMany("Tasks")
.HasForeignKey("WeekId");
b.Navigation("HappinessWeek");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.HasOne("Church.Net.Entity.HappinessGroup", "HappinessGroup")
.WithMany("Weeks")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
});
modelBuilder.Entity("Church.Net.Entity.NewVisitor", b =>
{
b.HasOne("Church.Net.Entity.Religion", "Religion")
.WithMany()
.HasForeignKey("ReligionId");
b.Navigation("Religion");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", "Leader")
.WithMany()
.HasForeignKey("LeaderMemberId");
b.HasOne("Church.Net.Entity.LineMessagingAccount", "LineMessagingAccount")
.WithMany()
.HasForeignKey("LineAccountId");
b.HasOne("Church.Net.Entity.AddressInfo", "ServiceAddress")
.WithMany()
.HasForeignKey("ServiceAddressId");
b.Navigation("Leader");
b.Navigation("LineMessagingAccount");
b.Navigation("ServiceAddress");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainAutoReplys", b =>
{
b.HasOne("Church.Net.Entity.AutoReplyItem", "FamilyMember")
.WithMany("AutoReplyItemRelations")
.HasForeignKey("AutoReplyItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Church.Net.Entity.PastoralDomain", "PastoralDomain")
.WithMany("AutoReplyItemRelations")
.HasForeignKey("PastoralDomainCommunityAppId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FamilyMember");
b.Navigation("PastoralDomain");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainMembers", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", "FamilyMember")
.WithMany("PastoralDomains")
.HasForeignKey("FamilyMemberId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Church.Net.Entity.PastoralDomain", "PastoralDomain")
.WithMany("Members")
.HasForeignKey("PastoralDomainId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FamilyMember");
b.Navigation("PastoralDomain");
});
modelBuilder.Entity("Church.Net.Entity.AutoReplyItem", b =>
{
b.Navigation("AutoReplyItemRelations");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.Navigation("Attendees");
b.Navigation("Prayers");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMember", b =>
{
b.Navigation("OAuthInfos");
b.Navigation("PastoralDomains");
});
modelBuilder.Entity("Church.Net.Entity.HappinessGroup", b =>
{
b.Navigation("BestList");
b.Navigation("Weeks");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.Navigation("Tasks");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,79 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class RemoveAutoReply : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PastoralDomainAutoReplys_PastoralDomains_PastoralDomainComm~",
table: "PastoralDomainAutoReplys");
migrationBuilder.DropUniqueConstraint(
name: "AK_PastoralDomains_CommunityAppId",
table: "PastoralDomains");
migrationBuilder.DropColumn(
name: "CommunityAppId",
table: "PastoralDomains");
migrationBuilder.RenameColumn(
name: "CommunityAppId",
table: "HappinessGroups",
newName: "LineGroupId");
migrationBuilder.AddColumn<string>(
name: "LineGroupId",
table: "PastoralDomains",
type: "text",
nullable: true);
migrationBuilder.AddForeignKey(
name: "FK_PastoralDomainAutoReplys_PastoralDomains_PastoralDomainComm~",
table: "PastoralDomainAutoReplys",
column: "PastoralDomainCommunityAppId",
principalTable: "PastoralDomains",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PastoralDomainAutoReplys_PastoralDomains_PastoralDomainComm~",
table: "PastoralDomainAutoReplys");
migrationBuilder.DropColumn(
name: "LineGroupId",
table: "PastoralDomains");
migrationBuilder.RenameColumn(
name: "LineGroupId",
table: "HappinessGroups",
newName: "CommunityAppId");
migrationBuilder.AddColumn<string>(
name: "CommunityAppId",
table: "PastoralDomains",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.AddUniqueConstraint(
name: "AK_PastoralDomains_CommunityAppId",
table: "PastoralDomains",
column: "CommunityAppId");
migrationBuilder.AddForeignKey(
name: "FK_PastoralDomainAutoReplys_PastoralDomains_PastoralDomainComm~",
table: "PastoralDomainAutoReplys",
column: "PastoralDomainCommunityAppId",
principalTable: "PastoralDomains",
principalColumn: "CommunityAppId",
onDelete: ReferentialAction.Cascade);
}
}
}
@@ -0,0 +1,910 @@
// <auto-generated />
using System;
using Church.Net.DAL.EF;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
[DbContext(typeof(ChurchNetContext))]
[Migration("20221002060819_MergeHappinessGroup")]
partial class MergeHappinessGroup
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Church.Net.Entity.AddressInfo", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("City")
.HasColumnType("text");
b.Property<string>("State")
.HasColumnType("text");
b.Property<string>("Zip")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("AddressInfos");
});
modelBuilder.Entity("Church.Net.Entity.AutoReplyItem", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Command")
.HasColumnType("text");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("AutoReplyItems");
});
modelBuilder.Entity("Church.Net.Entity.Career", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.ToTable("Careers");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("PastoralDomainId")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("PastoralDomainId");
b.ToTable("CellGroupRoutineEvents");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventAttendee", b =>
{
b.Property<string>("EventId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("Id")
.HasColumnType("text")
.HasColumnOrder(1);
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<bool>("JoinPotluck")
.HasColumnType("boolean");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("PotluckItem")
.HasColumnType("text");
b.HasKey("EventId", "Id");
b.ToTable("CellGroupRoutineEventAttendees");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventPrayer", b =>
{
b.Property<string>("EventId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("MemberId")
.HasColumnType("text")
.HasColumnOrder(1);
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("Prayer")
.HasColumnType("text");
b.HasKey("EventId", "MemberId");
b.ToTable("CellGroupRoutineEventPrayers");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMember", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("AvatarImage")
.HasColumnType("text");
b.Property<bool>("Baptized")
.HasColumnType("boolean");
b.Property<DateTime?>("Birthday")
.HasColumnType("timestamp with time zone");
b.Property<string>("CareerId")
.HasColumnType("text");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("ComunityAppId")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTime?>("DateOfBaptized")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("DateOfWalkIn")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("FirstName")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("Gender")
.HasColumnType("integer");
b.Property<string>("LastName")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<bool>("Married")
.HasColumnType("boolean");
b.Property<string>("Password")
.HasColumnType("text");
b.Property<int>("Role")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("CareerId");
b.ToTable("FamilyMembers");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMemberOAuth", b =>
{
b.Property<string>("FamilyMemberId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("OAuthType")
.HasColumnType("text")
.HasColumnOrder(1);
b.Property<string>("OAuthAccessToken")
.HasColumnType("text");
b.HasKey("FamilyMemberId", "OAuthType");
b.ToTable("FamilyMemberOAuths");
});
modelBuilder.Entity("Church.Net.Entity.HappinessBEST", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<string>("HappinessGroupId")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Phone")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("GroupId");
b.HasIndex("HappinessGroupId");
b.ToTable("HappinessBESTs");
});
modelBuilder.Entity("Church.Net.Entity.HappinessGroup", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<DateTime>("BeginTime")
.HasColumnType("timestamp with time zone");
b.Property<string>("CityAndZipCode")
.HasColumnType("text");
b.Property<string>("InvitationText")
.HasColumnType("text");
b.Property<string>("LineAccountId")
.HasColumnType("text");
b.Property<string>("LineGroupId")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LineAccountId");
b.ToTable("HappinessGroups");
});
modelBuilder.Entity("Church.Net.Entity.HappinessTask", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Tasker")
.HasColumnType("text");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<string>("WeekId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("WeekId");
b.ToTable("HappinessTask");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("CityAndZipCode")
.HasColumnType("text");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<DateTime>("Date")
.HasColumnType("timestamp with time zone");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<string>("HappinessGroupId")
.HasColumnType("text");
b.Property<string>("InvitationText")
.HasColumnType("text");
b.Property<int>("SEQ")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("GroupId");
b.HasIndex("HappinessGroupId");
b.ToTable("HappinessWeeks");
});
modelBuilder.Entity("Church.Net.Entity.LineMessagingAccount", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("ChatToken")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<int>("Seq")
.HasColumnType("integer");
b.Property<int>("TotalUsage")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("LineMessagingAccounts");
});
modelBuilder.Entity("Church.Net.Entity.LogInfo", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("DetailMessage")
.HasColumnType("text");
b.Property<int>("Level")
.HasColumnType("integer");
b.Property<string>("Message")
.HasColumnType("text");
b.Property<string>("Source")
.HasColumnType("text");
b.Property<string>("StackTrace")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.Property<int>("TrackNo")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("TrackNo"));
b.Property<string>("Url")
.HasColumnType("text");
b.Property<string>("UserId")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("LogInfos");
});
modelBuilder.Entity("Church.Net.Entity.Messenger.LineMessageClient", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("ClientId")
.HasColumnType("text");
b.Property<bool>("IsGroup")
.HasColumnType("boolean");
b.Property<bool>("IsManager")
.HasColumnType("boolean");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("LineMessageClients");
});
modelBuilder.Entity("Church.Net.Entity.NewVisitor", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<DateTime?>("BirthDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("ComunityAppId")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Email")
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<string>("FirstName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("Gender")
.HasColumnType("integer");
b.Property<string>("LastName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Note")
.HasColumnType("text");
b.Property<string>("Phone")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<int?>("ReligionId")
.HasColumnType("integer");
b.Property<DateTime>("VisitingDate")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("ReligionId");
b.ToTable("NewVisitors");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("Image1")
.HasColumnType("text");
b.Property<string>("Image2")
.HasColumnType("text");
b.Property<string>("Image3")
.HasColumnType("text");
b.Property<string>("Image4")
.HasColumnType("text");
b.Property<string>("Image5")
.HasColumnType("text");
b.Property<string>("LeaderMemberId")
.HasColumnType("text");
b.Property<string>("LineAccountId")
.HasColumnType("text");
b.Property<string>("LineGroupId")
.HasColumnType("text");
b.Property<string>("LogoImage")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("ServiceAddressId")
.HasColumnType("text");
b.Property<DateTime?>("ServiceTime")
.HasColumnType("timestamp with time zone");
b.Property<int>("Type")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
b.HasIndex("LineAccountId");
b.HasIndex("ServiceAddressId");
b.ToTable("PastoralDomains");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainAutoReplys", b =>
{
b.Property<string>("PastoralDomainCommunityAppId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("AutoReplyItemId")
.HasColumnType("text")
.HasColumnOrder(1);
b.HasKey("PastoralDomainCommunityAppId", "AutoReplyItemId");
b.HasIndex("AutoReplyItemId");
b.ToTable("PastoralDomainAutoReplys");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainMembers", b =>
{
b.Property<string>("PastoralDomainId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("FamilyMemberId")
.HasColumnType("text")
.HasColumnOrder(1);
b.HasKey("PastoralDomainId", "FamilyMemberId");
b.HasIndex("FamilyMemberId");
b.ToTable("PastoralDomainMembers");
});
modelBuilder.Entity("Church.Net.Entity.Religion", b =>
{
b.Property<int>("ReligionId")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ReligionId"));
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("ReligionId");
b.ToTable("Religions");
});
modelBuilder.Entity("Church.Net.Entity.Vocabulary", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("DefinitionCh")
.IsRequired()
.HasColumnType("text");
b.Property<string>("DefinitionEn")
.IsRequired()
.HasColumnType("text");
b.Property<int>("FlashCardTimes")
.HasColumnType("integer");
b.Property<string>("ImagesUrl")
.HasColumnType("text");
b.Property<DateTime>("InsertDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("NounPlural")
.HasColumnType("text");
b.Property<int>("PartOfSpeech")
.HasColumnType("integer");
b.Property<bool>("PracticeApply")
.HasColumnType("boolean");
b.Property<DateTime>("PracticeDate")
.HasColumnType("timestamp with time zone");
b.Property<bool>("PracticeMemorized")
.HasColumnType("boolean");
b.Property<bool>("PracticeReview")
.HasColumnType("boolean");
b.Property<bool>("PracticeSelect")
.HasColumnType("boolean");
b.Property<string>("PracticeSentence")
.HasColumnType("text");
b.Property<int>("PracticeStage")
.HasColumnType("integer");
b.Property<bool>("PracticeVisualize")
.HasColumnType("boolean");
b.Property<string>("VerbParticiple")
.HasColumnType("text");
b.Property<string>("VerbPast")
.HasColumnType("text");
b.Property<string>("Word")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Vocabulary");
});
modelBuilder.Entity("Church.Net.Entity.WhoIsSpy", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Answer1Chs")
.HasColumnType("text");
b.Property<string>("Answer1Cht")
.HasColumnType("text");
b.Property<string>("Answer1En")
.HasColumnType("text");
b.Property<string>("Answer2Chs")
.HasColumnType("text");
b.Property<string>("Answer2Cht")
.HasColumnType("text");
b.Property<string>("Answer2En")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("WhoIsSpy");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "CellGroupInfo")
.WithMany()
.HasForeignKey("PastoralDomainId");
b.Navigation("CellGroupInfo");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventAttendee", b =>
{
b.HasOne("Church.Net.Entity.CellGroupRoutineEvent", "CellGroupRoutineEvent")
.WithMany("Attendees")
.HasForeignKey("EventId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CellGroupRoutineEvent");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventPrayer", b =>
{
b.HasOne("Church.Net.Entity.CellGroupRoutineEvent", "CellGroupRoutineEvent")
.WithMany("Prayers")
.HasForeignKey("EventId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CellGroupRoutineEvent");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMember", b =>
{
b.HasOne("Church.Net.Entity.Career", "Career")
.WithMany()
.HasForeignKey("CareerId");
b.Navigation("Career");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMemberOAuth", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", null)
.WithMany("OAuthInfos")
.HasForeignKey("FamilyMemberId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Church.Net.Entity.HappinessBEST", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "HappinessGroup")
.WithMany("Bests")
.HasForeignKey("GroupId");
b.HasOne("Church.Net.Entity.HappinessGroup", null)
.WithMany("BestList")
.HasForeignKey("HappinessGroupId");
b.Navigation("HappinessGroup");
});
modelBuilder.Entity("Church.Net.Entity.HappinessGroup", b =>
{
b.HasOne("Church.Net.Entity.LineMessagingAccount", "LineMessagingAccount")
.WithMany()
.HasForeignKey("LineAccountId");
b.Navigation("LineMessagingAccount");
});
modelBuilder.Entity("Church.Net.Entity.HappinessTask", b =>
{
b.HasOne("Church.Net.Entity.HappinessWeek", "HappinessWeek")
.WithMany("Tasks")
.HasForeignKey("WeekId");
b.Navigation("HappinessWeek");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "HappinessGroup")
.WithMany("HappinessWeeks")
.HasForeignKey("GroupId");
b.HasOne("Church.Net.Entity.HappinessGroup", null)
.WithMany("Weeks")
.HasForeignKey("HappinessGroupId");
b.Navigation("HappinessGroup");
});
modelBuilder.Entity("Church.Net.Entity.NewVisitor", b =>
{
b.HasOne("Church.Net.Entity.Religion", "Religion")
.WithMany()
.HasForeignKey("ReligionId");
b.Navigation("Religion");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", "Leader")
.WithMany()
.HasForeignKey("LeaderMemberId");
b.HasOne("Church.Net.Entity.LineMessagingAccount", "LineMessagingAccount")
.WithMany()
.HasForeignKey("LineAccountId");
b.HasOne("Church.Net.Entity.AddressInfo", "ServiceAddress")
.WithMany()
.HasForeignKey("ServiceAddressId");
b.Navigation("Leader");
b.Navigation("LineMessagingAccount");
b.Navigation("ServiceAddress");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainAutoReplys", b =>
{
b.HasOne("Church.Net.Entity.AutoReplyItem", "FamilyMember")
.WithMany("AutoReplyItemRelations")
.HasForeignKey("AutoReplyItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Church.Net.Entity.PastoralDomain", "PastoralDomain")
.WithMany("AutoReplyItemRelations")
.HasForeignKey("PastoralDomainCommunityAppId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FamilyMember");
b.Navigation("PastoralDomain");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainMembers", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", "FamilyMember")
.WithMany("PastoralDomains")
.HasForeignKey("FamilyMemberId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Church.Net.Entity.PastoralDomain", "PastoralDomain")
.WithMany("Members")
.HasForeignKey("PastoralDomainId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FamilyMember");
b.Navigation("PastoralDomain");
});
modelBuilder.Entity("Church.Net.Entity.AutoReplyItem", b =>
{
b.Navigation("AutoReplyItemRelations");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.Navigation("Attendees");
b.Navigation("Prayers");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMember", b =>
{
b.Navigation("OAuthInfos");
b.Navigation("PastoralDomains");
});
modelBuilder.Entity("Church.Net.Entity.HappinessGroup", b =>
{
b.Navigation("BestList");
b.Navigation("Weeks");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.Navigation("Tasks");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Bests");
b.Navigation("HappinessWeeks");
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,141 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class MergeHappinessGroup : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_HappinessBESTs_HappinessGroups_GroupId",
table: "HappinessBESTs");
migrationBuilder.DropForeignKey(
name: "FK_HappinessWeeks_HappinessGroups_GroupId",
table: "HappinessWeeks");
migrationBuilder.AddColumn<DateTime>(
name: "ServiceTime",
table: "PastoralDomains",
type: "timestamp with time zone",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "Type",
table: "PastoralDomains",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "HappinessGroupId",
table: "HappinessWeeks",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "HappinessGroupId",
table: "HappinessBESTs",
type: "text",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_HappinessWeeks_HappinessGroupId",
table: "HappinessWeeks",
column: "HappinessGroupId");
migrationBuilder.CreateIndex(
name: "IX_HappinessBESTs_HappinessGroupId",
table: "HappinessBESTs",
column: "HappinessGroupId");
migrationBuilder.AddForeignKey(
name: "FK_HappinessBESTs_HappinessGroups_HappinessGroupId",
table: "HappinessBESTs",
column: "HappinessGroupId",
principalTable: "HappinessGroups",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_HappinessBESTs_PastoralDomains_GroupId",
table: "HappinessBESTs",
column: "GroupId",
principalTable: "PastoralDomains",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_HappinessWeeks_HappinessGroups_HappinessGroupId",
table: "HappinessWeeks",
column: "HappinessGroupId",
principalTable: "HappinessGroups",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_HappinessWeeks_PastoralDomains_GroupId",
table: "HappinessWeeks",
column: "GroupId",
principalTable: "PastoralDomains",
principalColumn: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_HappinessBESTs_HappinessGroups_HappinessGroupId",
table: "HappinessBESTs");
migrationBuilder.DropForeignKey(
name: "FK_HappinessBESTs_PastoralDomains_GroupId",
table: "HappinessBESTs");
migrationBuilder.DropForeignKey(
name: "FK_HappinessWeeks_HappinessGroups_HappinessGroupId",
table: "HappinessWeeks");
migrationBuilder.DropForeignKey(
name: "FK_HappinessWeeks_PastoralDomains_GroupId",
table: "HappinessWeeks");
migrationBuilder.DropIndex(
name: "IX_HappinessWeeks_HappinessGroupId",
table: "HappinessWeeks");
migrationBuilder.DropIndex(
name: "IX_HappinessBESTs_HappinessGroupId",
table: "HappinessBESTs");
migrationBuilder.DropColumn(
name: "ServiceTime",
table: "PastoralDomains");
migrationBuilder.DropColumn(
name: "Type",
table: "PastoralDomains");
migrationBuilder.DropColumn(
name: "HappinessGroupId",
table: "HappinessWeeks");
migrationBuilder.DropColumn(
name: "HappinessGroupId",
table: "HappinessBESTs");
migrationBuilder.AddForeignKey(
name: "FK_HappinessBESTs_HappinessGroups_GroupId",
table: "HappinessBESTs",
column: "GroupId",
principalTable: "HappinessGroups",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_HappinessWeeks_HappinessGroups_GroupId",
table: "HappinessWeeks",
column: "GroupId",
principalTable: "HappinessGroups",
principalColumn: "Id");
}
}
}
@@ -0,0 +1,843 @@
// <auto-generated />
using System;
using Church.Net.DAL.EF;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
[DbContext(typeof(ChurchNetContext))]
[Migration("20221002114621_RemoveHappinessGroup")]
partial class RemoveHappinessGroup
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Church.Net.Entity.AddressInfo", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("City")
.HasColumnType("text");
b.Property<string>("State")
.HasColumnType("text");
b.Property<string>("Zip")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("AddressInfos");
});
modelBuilder.Entity("Church.Net.Entity.AutoReplyItem", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Command")
.HasColumnType("text");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("AutoReplyItems");
});
modelBuilder.Entity("Church.Net.Entity.Career", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.ToTable("Careers");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("PastoralDomainId")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("PastoralDomainId");
b.ToTable("CellGroupRoutineEvents");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventAttendee", b =>
{
b.Property<string>("EventId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("Id")
.HasColumnType("text")
.HasColumnOrder(1);
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<bool>("JoinPotluck")
.HasColumnType("boolean");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("PotluckItem")
.HasColumnType("text");
b.HasKey("EventId", "Id");
b.ToTable("CellGroupRoutineEventAttendees");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventPrayer", b =>
{
b.Property<string>("EventId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("MemberId")
.HasColumnType("text")
.HasColumnOrder(1);
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("Prayer")
.HasColumnType("text");
b.HasKey("EventId", "MemberId");
b.ToTable("CellGroupRoutineEventPrayers");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMember", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<string>("AvatarImage")
.HasColumnType("text");
b.Property<bool>("Baptized")
.HasColumnType("boolean");
b.Property<DateTime?>("Birthday")
.HasColumnType("timestamp with time zone");
b.Property<string>("CareerId")
.HasColumnType("text");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("ComunityAppId")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<DateTime?>("DateOfBaptized")
.HasColumnType("timestamp with time zone");
b.Property<DateTime?>("DateOfWalkIn")
.HasColumnType("timestamp with time zone");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("FirstName")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("Gender")
.HasColumnType("integer");
b.Property<string>("LastName")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<bool>("Married")
.HasColumnType("boolean");
b.Property<string>("Password")
.HasColumnType("text");
b.Property<int>("Role")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("CareerId");
b.ToTable("FamilyMembers");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMemberOAuth", b =>
{
b.Property<string>("FamilyMemberId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("OAuthType")
.HasColumnType("text")
.HasColumnOrder(1);
b.Property<string>("OAuthAccessToken")
.HasColumnType("text");
b.HasKey("FamilyMemberId", "OAuthType");
b.ToTable("FamilyMemberOAuths");
});
modelBuilder.Entity("Church.Net.Entity.HappinessBEST", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Email")
.HasColumnType("text");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Phone")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("HappinessBESTs");
});
modelBuilder.Entity("Church.Net.Entity.HappinessTask", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Tasker")
.HasColumnType("text");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<string>("WeekId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("WeekId");
b.ToTable("HappinessTask");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("CityAndZipCode")
.HasColumnType("text");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<DateTime>("Date")
.HasColumnType("timestamp with time zone");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<string>("InvitationText")
.HasColumnType("text");
b.Property<int>("SEQ")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("HappinessWeeks");
});
modelBuilder.Entity("Church.Net.Entity.LineMessagingAccount", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("ChatToken")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<int>("Seq")
.HasColumnType("integer");
b.Property<int>("TotalUsage")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("LineMessagingAccounts");
});
modelBuilder.Entity("Church.Net.Entity.LogInfo", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("DetailMessage")
.HasColumnType("text");
b.Property<int>("Level")
.HasColumnType("integer");
b.Property<string>("Message")
.HasColumnType("text");
b.Property<string>("Source")
.HasColumnType("text");
b.Property<string>("StackTrace")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.Property<int>("TrackNo")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("TrackNo"));
b.Property<string>("Url")
.HasColumnType("text");
b.Property<string>("UserId")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("LogInfos");
});
modelBuilder.Entity("Church.Net.Entity.Messenger.LineMessageClient", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("ClientId")
.HasColumnType("text");
b.Property<bool>("IsGroup")
.HasColumnType("boolean");
b.Property<bool>("IsManager")
.HasColumnType("boolean");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("LineMessageClients");
});
modelBuilder.Entity("Church.Net.Entity.NewVisitor", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasMaxLength(500)
.HasColumnType("character varying(500)");
b.Property<DateTime?>("BirthDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("ComunityAppId")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Email")
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<string>("FirstName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("Gender")
.HasColumnType("integer");
b.Property<string>("LastName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Note")
.HasColumnType("text");
b.Property<string>("Phone")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<int?>("ReligionId")
.HasColumnType("integer");
b.Property<DateTime>("VisitingDate")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("ReligionId");
b.ToTable("NewVisitors");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("Image1")
.HasColumnType("text");
b.Property<string>("Image2")
.HasColumnType("text");
b.Property<string>("Image3")
.HasColumnType("text");
b.Property<string>("Image4")
.HasColumnType("text");
b.Property<string>("Image5")
.HasColumnType("text");
b.Property<string>("LeaderMemberId")
.HasColumnType("text");
b.Property<string>("LineAccountId")
.HasColumnType("text");
b.Property<string>("LineGroupId")
.HasColumnType("text");
b.Property<string>("LogoImage")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("ServiceAddressId")
.HasColumnType("text");
b.Property<DateTime?>("ServiceTime")
.HasColumnType("timestamp with time zone");
b.Property<int>("Type")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
b.HasIndex("LineAccountId");
b.HasIndex("ServiceAddressId");
b.ToTable("PastoralDomains");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainAutoReplys", b =>
{
b.Property<string>("PastoralDomainCommunityAppId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("AutoReplyItemId")
.HasColumnType("text")
.HasColumnOrder(1);
b.HasKey("PastoralDomainCommunityAppId", "AutoReplyItemId");
b.HasIndex("AutoReplyItemId");
b.ToTable("PastoralDomainAutoReplys");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainMembers", b =>
{
b.Property<string>("PastoralDomainId")
.HasColumnType("text")
.HasColumnOrder(0);
b.Property<string>("FamilyMemberId")
.HasColumnType("text")
.HasColumnOrder(1);
b.HasKey("PastoralDomainId", "FamilyMemberId");
b.HasIndex("FamilyMemberId");
b.ToTable("PastoralDomainMembers");
});
modelBuilder.Entity("Church.Net.Entity.Religion", b =>
{
b.Property<int>("ReligionId")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ReligionId"));
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("ReligionId");
b.ToTable("Religions");
});
modelBuilder.Entity("Church.Net.Entity.Vocabulary", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("DefinitionCh")
.IsRequired()
.HasColumnType("text");
b.Property<string>("DefinitionEn")
.IsRequired()
.HasColumnType("text");
b.Property<int>("FlashCardTimes")
.HasColumnType("integer");
b.Property<string>("ImagesUrl")
.HasColumnType("text");
b.Property<DateTime>("InsertDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("NounPlural")
.HasColumnType("text");
b.Property<int>("PartOfSpeech")
.HasColumnType("integer");
b.Property<bool>("PracticeApply")
.HasColumnType("boolean");
b.Property<DateTime>("PracticeDate")
.HasColumnType("timestamp with time zone");
b.Property<bool>("PracticeMemorized")
.HasColumnType("boolean");
b.Property<bool>("PracticeReview")
.HasColumnType("boolean");
b.Property<bool>("PracticeSelect")
.HasColumnType("boolean");
b.Property<string>("PracticeSentence")
.HasColumnType("text");
b.Property<int>("PracticeStage")
.HasColumnType("integer");
b.Property<bool>("PracticeVisualize")
.HasColumnType("boolean");
b.Property<string>("VerbParticiple")
.HasColumnType("text");
b.Property<string>("VerbPast")
.HasColumnType("text");
b.Property<string>("Word")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Vocabulary");
});
modelBuilder.Entity("Church.Net.Entity.WhoIsSpy", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Answer1Chs")
.HasColumnType("text");
b.Property<string>("Answer1Cht")
.HasColumnType("text");
b.Property<string>("Answer1En")
.HasColumnType("text");
b.Property<string>("Answer2Chs")
.HasColumnType("text");
b.Property<string>("Answer2Cht")
.HasColumnType("text");
b.Property<string>("Answer2En")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("WhoIsSpy");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "CellGroupInfo")
.WithMany()
.HasForeignKey("PastoralDomainId");
b.Navigation("CellGroupInfo");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventAttendee", b =>
{
b.HasOne("Church.Net.Entity.CellGroupRoutineEvent", "CellGroupRoutineEvent")
.WithMany("Attendees")
.HasForeignKey("EventId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CellGroupRoutineEvent");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventPrayer", b =>
{
b.HasOne("Church.Net.Entity.CellGroupRoutineEvent", "CellGroupRoutineEvent")
.WithMany("Prayers")
.HasForeignKey("EventId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CellGroupRoutineEvent");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMember", b =>
{
b.HasOne("Church.Net.Entity.Career", "Career")
.WithMany()
.HasForeignKey("CareerId");
b.Navigation("Career");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMemberOAuth", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", null)
.WithMany("OAuthInfos")
.HasForeignKey("FamilyMemberId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Church.Net.Entity.HappinessBEST", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "HappinessGroup")
.WithMany("Bests")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
});
modelBuilder.Entity("Church.Net.Entity.HappinessTask", b =>
{
b.HasOne("Church.Net.Entity.HappinessWeek", "HappinessWeek")
.WithMany("Tasks")
.HasForeignKey("WeekId");
b.Navigation("HappinessWeek");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "HappinessGroup")
.WithMany("HappinessWeeks")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
});
modelBuilder.Entity("Church.Net.Entity.NewVisitor", b =>
{
b.HasOne("Church.Net.Entity.Religion", "Religion")
.WithMany()
.HasForeignKey("ReligionId");
b.Navigation("Religion");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", "Leader")
.WithMany()
.HasForeignKey("LeaderMemberId");
b.HasOne("Church.Net.Entity.LineMessagingAccount", "LineMessagingAccount")
.WithMany()
.HasForeignKey("LineAccountId");
b.HasOne("Church.Net.Entity.AddressInfo", "ServiceAddress")
.WithMany()
.HasForeignKey("ServiceAddressId");
b.Navigation("Leader");
b.Navigation("LineMessagingAccount");
b.Navigation("ServiceAddress");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainAutoReplys", b =>
{
b.HasOne("Church.Net.Entity.AutoReplyItem", "FamilyMember")
.WithMany("AutoReplyItemRelations")
.HasForeignKey("AutoReplyItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Church.Net.Entity.PastoralDomain", "PastoralDomain")
.WithMany("AutoReplyItemRelations")
.HasForeignKey("PastoralDomainCommunityAppId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FamilyMember");
b.Navigation("PastoralDomain");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainMembers", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", "FamilyMember")
.WithMany("PastoralDomains")
.HasForeignKey("FamilyMemberId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Church.Net.Entity.PastoralDomain", "PastoralDomain")
.WithMany("Members")
.HasForeignKey("PastoralDomainId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FamilyMember");
b.Navigation("PastoralDomain");
});
modelBuilder.Entity("Church.Net.Entity.AutoReplyItem", b =>
{
b.Navigation("AutoReplyItemRelations");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.Navigation("Attendees");
b.Navigation("Prayers");
});
modelBuilder.Entity("Church.Net.Entity.FamilyMember", b =>
{
b.Navigation("OAuthInfos");
b.Navigation("PastoralDomains");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.Navigation("Tasks");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Bests");
b.Navigation("HappinessWeeks");
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,107 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class RemoveHappinessGroup : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_HappinessBESTs_HappinessGroups_HappinessGroupId",
table: "HappinessBESTs");
migrationBuilder.DropForeignKey(
name: "FK_HappinessWeeks_HappinessGroups_HappinessGroupId",
table: "HappinessWeeks");
migrationBuilder.DropTable(
name: "HappinessGroups");
migrationBuilder.DropIndex(
name: "IX_HappinessWeeks_HappinessGroupId",
table: "HappinessWeeks");
migrationBuilder.DropIndex(
name: "IX_HappinessBESTs_HappinessGroupId",
table: "HappinessBESTs");
migrationBuilder.DropColumn(
name: "HappinessGroupId",
table: "HappinessWeeks");
migrationBuilder.DropColumn(
name: "HappinessGroupId",
table: "HappinessBESTs");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "HappinessGroupId",
table: "HappinessWeeks",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "HappinessGroupId",
table: "HappinessBESTs",
type: "text",
nullable: true);
migrationBuilder.CreateTable(
name: "HappinessGroups",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
LineAccountId = table.Column<string>(type: "text", nullable: true),
Address = table.Column<string>(type: "text", nullable: true),
BeginTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CityAndZipCode = table.Column<string>(type: "text", nullable: true),
InvitationText = table.Column<string>(type: "text", nullable: true),
LineGroupId = table.Column<string>(type: "text", nullable: true),
Name = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_HappinessGroups", x => x.Id);
table.ForeignKey(
name: "FK_HappinessGroups_LineMessagingAccounts_LineAccountId",
column: x => x.LineAccountId,
principalTable: "LineMessagingAccounts",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_HappinessWeeks_HappinessGroupId",
table: "HappinessWeeks",
column: "HappinessGroupId");
migrationBuilder.CreateIndex(
name: "IX_HappinessBESTs_HappinessGroupId",
table: "HappinessBESTs",
column: "HappinessGroupId");
migrationBuilder.CreateIndex(
name: "IX_HappinessGroups_LineAccountId",
table: "HappinessGroups",
column: "LineAccountId");
migrationBuilder.AddForeignKey(
name: "FK_HappinessBESTs_HappinessGroups_HappinessGroupId",
table: "HappinessBESTs",
column: "HappinessGroupId",
principalTable: "HappinessGroups",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_HappinessWeeks_HappinessGroups_HappinessGroupId",
table: "HappinessWeeks",
column: "HappinessGroupId",
principalTable: "HappinessGroups",
principalColumn: "Id");
}
}
}
@@ -85,11 +85,16 @@ namespace Church.Net.DAL.EFCoreDBF.Migrations
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("PastoralDomainId")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("PastoralDomainId");
b.ToTable("CellGroupRoutineEvents");
});
@@ -248,34 +253,6 @@ namespace Church.Net.DAL.EFCoreDBF.Migrations
b.ToTable("HappinessBESTs");
});
modelBuilder.Entity("Church.Net.Entity.HappinessGroup", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Address")
.HasColumnType("text");
b.Property<DateTime>("BeginTime")
.HasColumnType("timestamp with time zone");
b.Property<string>("CityAndZipCode")
.HasColumnType("text");
b.Property<string>("CommunityAppId")
.HasColumnType("text");
b.Property<string>("InvitationText")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("HappinessGroups");
});
modelBuilder.Entity("Church.Net.Entity.HappinessTask", b =>
{
b.Property<string>("Id")
@@ -476,10 +453,6 @@ namespace Church.Net.DAL.EFCoreDBF.Migrations
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("CommunityAppId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
@@ -501,6 +474,12 @@ namespace Church.Net.DAL.EFCoreDBF.Migrations
b.Property<string>("LeaderMemberId")
.HasColumnType("text");
b.Property<string>("LineAccountId")
.HasColumnType("text");
b.Property<string>("LineGroupId")
.HasColumnType("text");
b.Property<string>("LogoImage")
.HasColumnType("text");
@@ -510,10 +489,18 @@ namespace Church.Net.DAL.EFCoreDBF.Migrations
b.Property<string>("ServiceAddressId")
.HasColumnType("text");
b.Property<DateTime?>("ServiceTime")
.HasColumnType("timestamp with time zone");
b.Property<int>("Type")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
b.HasIndex("LineAccountId");
b.HasIndex("ServiceAddressId");
b.ToTable("PastoralDomains");
@@ -670,6 +657,15 @@ namespace Church.Net.DAL.EFCoreDBF.Migrations
b.ToTable("WhoIsSpy");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "CellGroupInfo")
.WithMany()
.HasForeignKey("PastoralDomainId");
b.Navigation("CellGroupInfo");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEventAttendee", b =>
{
b.HasOne("Church.Net.Entity.CellGroupRoutineEvent", "CellGroupRoutineEvent")
@@ -712,8 +708,8 @@ namespace Church.Net.DAL.EFCoreDBF.Migrations
modelBuilder.Entity("Church.Net.Entity.HappinessBEST", b =>
{
b.HasOne("Church.Net.Entity.HappinessGroup", "HappinessGroup")
.WithMany("BestList")
b.HasOne("Church.Net.Entity.PastoralDomain", "HappinessGroup")
.WithMany("Bests")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
@@ -730,8 +726,8 @@ namespace Church.Net.DAL.EFCoreDBF.Migrations
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.HasOne("Church.Net.Entity.HappinessGroup", "HappinessGroup")
.WithMany("Weeks")
b.HasOne("Church.Net.Entity.PastoralDomain", "HappinessGroup")
.WithMany("HappinessWeeks")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
@@ -752,12 +748,18 @@ namespace Church.Net.DAL.EFCoreDBF.Migrations
.WithMany()
.HasForeignKey("LeaderMemberId");
b.HasOne("Church.Net.Entity.LineMessagingAccount", "LineMessagingAccount")
.WithMany()
.HasForeignKey("LineAccountId");
b.HasOne("Church.Net.Entity.AddressInfo", "ServiceAddress")
.WithMany()
.HasForeignKey("ServiceAddressId");
b.Navigation("Leader");
b.Navigation("LineMessagingAccount");
b.Navigation("ServiceAddress");
});
@@ -772,7 +774,6 @@ namespace Church.Net.DAL.EFCoreDBF.Migrations
b.HasOne("Church.Net.Entity.PastoralDomain", "PastoralDomain")
.WithMany("AutoReplyItemRelations")
.HasForeignKey("PastoralDomainCommunityAppId")
.HasPrincipalKey("CommunityAppId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -819,13 +820,6 @@ namespace Church.Net.DAL.EFCoreDBF.Migrations
b.Navigation("PastoralDomains");
});
modelBuilder.Entity("Church.Net.Entity.HappinessGroup", b =>
{
b.Navigation("BestList");
b.Navigation("Weeks");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.Navigation("Tasks");
@@ -835,6 +829,10 @@ namespace Church.Net.DAL.EFCoreDBF.Migrations
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Bests");
b.Navigation("HappinessWeeks");
b.Navigation("Members");
});
#pragma warning restore 612, 618