Compare commits

..

1 Commits

Author SHA1 Message Date
ChrisChen b9c505a65d Initial commit 2022-09-30 16:36:15 +00:00
220 changed files with 19 additions and 29406 deletions
-25
View File
@@ -1,25 +0,0 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
-2
View File
@@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto
+16
View File
@@ -1,3 +1,4 @@
# ---> VisualStudio
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.
## ##
@@ -396,3 +397,18 @@ FodyWeavers.xsd
# JetBrains Rider # JetBrains Rider
*.sln.iml *.sln.iml
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B9D6F9DC-8EB4-44E2-8625-98DFA2958084}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Church.Net.DAL.Core</RootNamespace>
<AssemblyName>Church.Net.DAL.Core</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="IRepository.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
-25
View File
@@ -1,25 +0,0 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.DAL.Core
{
public interface IRepository<T>:IDisposable where T:class
{
void InitializeConnectionString(string connString);
void Add(T obj);
void Edit(T obj);
void Delete(T id);
void Attach(T obj);
T GetSingle();
T GetSingle(Expression<Func<T, bool>> whereCondition);
IList<T> GetAll();
IList<T> GetAll(Expression<Func<T, bool>> whereCondition);
IQueryable<T> GetQueryable();
IQueryable<T> GetQueryable(Expression<Func<T, bool>> whereCondition);
}
}
@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 組件的一般資訊是由下列的屬性集控制。
// 變更這些屬性的值即可修改組件的相關
// 資訊。
[assembly: AssemblyTitle("Chruch.Net.DAL.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Chruch.Net.DAL.Core")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 將 ComVisible 設為 false 可對 COM 元件隱藏
// 組件中的類型。若必須從 COM 存取此組件中的類型,
// 的類型,請在該類型上將 ComVisible 屬性設定為 true。
[assembly: ComVisible(false)]
// 下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID
[assembly: Guid("b9d6f9dc-8eb4-44e2-8625-98dfa2958084")]
// 組件的版本資訊由下列四個值所組成:
//
// 主要版本
// 次要版本
// 組建編號
// 修訂編號
//
// 您可以指定所有的值,或將組建編號或修訂編號設為預設值
//方法是使用 '*',如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -1,12 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.3" />
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
</ItemGroup>
</Project>
@@ -1,12 +0,0 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "6.0.1",
"commands": [
"dotnet-ef"
]
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

@@ -1,23 +0,0 @@
===================04/06/2022 10:40=========================
{
"message": "Alice\t\t: http://localhost:4200/invitation/2XB12RB1RP13Y\r\nAnderson\t\t: http://localhost:4200/invitation/3BSLUS79C2GUX\r\nAndrew\t\t: http://localhost:4200/invitation/35VQACK1CYD8K\r\nAndy\t\t: http://localhost:4200/invitation/3E0E57AQAEUEJ\r\nBetty\t\t: http://localhost:4200/invitation/2X2G8LHAHHJ4B\r\nElaine\t\t: http://localhost:4200/invitation/36NQVXGY4JVRK\r\nElisa\t\t: http://localhost:4200/invitation/3D3R97E997E6J\r\nKlaire\t\t: http://localhost:4200/invitation/36FK8G13A3GMK\r\nLeya\t\t: http://localhost:4200/invitation/37H7CJM37TR4F\r\nLidia\t\t: http://localhost:4200/invitation/370N18EP897EU\r\nNick\t\t: http://localhost:4200/invitation/2T2UY7X6JKAVW\r\nVictoria\t\t: http://localhost:4200/invitation/2TL7VD9XHD82P\r\n孟懿\t\t: http://localhost:4200/invitation/31CJKVAVXNHWN\r\n蕾絲\t\t: http://localhost:4200/invitation/38BY2VDRGUM3T\r\n",
"to": "U97e9e579a41a5222e33bf68a3bf479a0"
}===================08/26/2022 19:11=========================
Message Type:Message
UserId:U4af4980629...
Reply Token:nHuyWiB7yP5Zw52FIkcQobQuGDXCTA
Message Type:Text
Message:@example Hello, world! (love)
===================08/26/2022 19:12=========================
Message Type:Message
UserId:U4af4980629...
Reply Token:nHuyWiB7yP5Zw52FIkcQobQuGDXCTA
Message Type:Text
Message:@example Hello, world! (love)
===================08/27/2022 18:03=========================
Message Type:Message
UserId:U4af4980629...
Reply Token:nHuyWiB7yP5Zw52FIkcQobQuGDXCTA
Message Type:Text
Message:@example Hello, world! (love)
@@ -1,81 +0,0 @@
{
"destination": "xxxxxxxxxx",
"events": [
{
"replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA",
"type": "message",
"mode": "active",
"timestamp": 1462629479859,
"source": {
"type": "user",
"userId": "U4af4980629..."
},
"webhookEventId": "01FZ74A0TDDPYRVKNK77XKC3ZR",
"deliveryContext": {
"isRedelivery": false
},
"message": {
"id": "325708",
"type": "text",
"text": "@example Hello, world! (love)",
"emojis": [
{
"index": 23,
"length": 6,
"productId": "5ac1bfd5040ab15980c9b435",
"emojiId": "001"
}
],
"mention": {
"mentionees": [
{
"index": 0,
"length": 8,
"userId": "U850014438e..."
}
]
}
}
}
]
}{
"destination": "xxxxxxxxxx",
"events": [
{
"replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA",
"type": "message",
"mode": "active",
"timestamp": 1462629479859,
"source": {
"type": "user",
"userId": "U4af4980629..."
},
"webhookEventId": "01FZ74A0TDDPYRVKNK77XKC3ZR",
"deliveryContext": {
"isRedelivery": false
},
"message": {
"id": "325708",
"type": "text",
"text": "@example Hello, world! (love)",
"emojis": [
{
"index": 23,
"length": 6,
"productId": "5ac1bfd5040ab15980c9b435",
"emojiId": "001"
}
],
"mention": {
"mentionees": [
{
"index": 0,
"length": 8,
"userId": "U850014438e..."
}
]
}
}
}
]
}"{\r\n \"destination\": \"xxxxxxxxxx\",\r\n \"events\": [\r\n {\r\n \"replyToken\": \"nHuyWiB7yP5Zw52FIkcQobQuGDXCTA\",\r\n \"type\": \"message\",\r\n \"mode\": \"active\",\r\n \"timestamp\": 1462629479859,\r\n \"source\": {\r\n \"type\": \"user\",\r\n \"userId\": \"U4af4980629...\"\r\n },\r\n \"webhookEventId\": \"01FZ74A0TDDPYRVKNK77XKC3ZR\",\r\n \"deliveryContext\": {\r\n \"isRedelivery\": false\r\n },\r\n \"message\": {\r\n \"id\": \"325708\",\r\n \"type\": \"text\",\r\n \"text\": \"@example Hello, world! (love)\",\r\n \"emojis\": [\r\n {\r\n \"index\": 23,\r\n \"length\": 6,\r\n \"productId\": \"5ac1bfd5040ab15980c9b435\",\r\n \"emojiId\": \"001\"\r\n }\r\n ],\r\n \"mention\": {\r\n \"mentionees\": [\r\n {\r\n \"index\": 0,\r\n \"length\": 8,\r\n \"userId\": \"U850014438e...\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n}"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.
-58
View File
@@ -1,58 +0,0 @@
using Church.Net.DAL.EF;
using Church.Net.DAL.EFCoreDBF.Core;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System;
using WebAPI.Hubs;
using WebAPI;
using Newtonsoft.Json.Serialization;
using WebAPI.Services;
using Microsoft.AspNetCore.Authorization;
using WebAPI.Handlers;
namespace Church.Net.WebAPI.Bindings
{
public class APIBinding : IBinding
{
public void Binding(IServiceCollection services)
{
services.AddControllers().AddNewtonsoftJson(options =>
{
// Use the default property (Pascal) casing
options.SerializerSettings.ContractResolver = new DefaultContractResolver()
{
NamingStrategy = new CamelCaseNamingStrategy(),
};
//options.SerializerSettings.DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Unspecified;
options.SerializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore;
options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
});
services.AddSignalR();
services.AddSingleton<GameRoomLogic>();
services.AddSingleton<GameRoomHub>();
//Localted at \\ArkNAS\docker\ChurchAPI\docker-compose.yaml
string databaseConnString = Environment.GetEnvironmentVariable("DB_CONN_STRING");
#if DEBUG
databaseConnString = "Host=192.168.68.55;Port=49154;Database=Church;Username=chris;Password=1124";
#endif
//services.AddSingleton(_ => new DatabaseOptions { ConnectionString = databaseConnString });
services.AddSingleton(_ => new DatabaseOptions { ConnectionString = databaseConnString });
//services.AddSingleton<ChurchNetContext>(new ChurchNetContext());
services.AddDbContext<ChurchNetContext>(options =>
options.UseNpgsql(
//Configuration.GetConnectionString()
//"Host=192.168.68.55;Port=49154;Database=ChurchSandbox;Username=chris;Password=1124"
databaseConnString
));
services.AddHostedService<WorkerService>();
services.AddSingleton<IAuthorizationMiddlewareResultHandler, BasicAuthorizationMiddlewareResultHandler>();
}
}
}
-25
View File
@@ -1,25 +0,0 @@
using Church.Net.DAL.EFCoreDBF;
using Church.Net.DAL.EFCoreDBF.Core;
using Church.Net.DAL.EFCoreDBF.Interface;
using Church.Net.Entity;
using Church.Net.Entity.Games.MD2;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using WebAPI.Logics.Interface;
using WebAPI.Logics;
namespace Church.Net.WebAPI.Bindings
{
public class DALBinding : IBinding
{
public void Binding(IServiceCollection services)
{
services.AddScoped(typeof(ICrudDAL<>), typeof(CrudDALCBase<>));
services.AddScoped(typeof(ICombinedKeyCrudDAL<>), typeof(CombinedKeyCrudDALCBase<>));
services.AddScoped<ICrudDAL<MobInfo>, D2MobInfoDAL>();
//D2MobInfoDAL: CrudDALCBase<MobInfo>, ICrudDAL<MobInfo>
}
}
}
-9
View File
@@ -1,9 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
namespace Church.Net.WebAPI.Bindings
{
public interface IBinding
{
void Binding(IServiceCollection services);
}
}
@@ -1,40 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using WebAPI.Logics.Core;
using WebAPI.Logics.Interface;
using WebAPI.Logics;
using WebAPI.Services.AutoReplyCommands;
using WebAPI.Services.Interfaces;
using WebAPI.Services;
using Church.Net.Entity;
namespace Church.Net.WebAPI.Bindings
{
public class LogicBinding : IBinding
{
public void Binding(IServiceCollection services)
{
services.AddScoped<LineAutoBotService>();
services.AddScoped<IAutoReplyCommand, ArChurchInfo>();
services.AddScoped<IAutoReplyCommand, ArArkCellGroupInfo>();
services.AddScoped<IAutoReplyCommand, ArArkCellGroupDinner>();
services.AddScoped<IAutoReplyCommand, ArArkCellGroupPrayer>();
services.AddScoped<IAutoReplyCommand, ArHappinessGroupTask>();
services.AddScoped<IAutoReplyCommand, ArHappinessBEST>();
//services.AddScoped<IScheduledTask, MorningPrayer>();
services.AddScoped<VideoDownloadLogic>();
services.AddScoped<LogicService>();
services.AddScoped<PastoralDomainLogic>();
services.AddScoped(typeof(ICrudLogic<>), typeof(LogicBase<>));
services.AddScoped(typeof(ICombinedKeyCrudLogic<>), typeof(CombinedKeyLogicBase<>));
services.AddScoped<LineMessagingAccountLogic>();
services.AddScoped<ILoggingService, DbLoggingService>();
services.AddScoped<IdentityService>();
services.AddScoped<ICrudLogic<FamilyMember>, MemberLogic>();
}
}
}
@@ -1,55 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>983731f5-925d-44ec-b4c8-a7c4ad857569</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<FileVersion>1.0.0.2</FileVersion>
<StartupObject></StartupObject>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\LineMessaging\LineMessaging.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Controllers\PasswordLogin\" />
<Folder Include="Filters\" />
<Folder Include="DAL\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="LineBotSDK" Version="2.8.35" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.11" />
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.7" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.10" />
<PackageReference Include="QRCoder-ImageSharp" Version="0.9.0" />
<PackageReference Include="SharpGrabber.Converter" Version="1.1.0" />
<PackageReference Include="SharpGrabber.YouTube" Version="1.5.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
</ItemGroup>
<ItemGroup>
<None Update="App_Data\ScaneMeQrCode.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
@@ -1,148 +0,0 @@
using Church.Net.Entity;
using Church.Net.Entity.Interface;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
using WebAPI.Logics.Interface;
namespace WebAPI.Controllers
{
[Authorize]
public class ApiControllerBase<T> : ControllerBase where T : IEntity
{
protected readonly ICrudLogic<T> logic;
public ApiControllerBase(ICrudLogic<T> logic)
{
this.logic = logic;
}
[HttpGet]
public virtual async Task<IEnumerable<T>> GetAll()
{
return await Task.Run(() => { return logic.GetAll(); });
}
[HttpGet]
public virtual async Task<T> GetById(string id)
{
return await Task.Run(() => {
return logic.GetById(id);
});
}
[HttpPost]
public virtual async Task<int> Update(T entity)
{
return await Task.Run(() => {
return logic.Update(entity);
});
}
[HttpPost]
public virtual async Task<T> CreateOrUpdate([FromBody] T entity)
{
return await Task.Run(() =>
{
logic.CreateOrUpdate(entity, out string id);
return entity;
});
}
[HttpPost]
public virtual async Task<IEnumerable<T>> CreateOrUpdateAll([FromBody] IEnumerable<T> entitys)
{
return await Task.Run(() =>
{
foreach (var item in entitys)
{
logic.CreateOrUpdate(item, out string id);
}
return entitys;
});
}
[HttpDelete("{id}")]
public virtual async Task<T> Delete(string id)
{
return await Task.Run(() => {
var entity = logic.GetById(id);
if (entity != null)
{
logic.Delete(entity);
}
return entity;
});
}
}
[Authorize]
public class CombinedKeyApiControllerBase<T> : ControllerBase where T : ICombinedKeyEntity
{
protected readonly ICombinedKeyCrudLogic<T> logic;
public CombinedKeyApiControllerBase(ICombinedKeyCrudLogic<T> logic)
{
this.logic = logic;
}
[HttpGet]
public virtual async Task<IEnumerable<T>> GetAll()
{
return await Task.Run(() => { return logic.GetAll(); });
}
[HttpGet]
public virtual async Task<T> GetById(string[] ids)
{
return await Task.Run(() => {
return logic.GetById(ids);
});
}
[HttpPost]
public virtual async Task<int> Update(T entity)
{
return await Task.Run(() => {
return logic.Update(entity);
});
}
[HttpPost]
public virtual async Task<T> CreateOrUpdate([FromBody] T entity)
{
return await Task.Run(() =>
{
logic.CreateOrUpdate(entity);
return entity;
});
}
[HttpPost]
public virtual async Task<IEnumerable<T>> CreateOrUpdateAll([FromBody] IEnumerable<T> entitys)
{
return await Task.Run(() =>
{
foreach (var item in entitys)
{
logic.CreateOrUpdate(item);
}
return entitys;
});
}
[HttpDelete]
public virtual async Task<T> Delete(string[] ids)
{
return await Task.Run(() => {
var entity = logic.GetById(ids);
if (entity != null)
{
logic.Delete(entity);
}
return entity;
});
}
}
}
@@ -1,135 +0,0 @@
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Church.Net.Entity;
using Church.Net.Utility;
using Microsoft.AspNetCore.Mvc;
using QRCoder;
using SixLabors.Fonts;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Drawing.Processing;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Processing;
using WebAPI.Logics;
using WebAPI.Logics.Interface;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace WebAPI.Controllers
{
[Route("[controller]/[action]")]
[ApiController]
public class BestController : ApiControllerBase<HappinessBEST>
{
private readonly ICrudLogic<HappinessBEST> logic;
private readonly ICrudLogic<HappinessWeek> weekLogic;
private readonly PastoralDomainLogic cellGroupLogic;
public BestController(
ICrudLogic<HappinessBEST> logic,
ICrudLogic<HappinessWeek> weekLogic,
PastoralDomainLogic cellGroupLogic
) : base(logic)
{
this.logic = logic;
this.weekLogic = weekLogic;
this.cellGroupLogic = cellGroupLogic;
}
// GET api/<BestController>/5
public override Task<IEnumerable<HappinessBEST>> GetAll()
{
return base.GetAll();
}
public override Task<HappinessBEST> GetById(string id)
{
return Task<HappinessBEST>.Run(() => {
var best = logic.GetById(id);
best.HappinessGroup = cellGroupLogic.GetById(best.GroupId);
best.HappinessGroup.HappinessWeeks = weekLogic.GetAll(w => w.GroupId == best.GroupId).OrderBy(w=>w.SEQ).ToList();
return best;
});
}
[HttpGet()]
public async Task<IActionResult> GetInvitationQRcode(string id)
{
QRCodeGenerator gen = new QRCodeGenerator();
QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode($"https://happiness.tours/invitation/{id}", QRCodeGenerator.ECCLevel.Q);
QRCode qrCode = new QRCode(qrCodeData);
var qrCodeImage = qrCode.GetGraphic(3);
string qrCodeImagePath = "/App_Data/ScaneMeQrCode.png";
var backgroundBitmap = SixLabors.ImageSharp.Image.Load(qrCodeImagePath);
//string qrCodeImagePath = Environment.GetEnvironmentVariable("AppData");
//HttpContext.Current.Server.MapPath("~/App_Data/");
//var fullPath = System.Web.Hosting.HostingEnvironment.MapPath(@"~/App_Data/ScaneMeQrCode.png");
//System.Web.Hosting.HostingEnvironment.MapPath(@"~/App_Data/yourXmlFile.xml");
int positionLeft = 0;
int positionTop = 0;
var best = logic.GetById(id);
if (best != null)
{
using (var memoryStream = new MemoryStream())
{
//fileStream.CopyTo(memoryStream);
var image = Superimpose(best.Name, backgroundBitmap, qrCodeImage, 10, 32);
image.Scalling(75);
image.SaveAsPng(memoryStream);
byte[] byteImage = memoryStream.ToArray();
return File(byteImage, "image/png");
}
}
return this.NotFound();
}
[HttpPost]
public int UpdateBestWeek(HappinessWeek week)
{
return cellGroupLogic.UpdateWeekInfo(week);
}
private Font arialFont;
[NonAction]
public Image Superimpose(string bestName, Image largeBmp, Image smallBmp, int? x = null, int? y = null)
{
FontCollection collection = new();
FontFamily family = collection.Add("/App_Data/arial.ttf");
arialFont = family.CreateFont(12, FontStyle.Italic);
//Graphics g = Graphics.FromImage(largeBmp);
//g.CompositingMode = CompositingMode.SourceOver;
//smallBmp.MakeTransparent();
int margin = 5;
if (!x.HasValue)
{
x = largeBmp.Width - smallBmp.Width - margin;
}
if (!y.HasValue)
{
y = largeBmp.Height - smallBmp.Height - margin;
}
var scale = 0.8;
var scaleWidth = (int)(smallBmp.Width * scale);
var scaleHeight = (int)(smallBmp.Height * scale);
largeBmp.Mutate(x => x.DrawText(bestName, arialFont, Color.Black, new PointF(10, 10)));
smallBmp.Scalling(80);
largeBmp.Mutate(ctx => ctx.DrawImage(smallBmp, new Point(x.Value, y.Value),1f));
return largeBmp;
}
}
}
@@ -1,24 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Church.Net.DAL.EF;
using Church.Net.Entity;
using WebAPI.Logics;
using WebAPI.Logics.Interface;
namespace WebAPI.Controllers
{
[Route("[controller]/[action]")]
[ApiController]
public class CellGroupRoutineEventAttendeesController : CombinedKeyApiControllerBase<CellGroupRoutineEventAttendee>
{
public CellGroupRoutineEventAttendeesController(ICombinedKeyCrudLogic<CellGroupRoutineEventAttendee> logic) : base(logic)
{
}
}
}
@@ -1,71 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Church.Net.DAL.EF;
using Church.Net.Entity;
using Church.Net.Utility;
using Church.Net.DAL.EFCoreDBF;
using WebAPI.Logics;
using WebAPI.Logics.Interface;
namespace WebAPI.Controllers
{
[Route("[controller]/[action]")]
[ApiController]
public class CellGroupRoutineEventsController : ApiControllerBase<CellGroupRoutineEvent>
{
private readonly PastoralDomainLogic logic;
private readonly ICombinedKeyCrudLogic<CellGroupRoutineEventPrayer> prayerLogic;
private readonly ICombinedKeyCrudLogic<CellGroupRoutineEventAttendee> dinnerLogic;
public CellGroupRoutineEventsController(
PastoralDomainLogic logic,
ICrudLogic<CellGroupRoutineEvent> crudLogic,
ICombinedKeyCrudLogic<CellGroupRoutineEventPrayer> prayerLogic,
ICombinedKeyCrudLogic<CellGroupRoutineEventAttendee> dinnerLogic
) : base(crudLogic)
{
this.logic = logic;
this.prayerLogic = prayerLogic;
this.dinnerLogic = dinnerLogic;
}
// GET: api/CellGroupRoutineEvents
[HttpGet]
public CellGroupRoutineEvent GetComingEvent()
{
return logic.GetComingEvent();
}
[HttpGet]
public CellGroupRoutineEvent GetLastEvent()
{
return logic.GetLastEvent();
}
[HttpPost]
public int CreateOrUpdatePrayer(CellGroupRoutineEventPrayer p)
{
return prayerLogic.CreateOrUpdate(p);
}
[HttpPost]
public int CreateOrUpdateAttendees(CellGroupRoutineEventAttendee p)
{
return dinnerLogic.CreateOrUpdate(p);
}
}
[Route("[controller]/[action]")]
[ApiController]
public class CellGroupRoutineEventPrayerController : CombinedKeyApiControllerBase<CellGroupRoutineEventPrayer>
{
public CellGroupRoutineEventPrayerController(ICombinedKeyCrudLogic<CellGroupRoutineEventPrayer> logic) : base(logic)
{
}
}
}
@@ -1,16 +0,0 @@
using Church.Net.Entity;
using Microsoft.AspNetCore.Mvc;
using WebAPI.Logics.Interface;
namespace WebAPI.Controllers
{
[Route("[controller]/[action]")]
[ApiController]
public class ContributionController : ApiControllerBase<Contribution>
{
public ContributionController(ICrudLogic<Contribution> logic) : base(logic)
{
}
}
}
@@ -1,42 +0,0 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.IO;
using System.Linq;
using WebAPI;
using WebAPI.Services.Interfaces;
namespace Church.Net.WebAPI.Controllers
{
[Route("[controller]")]
[ApiController]
public class FileListController : ControllerBase
{
private readonly ILoggingService loggingService;
public FileListController(ILoggingService loggingService)
{
this.loggingService = loggingService;
}
[HttpGet("{*filePath}")]
public ActionResult<string[]> Get(string filePath)
{
string folderRootPath = "";
string folderPath = "";
try
{
#if DEBUG
folderRootPath = "//ArkNAS/docker/ChurchAPI/App_Data/Files";
#else
folderRootPath = "/App_Data/Files";
#endif
folderPath = System.IO.Path.Combine(folderRootPath, filePath);
return Directory.GetFiles(folderPath).Select(s=>s.Replace(folderRootPath,"").Replace(filePath, "").Replace("\\","/")).ToArray();
}
catch (System.Exception ex)
{
loggingService.Error(ex);
return NotFound();
}
}
}
}
@@ -1,40 +0,0 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.IO;
using WebAPI;
using WebAPI.Services.Interfaces;
namespace Church.Net.WebAPI.Controllers
{
[Route("[controller]")]
[ApiController]
public class FilesController : ControllerBase
{
private readonly ILoggingService loggingService;
public FilesController(ILoggingService loggingService)
{
this.loggingService = loggingService;
}
[HttpGet("{*filePath}")]
public IActionResult Get(string filePath)
{
try
{
string folderRootPath = "";
#if DEBUG
folderRootPath = "//ArkNAS/docker/ChurchAPI/App_Data/Files";
#else
folderRootPath = "/App_Data/Files";
#endif
return PhysicalFile(System.IO.Path.Combine(folderRootPath, filePath), "image/jpeg");
}
catch (System.Exception ex)
{
loggingService.Error(ex);
return NotFound();
}
}
}
}
@@ -1,57 +0,0 @@
using Church.Net.WebAPI.Models;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using WebAPI.Models.IceBreak;
using WebAPI;
using System.Linq;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace Church.Net.WebAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class GameRoomController : ControllerBase
{
private readonly GameRoomLogic gameRoomLogic;
public GameRoomController(GameRoomLogic gameRoomLogic)
{
this.gameRoomLogic = gameRoomLogic;
}
// GET: api/<GameRoomMessageController>
[HttpGet]
public IEnumerable<GameRoom> Get()
{
return gameRoomLogic.GameRooms;
}
// GET api/<GameRoomMessageController>/5
[HttpGet("{id}")]
public IEnumerable<IGamePlayer> Get(string roomId)
{
return gameRoomLogic.GameRooms.Where(r => r.Id == roomId).FirstOrDefault()?.Players;
}
// POST api/<GameRoomMessageController>
[HttpPost]
public void Post([FromBody] GamePlayer gamePlayer)
{
gameRoomLogic.CreateGameRoom(gamePlayer);
}
// PUT api/<GameRoomMessageController>/5
[HttpPut("{roomId}")]
public bool Put(string roomId, [FromBody] GamePlayer value)
{
return gameRoomLogic.UserJoinGameRoom(roomId, value);
}
// DELETE api/<GameRoomMessageController>/5
[HttpDelete("{id}")]
public void Delete(string id)
{
gameRoomLogic.UserLeave(new GamePlayer() { Id = id });
}
}
}
@@ -1,55 +0,0 @@
using Church.Net.WebAPI.Models;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
using WebAPI;
using WebAPI.Models.IceBreak;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace Church.Net.WebAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class GameRoomMessageController : ControllerBase
{
private readonly GameRoomLogic gameRoomLogic;
public GameRoomMessageController(GameRoomLogic gameRoomLogic)
{
this.gameRoomLogic = gameRoomLogic;
}
// GET: api/<GameRoomMessageController>
[HttpGet]
public IEnumerable<GameRoom> Get()
{
return gameRoomLogic.GameRooms;
}
// GET api/<GameRoomMessageController>/5
[HttpGet("{id}")]
public IEnumerable<IGamePlayer> Get(string roomId)
{
return gameRoomLogic.GameRooms.Where(r => r.Id == roomId).FirstOrDefault()?.Players;
}
// POST api/<GameRoomMessageController>
[HttpPost]
public void Post([FromBody] SignalRMessage message)
{
gameRoomLogic.SendMessage(message);
}
// PUT api/<GameRoomMessageController>/5
[HttpPut("{id}")]
public void Put(int id, [FromBody] string value)
{
}
// DELETE api/<GameRoomMessageController>/5
[HttpDelete("{id}")]
public void Delete(int id)
{
}
}
}
@@ -1,18 +0,0 @@
using Church.Net.Entity;
using Microsoft.AspNetCore.Mvc;
using WebAPI.Logics.Interface;
namespace WebAPI.Controllers
{
[Route("[controller]/[action]")]
[ApiController]
public class HappinessCostController : ApiControllerBase<HappinessCost>
{
public HappinessCostController(ICrudLogic<HappinessCost> logic) : base(logic)
{
}
}
}
@@ -1,23 +0,0 @@
using Church.Net.Entity;
using Church.Net.Entity.Messenger;
using LineMessaging;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Threading.Tasks;
using WebAPI.Logics;
using WebAPI.Logics.Interface;
namespace WebAPI.Controllers
{
[Route("[controller]/[action]")]
[ApiController]
public class HappinessWeekTaskController : ApiControllerBase<HappinessTask>
{
public HappinessWeekTaskController(ICrudLogic<HappinessTask> logic) : base(logic)
{
}
}
}
@@ -1,131 +0,0 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Church.Net.DAL.EF;
using Church.Net.Entity;
using Church.Net.Utility;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Primitives;
using QRCoder;
using LineMessaging;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using System.Text;
using WebAPI.Services;
using Jint.Native;
using WebAPI.Services.Interfaces;
using Church.Net.DAL.EFCoreDBF.Migrations;
using WebAPI.Logics;
using Church.Net.DAL.EFCoreDBF.Interface;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace WebAPI.Controllers
{
//[Route("[controller]")]
[ApiController]
[Route("[controller]/[action]")]
public class LineMessageController : ControllerBase
{
private readonly LineAutoBotService lineAutoBotService;
private readonly ILoggingService loggingService;
private readonly ICrudDAL<LineMessagingAccount> crudDAL;
private readonly PastoralDomainLogic pastoralDomainLogic;
public LineMessageController(
LineAutoBotService lineAutoBotService,
ILoggingService loggingService,
ICrudDAL<LineMessagingAccount> crudDAL,
PastoralDomainLogic pastoralDomainLogic
)
{
this.lineAutoBotService = lineAutoBotService;
this.loggingService = loggingService;
this.crudDAL = crudDAL;
this.pastoralDomainLogic = pastoralDomainLogic;
}
//private ChurchNetContext dbContext = new ChurchNetContext();
//// GET: api/<BestController>
//[HttpGet]
//public IEnumerable<string> Get()
//{
// return new string[] { "value2222", "value4" };
//}
//// GET api/<BestController>/5
//[HttpGet("{id}")]
//public HappinessBEST Get(string id)
//{
// var best = dbContext.HappinessBESTs.Include(b => b.HappinessGroup).ThenInclude(b => b.Weeks).FirstOrDefault(b => b.BestId == id);
// best.HappinessGroup.Weeks = best.HappinessGroup.Weeks.OrderBy(w => w.SEQ).ToList();
// return best;
//}
// POST api/<BestController>
[HttpPost]
public async Task PostFromLine(int seq, [FromBody] object jsonData)
{
//string txtPath = ServerUtils.MapPath("App_Data/LinePostRawLog.txt");
//System.IO.File.AppendAllText(txtPath, JsonConvert.SerializeObject(jsonData.ToString(), Formatting.Indented));
try
{
LineMessagingAccount lineAccount = crudDAL.GetAll(l => l.Seq == seq).FirstOrDefault();
if (lineAccount != null)
{
LineWebhookContent content = JsonConvert.DeserializeObject<LineWebhookContent>(jsonData.ToString());
await lineAutoBotService.AutoReply(lineAccount,content);
}
//this.loggingService.Log("PostFromLine");
}
catch (Exception ex)
{
this.loggingService.Error(ex);
}
//Cac4ac5a8d7fc52daa444d71dc7c360a9 方舟小組 GroupID
//Ca20e3b65aa58e676815eb13c3222591a 方舟小組同工 GroupID
//var test = new LineMessaging.();
//var test = new LineMessagingClient("WFAyMvMEZ86cfMJIAzE+yklUZGpeS/jFYTeL9a9O35QR83oNMmwaUJfyEe48Kegadz0BArDdBoySxs479U1pwTHtlyH+Sm4jqlz8BwukX/Hsa4D1fX03Qn4zFu7TwPFKWFXnZbWq89Yg0iNzjpfTNwdB04t89/1O/w1cDnyilFU=");
//test.PushMessage(value.To, new LineTextMessage() { Text = value.Message });
}
[HttpPut("{id}")]
public async void PushTextMessage(string id, [FromBody] LineMessage value)
{
var test = new LineMessagingClient();
await test.PushMessage(id, new LineTextMessage() { Text = value.Message });
}
[HttpGet]
public Task PushCommandMessage(string groupId, string command)
{
return lineAutoBotService.PushCommandMessage(pastoralDomainLogic.GetById(groupId), "#" + command);
}
}
public class LineMessage
{
public string To { get; set; }
public string Message { get; set; }
}
}
@@ -1,48 +0,0 @@
using Church.Net.Entity;
using Church.Net.Entity.Messenger;
using LineMessaging;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Threading.Tasks;
using WebAPI.Logics;
using WebAPI.Logics.Interface;
namespace WebAPI.Controllers
{
[Route("[controller]/[action]")]
[ApiController]
public class LineMessagingAccountController : ApiControllerBase<LineMessagingAccount>
{
public LineMessagingAccountController(LineMessagingAccountLogic logic) : base(logic)
{
}
[HttpGet]
public void RefreshAllQuota()
{
foreach (var item in logic.GetAll())
{
if (!string.IsNullOrWhiteSpace(item.ChatToken))
{
var lineMessegeClient = new LineMessagingClient(item.ChatToken);
item.TotalUsage = lineMessegeClient.GetTotalUsage().Result;
logic.Update(item);
}
}
}
}
[Route("[controller]/[action]")]
[ApiController]
public class LineClientController : ApiControllerBase<LineMessageClient>
{
public LineClientController(ICrudLogic<LineMessageClient> logic) : base(logic)
{
}
}
}
@@ -1,60 +0,0 @@
using Church.Net.Entity;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using WebAPI.Logics.Interface;
using WebAPI.Services.Interfaces;
namespace WebAPI.Controllers
{
[Route("[controller]/[action]")]
[ApiController]
public class LogController : ApiControllerBase<LogInfo>
{
private readonly ILoggingService loggingService;
public LogController(
ICrudLogic<LogInfo> logic,
ILoggingService loggingService
) : base(logic)
{
this.loggingService = loggingService;
}
[HttpPost]
public void PurgeBefore([FromBody] DateTime date)
{
logic.Delete(l => l.Time <= date.ToUniversalTime());
}
[Route("/error-development")]
public IActionResult HandleErrorDevelopment(
[FromServices] IHostEnvironment hostEnvironment)
{
if (!hostEnvironment.IsDevelopment())
{
return NotFound();
}
var exceptionHandlerFeature =
HttpContext.Features.Get<IExceptionHandlerFeature>()!;
this.loggingService.Error(exceptionHandlerFeature.Error, exceptionHandlerFeature.Path);
return Problem(
detail: exceptionHandlerFeature.Error.StackTrace,
title: exceptionHandlerFeature.Error.Message);
}
[Route("/error")]
public IActionResult HandleError()
{
var exceptionHandlerFeature =
HttpContext.Features.Get<IExceptionHandlerFeature>()!;
this.loggingService.Error(exceptionHandlerFeature.Error, exceptionHandlerFeature.Path);
return Problem();
}
}
}
@@ -1,37 +0,0 @@
using Church.Net.Entity;
using Church.Net.Entity.Games.MD2;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Threading.Tasks;
using WebAPI.Logics.Interface;
namespace WebAPI.Controllers
{
[Route("[controller]/[action]")]
[ApiController]
public class MD2MobInfoController : ApiControllerBase<MobInfo>
{
public MD2MobInfoController(ICrudLogic<MobInfo> logic) : base(logic)
{
}
}
[Route("[controller]/[action]")]
[ApiController]
public class MobLevelInfoController : ApiControllerBase<MobLevelInfo>
{
public MobLevelInfoController(ICrudLogic<MobLevelInfo> logic) : base(logic)
{
}
}
[Route("[controller]/[action]")]
[ApiController]
public class MobSkillController : ApiControllerBase<MobSkill>
{
public MobSkillController(ICrudLogic<MobSkill> logic) : base(logic)
{
}
}
}
@@ -1,18 +0,0 @@
using Church.Net.Entity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Threading.Tasks;
using WebAPI.Logics.Interface;
namespace WebAPI.Controllers
{
[Route("[controller]/[action]")]
[ApiController]
public class MemberController : ApiControllerBase<FamilyMember>
{
public MemberController(ICrudLogic<FamilyMember> logic) : base(logic)
{
}
}
}
@@ -1,19 +0,0 @@
using Church.Net.Entity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Threading.Tasks;
using WebAPI.Logics.Interface;
namespace WebAPI.Controllers
{
[Route("[controller]/[action]")]
[ApiController]
public class NewVisitorController : ApiControllerBase<NewVisitor>
{
public NewVisitorController(ICrudLogic<NewVisitor> logic) : base(logic)
{
}
}
}
@@ -1,243 +0,0 @@
using Church.Net.DAL.EF;
using Church.Net.DAL.EFCoreDBF.Core;
using Church.Net.Entity;
using Church.Net.Utility;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NuGet.Common;
using NuGet.ProjectModel;
using System;
using System.IO;
using System.Linq;
using System.Net;
using WebAPI.Logics.Interface;
using WebAPI.ViewModel;
using static QRCoder.PayloadGenerator;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace WebAPI.Controllers
{
[ApiController]
public class PasswordLoginController : ControllerBase
{
private readonly ChurchNetContext churchNetContext;
private readonly ICrudLogic<FamilyMember> crudLogic;
private readonly ICombinedKeyCrudLogic<PastoralDomainMembers> relationLogic;
private readonly ICrudLogic<PastoralDomain> domainLogic;
// POST api/<PasswordLoginController>
public PasswordLoginController(
ICrudLogic<FamilyMember> crudLogic,
ICombinedKeyCrudLogic<PastoralDomainMembers> relationLogic,
ICrudLogic<PastoralDomain> domainLogic,
DatabaseOptions databaseOptions
)
{
this.crudLogic = crudLogic;
this.relationLogic = relationLogic;
this.domainLogic = domainLogic;
churchNetContext = databaseOptions.GetDbContext();
}
[HttpPost]
[Route("auth/login")]
public LoginTokenViewModel Login([FromBody] RegisterViewModel value)
{
FamilyMember member = null;
if (string.IsNullOrEmpty(value.OAuthType))
{
value.Email = value.Email.Trim().ToLower();
member = crudLogic.First(f => f.Password == value.Password && f.Email.ToLower() == value.Email.ToLower());
//member = this.churchNetContext.FamilyMembers
// .Where(f => f.Password == value.Password && f.Email.ToLower() == value.Email.ToLower()).FirstOrDefault();
}
return ToLoginTokenViewModel(member);
}
[HttpPost]
[Route("auth/sign-up")]
[Route("auth/oauth-login")]
public LoginTokenViewModel SignUp([FromBody] RegisterViewModel value)
{
FamilyMember member = null;
string loginToken = "";
if (!string.IsNullOrEmpty(value.OAuthType))
{
if (value.OAuthType == "google")
{
if (false == this.GetGoogleLoginInfo(ref value)) return null;
}
var userId = this.churchNetContext.FamilyMemberOAuths
.Where(f => f.OAuthType == value.OAuthType && f.OAuthAccessToken == value.AccessToken)
.Select(f => f.FamilyMemberId).FirstOrDefault();
if (string.IsNullOrEmpty(userId))
{
value.Email = value.Email.Trim().ToLower();
member = this.churchNetContext.FamilyMembers
.Where(m => m.Email.ToLower() == value.Email)
.FirstOrDefault();
if (member == null)
{
member = new FamilyMember()
{
Id = StringHelper.Get33BaseGuid(),
FirstName = value.FirstName,
LastName = value.LastName,
Email = value.Email,
AvatarImage = value.AvatarImage,
Password = StringHelper.Get33BaseGuid()
};
churchNetContext.Add(member);
}
else
{
member.AvatarImage = value.AvatarImage;
member.FirstName = value.FirstName;
member.LastName = value.LastName;
churchNetContext.Update(member);
}
churchNetContext.Add(new FamilyMemberOAuth()
{
FamilyMemberId = member.Id,
OAuthType = value.OAuthType,
OAuthAccessToken = value.AccessToken
});
churchNetContext.SaveChanges();
}
else
{
member = this.churchNetContext.FamilyMembers
.Where(f => f.Id == userId).FirstOrDefault();
}
}
else
{
value.Email = value.Email.Trim().ToLower();
if (!this.churchNetContext.FamilyMembers
.Any(f => f.Email == value.Email))
{
member = new FamilyMember()
{
Id = StringHelper.Get33BaseGuid(),
FirstName = value.FirstName,
LastName = value.LastName,
Email = value.Email,
AvatarImage = value.AvatarImage,
Password = value.Password
};
churchNetContext.Add(member);
churchNetContext.SaveChanges();
}
}
return ToLoginTokenViewModel(member);
}
[HttpPost]
[Route("auth/request-pass")]
public void RequestPassword([FromBody] RegisterViewModel value)
{
}
[HttpPost]
[Route("auth/reset-pass")]
public void ResetPassword([FromBody] RegisterViewModel value)
{
}
[HttpPost]
[Route("auth/loginwithtoken")]
public LoginTokenViewModel LoginWithToken([FromBody] LoginTokenViewModel value)
{
var memberId = TokenHelper.GetUserIdFromToken(value.Token);
if (!string.IsNullOrWhiteSpace(memberId))
{
var member = crudLogic.First(f => f.Id == memberId);
//var member = this.churchNetContext.FamilyMembers
// .Where(f => f.Id == memberId).FirstOrDefault();
return ToLoginTokenViewModel(member);
}
return null;
}
private LoginTokenViewModel ToLoginTokenViewModel(FamilyMember member)
{
if (member != null)
{
DateTime expiredTime = DateTime.Now.AddDays(30);
string token = TokenHelper.GenerateToken(member.Id, expiredTime);
var cellGroupId = churchNetContext.PastoralDomainMembers.Where(d => d.FamilyMemberId == member.Id).Select(d => d.PastoralDomainId).FirstOrDefault();
PastoralDomain cellGroup;
if (string.IsNullOrEmpty(cellGroupId))
{
cellGroup = churchNetContext.PastoralDomains.First();
relationLogic.Create(new PastoralDomainMembers(cellGroup.Id, member.Id));
}
else
{
cellGroup = churchNetContext.PastoralDomains.Where(g=>g.Id== cellGroupId).First();
}
return new LoginTokenViewModel()
{
MemberId = member.Id,
FirstName = member.FirstName,
LastName = member.LastName,
AvatarImage = member.AvatarImage,
Email = member.Email,
Token = token,
TokenExpireTime = expiredTime,
Role = member.Role,
CellGroup= cellGroup
};
}
return null;
}
private bool GetGoogleLoginInfo(ref RegisterViewModel model)
{
string uri = $"https://www.googleapis.com/oauth2/v2/userinfo?access_token={model.AccessToken}";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
try
{
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream stream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(stream))
{
string result = reader.ReadToEnd();
var obj = JsonConvert.DeserializeObject<JObject>(result);
if (obj.TryGetValue("email", out JToken value))
{
model.Email = ((string)value).ToLower().Trim();
model.FirstName = obj.GetValue<string>("given_name");
model.LastName = obj.GetValue<string>("family_name");
model.AvatarImage = obj.GetValue<string>("picture");
model.AccessToken = obj.GetValue<string>("id");
return true;
}
}
}
catch (Exception)
{
}
return false;
}
}
}
@@ -1,82 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Church.Net.Entity;
using WebAPI.Logics;
using WebAPI.Logics.Interface;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace WebAPI.Controllers
{
[Route("[controller]/[action]")]
[Authorize]
[ApiController]
public class PastoralDomainController : ApiControllerBase<PastoralDomain>
{
private readonly PastoralDomainLogic logic;
public PastoralDomainController(PastoralDomainLogic logic) : base(logic)
{
this.logic = logic;
}
[HttpGet]
public Task<IEnumerable<PastoralDomain>> GetCurrentUserPastoralDomain()
{
return Task.Run(() =>
{
return logic.GetCurrentUserPastoralDomain();
});
}
}
[Route("[controller]/[action]")]
[ApiController]
[Authorize]
public class DomainMemberShipController : CombinedKeyApiControllerBase<PastoralDomainMembers>
{
public DomainMemberShipController(ICombinedKeyCrudLogic<PastoralDomainMembers> logic) : base(logic)
{
}
[HttpPost]
public int AssignCellGroups(IEnumerable<PastoralDomainMembers> relations)
{
logic.Delete(r => relations.Any(rr => (r.FamilyMemberId == rr.FamilyMemberId)));
foreach (var relation in relations)
{
//logic.Delete(r => r.FamilyMemberId == relation.FamilyMemberId);
logic.Create(relation);
}
return 1;
}
[HttpGet]
public int AddMemberIntoGroup(string domainId, string memberId)
{
return logic.CreateOrUpdate(new PastoralDomainMembers() { PastoralDomainId = domainId, FamilyMemberId = memberId });
}
[HttpGet]
public int RemoveMemberFromGroup(string domainId, string memberId)
{
return logic.Delete(r => r.PastoralDomainId == domainId && r.FamilyMemberId == memberId);
}
[HttpPost]
public int UpdateMembersInGroup(PastoralDomain domain)
{
logic.Delete(r => r.PastoralDomainId == domain.Id);
foreach (var member in domain.FamilyMembers)
{
//logic.Delete(r => r.FamilyMemberId == relation.FamilyMemberId);
logic.Create(new PastoralDomainMembers() { PastoralDomainId = domain.Id, FamilyMemberId = member.Id });
}
return 1;
}
}
}
@@ -1,167 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Church.Net.Utility;
using LineMessaging;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using WebAPI.Logics;
using WebAPI.Services;
using static System.Net.Mime.MediaTypeNames;
using WebAPI.Services.Interfaces;
using WebAPI.Logics.Interface;
namespace WebAPI.Controllers
{
[ApiController]
[Route("[controller]/[action]")]
public class PingController : ControllerBase
{
private readonly IEnumerable<IAutoReplyCommand> autoReplyCommands;
private readonly PastoralDomainLogic pastoralDomainLogic;
private readonly LineAutoBotService lineAutoBotService;
public PingController(VideoDownloadLogic videoDownloadLogic,
IEnumerable<IAutoReplyCommand> autoReplyCommands
)
{
VideoDownloadLogic = videoDownloadLogic;
this.autoReplyCommands = autoReplyCommands;
}
public VideoDownloadLogic VideoDownloadLogic { get; }
[HttpGet]
public List<Controller> GetEndpoints()
{
//using (var fileStream = new FileStream(ServerUtils.MapPath("Church/Test.mp4"), FileMode.Create))
//{
//}
//await Task.Run(() => {
//this.VideoDownloadLogic.Download(@"https://www.youtube.com/watch?v=nJBLeMrhu9w", @"\\ArkNAS\Church\Test.mp4");
//});
Console.WriteLine($"Self GetEndpoints: {DateTime.Now}");
string @namespace = this.GetType().Namespace;
Type ApiControllerType = typeof(ControllerBase);
IEnumerable<Type> controllers = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(s => s.GetTypes())
.Where(t => t.Namespace == @namespace && ApiControllerType.IsAssignableFrom(t))
;
HashSet<string> baseMethods = new HashSet<string>(ApiControllerType.GetMethods(BindingFlags.Public | BindingFlags.Instance).Select(mi => mi.Name));
List<Controller> _controllers = new List<Controller>();
foreach (var controller in controllers)
{
Controller _controller = new Controller { Name = controller.Name.Replace("Controller", "") };
foreach (var methodInfo in controller.GetMethods(BindingFlags.Public | BindingFlags.Instance))
{
if (baseMethods.Contains(methodInfo.Name)) continue;
try
{
bool isGet = methodInfo.GetCustomAttributes(typeof(HttpGetAttribute), false).Length > 0;
bool isPost = methodInfo.GetCustomAttributes(typeof(HttpPostAttribute), false).Length > 0;
bool isDelete = methodInfo.GetCustomAttributes(typeof(HttpDeleteAttribute), false).Length > 0;
if (isGet || isPost || isDelete)
{
Endpoint _endpoint = new Endpoint
{
Name = methodInfo.Name,
Method = isGet ? "GET" : (isPost ? "POST" : (isDelete ? "DELETE" : "UNKNOWN")),
Inputs = methodInfo.GetParameters().Select(m => new Input() { Name = m.Name }).ToArray(),
ReturnType = methodInfo.ReturnType,
//MethodInfo = methodInfo,
};
//_endpoint.HasDocString = HasDocString(_endpoint);
_controller.Endpoints.Add(_endpoint);
}
}
catch (Exception ex)
{
}
}
_controllers.Add(_controller);
}
return _controllers;
}
[HttpGet]
public async void TestMessage()
{
//\\ArkNAS\Church\WorshipVideo
//this.VideoDownloadLogic.Download(@"https://www.youtube.com/watch?v=K2bdSYim7uI", @"\\ArkNAS\home\Test.mp4");
var test = new LineMessagingClient();
string text = "$$$$Menu Item";
var textMessage = new LineTextMessage() { Text = text, Emojis = new List<Emoji>() };
textMessage.AddEmoji("$$", "5ac1bfd5040ab15980c9b435", "002");
var templateMessage = new LineTemplateMessage<ButtonTemplateObject>();
var addPrayerBtn = new UriAction()
{
Uri = "https://happiness.tours/CellGroup/prayer",
Label = "Prayer"
};
templateMessage.AltText = "代禱事項";
templateMessage.Template.DefaultAction = addPrayerBtn;
templateMessage.Template.ThumbnailImageUrl = "https://dailyverses.net/images/tc/cuv/matthew-21-22-3.jpg";
templateMessage.Template.Title = "代禱事項";
templateMessage.Template.Text = "Chris" + Environment.NewLine + "Testwerewiorjowerjiowejiro, erjaiworjweiorjioawereaw";
templateMessage.Template.Actions = new List<ILineAction>();
templateMessage.Template.Actions.Add(addPrayerBtn);
await test.PushMessage(EnumHelper.EnumToDescriptionString(LineGroup.Chris), textMessage);
}
[HttpGet]
public string[] GetFiles(string path)
{
return Directory.GetFiles("/App_Data/" + path);
}
public class Controller
{
public string Name { get; set; }
public List<Endpoint> Endpoints { get; set; } = new List<Endpoint>();
}
public class Endpoint
{
public string Name { get; set; }
public string Method { get; set; }
public Input[] Inputs { get; set; }
public Type ReturnType { get; set; }
public MethodInfo MethodInfo { get; set; }
public bool HasDocString { get; set; }
}
public partial class Input
{
public string Name { get; set; }
public long Position { get; set; }
}
}
}
@@ -1,93 +0,0 @@
using Church.Net.Utility;
using Microsoft.AspNetCore.Mvc;
using QRCoder;
using SixLabors.Fonts;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Drawing.Processing;
using SixLabors.ImageSharp.Processing;
using System.IO;
using System.Threading.Tasks;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace Church.Net.WebAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class QRCodeController : ControllerBase
{
// GET api/<QRCodeController>/5
[HttpGet]
public async Task<IActionResult> Get(string content,int size)
{
QRCodeGenerator gen = new QRCodeGenerator();
QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(content, QRCodeGenerator.ECCLevel.Q);
QRCode qrCode = new QRCode(qrCodeData);
var qrCodeImage = qrCode.GetGraphic(size);
//string qrCodeImagePath = "/App_Data/ScaneMeQrCode.png";
//var backgroundBitmap = SixLabors.ImageSharp.Image.Load(qrCodeImagePath);
//string qrCodeImagePath = Environment.GetEnvironmentVariable("AppData");
//HttpContext.Current.Server.MapPath("~/App_Data/");
//var fullPath = System.Web.Hosting.HostingEnvironment.MapPath(@"~/App_Data/ScaneMeQrCode.png");
//System.Web.Hosting.HostingEnvironment.MapPath(@"~/App_Data/yourXmlFile.xml");
//int positionLeft = 0;
//int positionTop = 0;
//var best = logic.GetById(id);
//if (best != null)
//{
// using (var memoryStream = new MemoryStream())
// {
// //fileStream.CopyTo(memoryStream);
// var image = Superimpose(best.Name, backgroundBitmap, qrCodeImage, 10, 32);
// image.Scalling(75);
// image.SaveAsPng(memoryStream);
// byte[] byteImage = memoryStream.ToArray();
// return File(byteImage, "image/png");
// }
//}
using (var memoryStream = new MemoryStream())
{
qrCodeImage.SaveAsJpeg(memoryStream);
return File(memoryStream.ToArray(), "image/jpeg");
}
}
private Font arialFont;
[NonAction]
public Image Superimpose(string bestName, Image largeBmp, Image smallBmp, int? x = null, int? y = null)
{
FontCollection collection = new();
FontFamily family = collection.Add("/App_Data/arial.ttf");
arialFont = family.CreateFont(12, FontStyle.Italic);
//Graphics g = Graphics.FromImage(largeBmp);
//g.CompositingMode = CompositingMode.SourceOver;
//smallBmp.MakeTransparent();
int margin = 5;
if (!x.HasValue)
{
x = largeBmp.Width - smallBmp.Width - margin;
}
if (!y.HasValue)
{
y = largeBmp.Height - smallBmp.Height - margin;
}
var scale = 0.8;
var scaleWidth = (int)(smallBmp.Width * scale);
var scaleHeight = (int)(smallBmp.Height * scale);
largeBmp.Mutate(x => x.DrawText(bestName, arialFont, Color.Black, new PointF(10, 10)));
smallBmp.Scalling(80);
largeBmp.Mutate(ctx => ctx.DrawImage(smallBmp, new Point(x.Value, y.Value), 1f));
return largeBmp;
}
}
}
@@ -1,26 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace WebAPI.Controllers
{
[ApiController]
[Route("[controller]")]
public class VersionController : ControllerBase
{
[HttpGet]
public string Get()
{
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
System.Diagnostics.FileVersionInfo fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
string version = fvi.FileVersion;
return version;
}
}
}
@@ -1,40 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace WebAPI.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
}
}
}
@@ -1,56 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using WebAPI.Hubs;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace WebAPI.Controllers
{
[Route("[controller]")]
[ApiController]
public class WhoIsSpyController : ControllerBase
{
private readonly IHubContext<WhoIsSpyHub> hubContext;
public WhoIsSpyController(IHubContext<WhoIsSpyHub> hubContext)
{
this.hubContext = hubContext;
}
// GET: api/<WhoIsSpyController>
[HttpGet]
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/<WhoIsSpyController>/5
[HttpGet("{id}")]
public string Get(string id)
{
return "value";
}
// POST api/<WhoIsSpyController>
[HttpPost]
public void Post([FromBody] string value)
{
hubContext.Clients.All.SendAsync("");
}
// PUT api/<WhoIsSpyController>/5
[HttpPut("{id}")]
public void Put(string id, [FromBody] string value)
{
}
// DELETE api/<WhoIsSpyController>/5
[HttpDelete("{id}")]
public void Delete(string id)
{
}
}
}
@@ -1,216 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Transactions;
using System;
using Church.Net.DAL.EF;
using System.Linq;
using Church.Net.Utility;
using System.Threading.Tasks;
using Church.Net.Entity.Interface;
using System.ComponentModel.DataAnnotations;
using System.Reflection;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Church.Net.DAL.EFCoreDBF.Interface;
namespace Church.Net.DAL.EFCoreDBF.Core
{
public class CrudDALCBase1<T> : ICrudDAL<T> where T : class, IEntity, new()
{
private readonly ChurchNetContext dbContext;
public CrudDALCBase1(DatabaseOptions databaseOptions)
{
dbContext = databaseOptions.GetDbContext();
InitKeyProperty();
}
public IQueryable<T> GetDbSet()
{
//var result = (DbSet<T>)typeof(ChurchNetContext).GetMethod("Set").MakeGenericMethod(typeof(T)).Invoke(dbContext, null);
return dbContext.Set<T>().AsNoTracking();
//return result;
}
public virtual T First(Func<T, bool> filter = null)
{
return GetDbSet().Where(filter ?? (s => true)).FirstOrDefault();
}
public virtual T GetById(string Id)
{
return GetQuery(new string[] { Id }).FirstOrDefault();
}
//public virtual T GetByRefndx(string refndx)
//{
// return MapDBModelToEntity(GetFirstDBModelByRefndx<ST>(refndx, this.actionScreen));
//}
public virtual IEnumerable<T> GetAll(Func<T, bool> filter = null)
{
//var dbObjs = GetDbSet().ToArray();
//IEnumerable<T> list = GetDbSet().Where(filter ?? (s => true)).ToList();
return GetDbSet().AsNoTracking().Where(filter ?? (s => true)).ToList();
}
public virtual int Create(T entity)
{
CheckKeyIsEmpty(entity);
ConvertUTCTime(entity);
dbContext.Add(entity);
return dbContext.SaveChanges();
}
public virtual Task<int> CreateAsync(T entity)
{
CheckKeyIsEmpty(entity);
ConvertUTCTime(entity);
dbContext.Add(entity);
//CreateDone(entity, newDbObj);
return dbContext.SaveChangesAsync();
}
public int CreateOrUpdate(T entity)
{
int result = 0;
ConvertUTCTime(entity);
if (CheckExist(entity))
{
result = Update(entity);
}
else
{
result = Create(entity);
}
return result;
}
public virtual int Update(T entity)
{
//if (!this.CheckExist(entity))
//{
// throw new ArgumentNullException("the Id is not exist.");
//}
ConvertUTCTime(entity);
dbContext.Update(entity);
return dbContext.SaveChanges();
}
public virtual void CreateDone(T entity)
{
}
public virtual void UpdateDone(T entity)
{
}
public virtual int UpdateRange(IEnumerable<T> entities)
{
dbContext.UpdateRange(entities);
return dbContext.SaveChanges();
}
public virtual int Delete(T obj)
{
dbContext.Remove(obj);
return dbContext.SaveChanges();
}
public int Delete(Func<T, bool> filter)
{
var list = GetDbSet().Where(filter).ToList();
foreach (var item in list)
{
dbContext.Remove(item);
}
return dbContext.SaveChanges();
}
public virtual bool CheckExist(T obj)
{
//var query = GetDbSet().AsQueryable();
var query = GetAll();
List<PropertyInfo> props = new List<PropertyInfo>();
for (int i = 0; i < keyProps.Count; i++)
{
var prop = keyProps[i];
props.Add(prop);
var value = prop.GetValue(obj)?.ToString();
query = query.Where(e => prop.GetValue(e)?.ToString() == value).ToList();
}
return query.Any();
}
private void ConvertUTCTime(T entity)
{
var props = typeof(T).GetProperties();
foreach (var prop in props)
{
if (prop.PropertyType == typeof(DateTime))
{
//do stuff like prop.SetValue(t, DateTime.Now, null);
DateTime utcTime = ((DateTime)prop.GetValue(entity)).ToUniversalTime();
prop.SetValue(entity, utcTime, null);
}
}
}
private List<PropertyInfo> keyProps;
protected virtual void InitKeyProperty()
{
keyProps = typeof(T).GetProperties().Where(
prop => Attribute.IsDefined(prop, typeof(KeyAttribute))).OrderBy(prop =>
prop.GetCustomAttribute<ColumnAttribute>().Order
)
.ToList();
}
protected IQueryable<T> GetQuery(IEnumerable<string> Ids)
{
var query = GetDbSet().AsQueryable();
for (int i = 0; i < keyProps.Count; i++)
{
query = query.Where(e => keyProps[i].GetValue(e).ToString() == Ids.ElementAt(i));
}
return query;
}
protected virtual void CheckKeyIsEmpty(T entity)
{
if (string.IsNullOrWhiteSpace(entity.Id) || entity.Id.Length <= 3)
{
entity.Id = StringHelper.Get33BaseGuid();
}
}
public void Dispose()
{
throw new NotImplementedException();
}
public IEnumerable<T> GetAllById(IEnumerable<string> Ids)
{
throw new NotImplementedException();
}
}
}
@@ -1,254 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Transactions;
using System;
using Church.Net.DAL.EF;
using System.Linq;
using Church.Net.Utility;
using System.Threading.Tasks;
using Church.Net.Entity.Interface;
using System.ComponentModel.DataAnnotations;
using System.Reflection;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Church.Net.DAL.EFCoreDBF.Interface;
namespace Church.Net.DAL.EFCoreDBF.Core
{
public class CombinedKeyCrudDALCBase<T> : ICombinedKeyCrudDAL<T> where T : class, ICombinedKeyEntity, new()
{
private readonly DatabaseOptions databaseOptions;
public CombinedKeyCrudDALCBase(DatabaseOptions databaseOptions)
{
this.databaseOptions = databaseOptions;
InitKeyProperty();
}
public IQueryable<T> GetDbSet()
{
//var result = (DbSet<T>)typeof(ChurchNetContext).GetMethod("Set").MakeGenericMethod(typeof(T)).Invoke(dbContext, null);
return databaseOptions.GetDbContext().Set<T>().AsNoTracking();
//return result;
}
public ChurchNetContext GetDbContext()
{
//var result = (DbSet<T>)typeof(ChurchNetContext).GetMethod("Set").MakeGenericMethod(typeof(T)).Invoke(dbContext, null);
return databaseOptions.GetDbContext();//.Set<T>().AsNoTracking();
//return result;
}
public virtual T First(Func<T, bool> filter = null)
{
using (var dbContext = GetDbContext())
{
return dbContext.Set<T>().Where(filter ?? (s => true)).FirstOrDefault();
}
}
public virtual T GetById(IEnumerable<string> Ids)
{
return GetQuery(Ids).FirstOrDefault();
}
//public virtual T GetByRefndx(string refndx)
//{
// return MapDBModelToEntity(GetFirstDBModelByRefndx<ST>(refndx, this.actionScreen));
//}
public virtual IEnumerable<T> GetAll(Func<T, bool> filter = null)
{
//var dbObjs = GetDbSet().ToArray();
//IEnumerable<T> list = GetDbSet().Where(filter ?? (s => true)).ToList();
return GetDbSet().AsNoTracking().Where(filter ?? (s => true)).ToList();
}
public virtual IQueryable<T> GetQuery(Func<T, bool> filter = null)
{
//var dbObjs = GetDbSet().ToArray();
//IEnumerable<T> list = GetDbSet().Where(filter ?? (s => true)).ToList();
return GetDbSet().AsNoTracking().Where(filter ?? (s => true)).AsQueryable();
}
public virtual int Create(T entity)
{
CheckCombinedKeyIsEmpty(entity);
ConvertUTCTime(entity);
using (var dbContext = GetDbContext())
{
dbContext.Add(entity);
return dbContext.SaveChanges();
}
}
public virtual Task<int> CreateAsync(T entity)
{
CheckCombinedKeyIsEmpty(entity);
ConvertUTCTime(entity);
using (var dbContext = GetDbContext())
{
dbContext.Add(entity);
//CreateDone(entity, newDbObj);
return dbContext.SaveChangesAsync();
}
}
public int CreateOrUpdate(T entity)
{
int result = 0;
ConvertUTCTime(entity);
if (CheckExist(entity))
{
result = Update(entity);
}
else
{
result = Create(entity);
}
return result;
}
public virtual int Update(T entity)
{
//if (!this.CheckExist(entity))
//{
// throw new ArgumentNullException("the Id is not exist.");
//}
ConvertUTCTime(entity);
using (var dbContext = GetDbContext())
{
dbContext.Update(entity);
return dbContext.SaveChanges();
}
}
public virtual void CreateDone(T entity)
{
}
public virtual void UpdateDone(T entity)
{
}
public virtual int UpdateRange(IEnumerable<T> entities)
{
using (var dbContext = GetDbContext())
{
dbContext.UpdateRange(entities);
return dbContext.SaveChanges();
}
}
public virtual int Delete(T obj)
{
using (var dbContext = GetDbContext())
{
dbContext.Remove(obj);
return dbContext.SaveChanges();
}
}
public virtual int Delete(IEnumerable<string> combinedKeyIds)
{
var obj = GetById(combinedKeyIds);
return obj == null ? Delete(obj) : 0;
}
public int Delete(Func<T, bool> filter)
{
var list = GetDbSet().Where(filter).ToList();
using (var dbContext = GetDbContext())
{
foreach (var item in list)
{
dbContext.Remove(item);
}
return dbContext.SaveChanges();
}
}
public virtual bool CheckExist(T obj)
{
//var query = GetDbSet().AsQueryable();
var query = GetAll();
List<PropertyInfo> props = new List<PropertyInfo>();
for (int i = 0; i < keyProps.Count; i++)
{
var prop = keyProps[i];
props.Add(prop);
var value = prop.GetValue(obj)?.ToString();
query = query.Where(e => prop.GetValue(e)?.ToString() == value).ToList();
}
return query.Any();
}
private void ConvertUTCTime(T entity)
{
var props = typeof(T).GetProperties();
foreach (var prop in props)
{
if (prop.PropertyType == typeof(DateTime))
{
//do stuff like prop.SetValue(t, DateTime.Now, null);
DateTime utcTime = ((DateTime)prop.GetValue(entity)).ToUniversalTime();
prop.SetValue(entity, utcTime, null);
}
}
}
private List<PropertyInfo> keyProps;
private void InitKeyProperty()
{
keyProps = typeof(T).GetProperties().Where(
prop => Attribute.IsDefined(prop, typeof(KeyAttribute))).OrderBy(prop =>
prop.GetCustomAttribute<ColumnAttribute>().Order
)
.ToList();
}
private IQueryable<T> GetQuery(IEnumerable<string> Ids)
{
using (var dbContext = GetDbContext())
{
var query = dbContext.Set<T>().AsQueryable();
for (int i = 0; i < keyProps.Count; i++)
{
query = query.Where(e => keyProps[i].GetValue(e).ToString() == Ids.ElementAt(i));
}
return query;
}
}
private void CheckCombinedKeyIsEmpty(T entity)
{
for (int i = 0; i < keyProps.Count; i++)
{
if (string.IsNullOrEmpty(keyProps[i].GetValue(entity)?.ToString()))
{
throw new Exception($"Combined Key [{keyProps[i].Name}] not defined!");
}
}
}
}
}
-286
View File
@@ -1,286 +0,0 @@
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Transactions;
using System;
using Church.Net.DAL.EF;
using System.Linq;
using Church.Net.Utility;
using System.Threading.Tasks;
using Church.Net.Entity.Interface;
using Church.Net.DAL.EFCoreDBF.Interface;
namespace Church.Net.DAL.EFCoreDBF.Core
{
public class CrudDALCBase<T> : ICrudDAL<T> where T : class, IEntity, new()
{
private readonly DatabaseOptions databaseOptions;
//private readonly ChurchNetContext dbContext;
public CrudDALCBase(DatabaseOptions databaseOptions)
{
this.databaseOptions = databaseOptions;
//this.dbContext = databaseOptions.GetDbContext();
}
public virtual IQueryable<T> InitQuery(ChurchNetContext dbContext)
{
return dbContext.Set<T>();
}
public ChurchNetContext GetDbContext()
{
//var result = (DbSet<T>)typeof(ChurchNetContext).GetMethod("Set").MakeGenericMethod(typeof(T)).Invoke(dbContext, null);
return databaseOptions.GetDbContext();//.Set<T>().AsNoTracking();
//return result;
}
public virtual T First(Func<T, bool> filter = null)
{
using (var dbContext = GetDbContext())
{
return InitQuery(dbContext).Where(filter ?? (s => true)).FirstOrDefault();
}
}
public virtual T GetById(string Id)
{
using (var dbContext = GetDbContext())
{
return InitQuery(dbContext).FirstOrDefault(e => e.Id == Id);
}
}
//public virtual T GetByRefndx(string refndx)
//{
// return MapDBModelToEntity(GetFirstDBModelByRefndx<ST>(refndx, this.actionScreen));
//}
public virtual IEnumerable<T> GetAll(Func<T, bool> filter = null)
{
using (var dbContext = GetDbContext())
{
return InitQuery(dbContext).Where(filter ?? (s => true)).ToList();
}
//var dbObjs = GetDbContext().ToArray();
//IEnumerable<T> list = GetDbContext().Where(filter ?? (s => true)).ToList();
}
public virtual IEnumerable<T> GetAllById(IEnumerable<string> Ids)
{
using (var dbContext = GetDbContext())
{
var RowIds = Ids.Select(i => i.ToString());
//return GetDbContext().Where(e => RowIds.Any(id => id == e.Id));
//var list = new List<T>();
return InitQuery(dbContext).Where(e => RowIds.Any(id => id == e.Id)).ToArray();
}
}
private bool needGenId(T entity)
{
return string.IsNullOrWhiteSpace(entity.Id) || entity.Id.Length <= 3;
}
public virtual int Create(T entity)
{
if (needGenId(entity))
{
entity.Id = StringHelper.Get33BaseGuid();
}
ConvertUTCTime(entity);
using (var dbContext = GetDbContext())
{
dbContext.Add(entity);
return dbContext.SaveChanges();
}
}
public virtual Task<int> CreateAsync(T entity)
{
int result = 0;
ConvertUTCTime(entity);
if (needGenId(entity))
{
entity.Id = StringHelper.Get33BaseGuid();
}
T newDbObj = new T();
if (newDbObj != null)
{
//AfterCreatMapping(entity, newDbObj);
//newDbObj.RowId = entity.Id.ToString();
//result = Add(newDbObj) ? 1 : 0;
}
using (var dbContext = GetDbContext())
{
dbContext.Add(entity);
//CreateDone(entity, newDbObj);
return dbContext.SaveChangesAsync();
}
}
public virtual string CreateReturnId(T entity)
{
ConvertUTCTime(entity);
if (Create(entity) > 0)
{
return entity.Id;
}
else
{
return null;
};
}
public int CreateOrUpdate(T entity)
{
ConvertUTCTime(entity);
using (var dbContext = GetDbContext())
{
if (CheckExist(entity))
{
dbContext.Update(entity);
}
else
{
if (needGenId(entity))
{
entity.Id = StringHelper.Get33BaseGuid();
}
dbContext.Add(entity);
}
return dbContext.SaveChanges();
}
}
public virtual int Update(T entity)
{
using (var dbContext = GetDbContext())
{
//var dbObj = this.InitQuery(dbContext).Any(e => e.Id == entity.Id);
if (!InitQuery(dbContext).Any(e => e.Id == entity.Id))
{
throw new ArgumentNullException("the Id is not exist.");
}
ConvertUTCTime(entity);
dbContext.Update(entity);
return dbContext.SaveChanges();
}
}
public virtual void CreateDone(T entity)
{
}
public virtual void UpdateDone(T entity)
{
}
public virtual int UpdateRange(IEnumerable<T> entities)
{
foreach (var entity in entities)
{
ConvertUTCTime(entity);
}
using (var dbContext = GetDbContext())
{
dbContext.UpdateRange(entities);
return dbContext.SaveChanges();
}
}
public virtual int Delete(T obj)
{
using (var dbContext = GetDbContext())
{
dbContext.Remove(InitQuery(dbContext).FirstOrDefault(e => e.Id == obj.Id.ToString()));
return dbContext.SaveChanges();
}
}
public int Delete(Func<T, bool> filter)
{
using (var dbContext = GetDbContext())
{
var list = InitQuery(dbContext).Where(filter).ToList();
if (list.Count > 0)
{
dbContext.RemoveRange(list);
return dbContext.SaveChanges();
}
return 0;
}
}
public virtual bool CheckExist(T obj)
{
using (var dbContext = GetDbContext())
{
return InitQuery(dbContext).Any(e => e.Id == obj.Id);
}
}
private void ConvertUTCTime(T entity)
{
var props = typeof(T).GetProperties();
foreach (var prop in props)
{
if (prop.PropertyType == typeof(DateTime))
{
//do stuff like prop.SetValue(t, DateTime.Now, null);
DateTime localTime = (DateTime)prop.GetValue(entity);
if (localTime.Kind != DateTimeKind.Utc)
{
localTime = new DateTime(localTime.Year, localTime.Month, localTime.Day,
localTime.Hour, localTime.Minute, localTime.Second,
localTime.Millisecond, DateTimeKind.Local);
}
var offset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
var OutputTime = DateTime.SpecifyKind(localTime - offset, DateTimeKind.Utc);
DateTime utcTime = localTime.ToUniversalTime();
prop.SetValue(entity, utcTime, null);
}
else if (prop.PropertyType == typeof(DateTime?))
{
DateTime? localTime = (DateTime?)prop.GetValue(entity);
if (localTime.HasValue)
{
if (localTime.Value.Kind != DateTimeKind.Utc)
{
//localTime = DateTime.SpecifyKind(localTime.Value, DateTimeKind.Local);
localTime = new DateTime(localTime.Value.Year, localTime.Value.Month, localTime.Value.Day,
localTime.Value.Hour, localTime.Value.Minute, localTime.Value.Second,
localTime.Value.Millisecond, DateTimeKind.Local);
}
DateTime? utcTime = localTime.Value.ToUniversalTime();
prop.SetValue(entity, utcTime, null);
}
}
}
}
public IQueryable<T> GetDbSet()
{
return databaseOptions.GetDbContext().Set<T>().AsNoTracking();
}
}
}
@@ -1,16 +0,0 @@
using Church.Net.DAL.EF;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.DAL.EFCoreDBF.Core
{
public class DatabaseOptions
{
public string ConnectionString { get; set; }
public ChurchNetContext GetDbContext() => new ChurchNetContext(ConnectionString);
}
}
-28
View File
@@ -1,28 +0,0 @@
using Church.Net.DAL.EF;
using Church.Net.DAL.EFCoreDBF.Core;
using Church.Net.DAL.EFCoreDBF.Interface;
using Church.Net.Entity.Games.MD2;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.DAL.EFCoreDBF
{
public class D2MobInfoDAL : CrudDALCBase<MobInfo>, ICrudDAL<MobInfo>
{
public D2MobInfoDAL(DatabaseOptions databaseOptions) : base(databaseOptions)
{
}
public override IQueryable<MobInfo> InitQuery(ChurchNetContext dbContext)
{
return dbContext.Md2MobInfos
.Include(m=>m.MobLevelInfos).ThenInclude(s=>s.AttackInfo)
.Include(m => m.MobLevelInfos).ThenInclude(s => s.DefenceInfo)
.Include(m => m.MobLevelInfos).ThenInclude(s => s.Skills)
.Include(m => m.Skills);
}
}
}
@@ -1,175 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Church.Net.Entity;
using Church.Net.Entity.Games.MD2;
using Church.Net.Entity.Messenger;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
namespace Church.Net.DAL.EF
{
//public class ChurchNetContext:DbContext
//{
// public ChurchNetContext():base("entityFramework")
// {
// }
// public ChurchNetContext(string connString):base(connString)
// {
// }
// //public DbSet<PastoralDomain> PastoralDomains { get; set; }
// //public DbSet<FamilyMember> FamilyMembers { get; set; }
// //public DbSet<Career> Careers { get; set; }
// public DbSet<NewVisitor> NewVisitors { get; set; }
// //public DbSet<Religion> Religions { get; set; }
// protected override void OnModelCreating(DbModelBuilder modelBuilder)
// {
// modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
// }
//}
public class ChurchNetContext : DbContext
{
private static bool _created = true;
private readonly string connectionString;
public ChurchNetContext(DbContextOptions<ChurchNetContext> options) : base(options)
{
}
//public ChurchNetContext()
//{
// var folder = Environment.SpecialFolder.LocalApplicationData;
// var path = Environment.GetFolderPath(folder);
// DbPath = System.IO.Path.Join(path, "ChurchNet.db");
// DbPath = @"C:\WebSites\ChurchNetAPI\App_Data\ChurchNet.db";
// if (!_created)
// {
// _created = true;
// Database.EnsureDeleted();
// Database.EnsureCreated();
// }
//}
public ChurchNetContext(string connectionString)
{
this.connectionString = connectionString;
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!string.IsNullOrWhiteSpace(connectionString))
{
optionsBuilder.UseNpgsql(connectionString);
}
}
//public DbSet<PastoralDomain> PastoralDomains { get; set; }
//public DbSet<FamilyMember> FamilyMembers { get; set; }
//public DbSet<Career> Careers { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
//modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
modelBuilder.Entity<CellGroupRoutineEventAttendee>()
.HasKey(tt => new { tt.EventId, tt.Id });
modelBuilder.Entity<CellGroupRoutineEventPrayer>()
.HasKey(tt => new { tt.EventId, tt.MemberId });
modelBuilder.Entity<FamilyMemberOAuth>()
.HasKey(tt => new { tt.FamilyMemberId, tt.OAuthType });
modelBuilder.Entity<PastoralDomainMembers>()
.HasKey(tt => new { tt.PastoralDomainId, tt.FamilyMemberId });
modelBuilder.Entity<PastoralDomainAutoReplys>()
.HasKey(tt => new { tt.PastoralDomainCommunityAppId, tt.AutoReplyItemId });
modelBuilder.Entity<PastoralDomainAutoReplys>()
.HasOne(tt => tt.PastoralDomain)
.WithMany(t => t.AutoReplyItemRelations)
.HasForeignKey(tt => tt.PastoralDomainCommunityAppId);
//.HasPrincipalKey(tt => tt.L);
//modelBuilder.Entity<PastoralDomainMembers>()
// .HasOne(t => t.PastoralDomain)
// .WithMany(tt => tt.FamilyMember)
// .HasForeignKey(f => f.ParentId);
modelBuilder.Entity<MD2DiceSet>().Property(x => x.Id).HasDefaultValueSql("uuid_generate_v4()");
modelBuilder.Entity<MobInfo>(entity =>
{
entity.Property(x => x.Id).HasDefaultValueSql("uuid_generate_v4()");
entity.HasMany(e => e.MobLevelInfos).WithOne().OnDelete(DeleteBehavior.Cascade);
entity.HasMany(e => e.Skills).WithOne(x=>x.MobInfo).OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity<MobLevelInfo>(entity =>
{
entity.Property(x => x.Id).HasDefaultValueSql("uuid_generate_v4()");
entity.HasMany(e => e.Skills).WithOne(x => x.MobLevelInfo).OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity<MobSkill>(entity =>
{
entity.Property(x => x.Id).HasDefaultValueSql("uuid_generate_v4()");
entity.Property(x => x.MobInfoId).IsRequired(false);
entity.Property(x => x.MobLevelInfoId).IsRequired(false);
});
}
public string DbPath { get; }
//protected override void OnConfiguring(DbContextOptionsBuilder options)
// => options.UseSqlite($"Data Source={DbPath}");
//protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
// => optionsBuilder.UseNpgsql("Host=my_host;Database=my_db;Username=my_user;Password=my_pw");
//public System.Data.Entity.DbSet<Church.Net.Entity.FamilyMember> FamilyMembers { get; set; }
#region DbSet
public DbSet<NewVisitor> NewVisitors { get; set; }
public DbSet<Religion> Religions { get; set; }
public DbSet<FamilyMemberOAuth> FamilyMemberOAuths { get; set; }
public DbSet<FamilyMember> FamilyMembers { get; set; }
public DbSet<PastoralDomainMembers> PastoralDomainMembers { get; set; }
public DbSet<Career> Careers { get; set; }
public DbSet<PastoralDomain> PastoralDomains { get; set; }
public DbSet<WhoIsSpy> WhoIsSpy { get; set; }
public DbSet<Vocabulary> Vocabulary { get; set; }
public DbSet<HappinessBEST> HappinessBESTs { get; set; }
public DbSet<HappinessWeek> HappinessWeeks { get; set; }
public DbSet<CellGroupRoutineEvent> CellGroupRoutineEvents { get; set; }
public DbSet<CellGroupRoutineEventAttendee> CellGroupRoutineEventAttendees { get; set; }
public DbSet<CellGroupRoutineEventPrayer> CellGroupRoutineEventPrayers { get; set; }
public DbSet<LogInfo> LogInfos { get; set; }
public DbSet<AutoReplyItem> AutoReplyItems { get; set; }
public DbSet<AddressInfo> AddressInfos { get; set; }
public DbSet<LineMessageClient> LineMessageClients { get; set; }
public DbSet<LineMessagingAccount> LineMessagingAccounts { get; set; }
public DbSet<Contribution> Contributions { get; set; }
public DbSet<HappinessCost> HappinessCosts { get; set; }
//public DbSet<GamePlayer> GamePlayers { get; set; }
public DbSet<MobInfo> Md2MobInfos { get; set; }
public DbSet<MobLevelInfo> Md2MobLevelInfos { get; set; }
#endregion
}
}
@@ -1,61 +0,0 @@
using Church.Net.Entity.Interface;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.DAL.EFCoreDBF.Interface
{
public interface ICrudDAL<T> where T : class, IEntity
{
IQueryable<T> GetDbSet();
T First(Func<T, bool> filter = null);
T GetById(string Id);
IEnumerable<T> GetAll(Func<T, bool> filter = null);
//IEnumerable<T> GetAllById(IEnumerable<string> Ids);
int Create(T entity);
Task<int> CreateAsync(T entity);
int CreateOrUpdate(T entity);
int Update(T entity);
void CreateDone(T entity);
void UpdateDone(T entity);
int UpdateRange(IEnumerable<T> entities);
int Delete(T obj);
int Delete(Func<T, bool> filter);
bool CheckExist(T obj);
IEnumerable<T> GetAllById(IEnumerable<string> Ids);
}
public interface ICombinedKeyCrudDAL<T> where T : class
{
IQueryable<T> GetDbSet();
T First(Func<T, bool> filter = null);
T GetById(IEnumerable<string> combinedKeyIds);
IEnumerable<T> GetAll(Func<T, bool> filter = null);
int Create(T entity);
Task<int> CreateAsync(T entity);
int CreateOrUpdate(T entity);
int Update(T entity);
void CreateDone(T entity);
void UpdateDone(T entity);
int UpdateRange(IEnumerable<T> entities);
int Delete(T obj);
int Delete(IEnumerable<string> combinedKeyIds);
int Delete(Func<T, bool> filter);
bool CheckExist(T obj);
IQueryable<T> GetQuery(Func<T, bool> filter = null);
}
}
@@ -1,572 +0,0 @@
// <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("20220825181329_Init")]
partial class Init
{
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.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<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
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.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<DateTime>("Birthday")
.HasColumnType("timestamp with time zone");
b.Property<string>("CareerId")
.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")
.IsRequired()
.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")
.IsRequired()
.HasColumnType("text");
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>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("HappinessGroups");
});
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<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.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>("PastoralDomainId")
.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>("Name")
.HasColumnType("text");
b.HasKey("PastoralDomainId");
b.HasIndex("LeaderMemberId");
b.ToTable("PastoralDomains");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainMembers", b =>
{
b.Property<string>("PastoralDomainMembersId")
.HasColumnType("text");
b.Property<string>("FamilyMemberId")
.HasColumnType("text");
b.Property<string>("PastoralDomainId")
.HasColumnType("text");
b.HasKey("PastoralDomainMembersId");
b.HasIndex("FamilyMemberId");
b.HasIndex("PastoralDomainId");
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.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.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.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.Navigation("Leader");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomainMembers", b =>
{
b.HasOne("Church.Net.Entity.FamilyMember", "FamilyMember")
.WithMany("PastoralDomains")
.HasForeignKey("FamilyMemberId");
b.HasOne("Church.Net.Entity.PastoralDomain", "PastoralDomain")
.WithMany("Members")
.HasForeignKey("PastoralDomainId");
b.Navigation("FamilyMember");
b.Navigation("PastoralDomain");
});
modelBuilder.Entity("Church.Net.Entity.CellGroupRoutineEvent", b =>
{
b.Navigation("Attendees");
});
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.PastoralDomain", b =>
{
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -1,382 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class Init : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Careers",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Careers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "CellGroupRoutineEvents",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
Time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
Address = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_CellGroupRoutineEvents", x => x.Id);
});
migrationBuilder.CreateTable(
name: "HappinessGroups",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: true),
BeginTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
Address = table.Column<string>(type: "text", nullable: true),
CityAndZipCode = table.Column<string>(type: "text", nullable: true),
InvitationText = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_HappinessGroups", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Religions",
columns: table => new
{
ReligionId = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Religions", x => x.ReligionId);
});
migrationBuilder.CreateTable(
name: "Vocabulary",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Word = table.Column<string>(type: "text", nullable: false),
DefinitionEn = table.Column<string>(type: "text", nullable: false),
DefinitionCh = table.Column<string>(type: "text", nullable: false),
NounPlural = table.Column<string>(type: "text", nullable: true),
VerbPast = table.Column<string>(type: "text", nullable: true),
VerbParticiple = table.Column<string>(type: "text", nullable: true),
PartOfSpeech = table.Column<int>(type: "integer", nullable: false),
ImagesUrl = table.Column<string>(type: "text", nullable: true),
InsertDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
PracticeDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
PracticeStage = table.Column<int>(type: "integer", nullable: false),
PracticeSelect = table.Column<bool>(type: "boolean", nullable: false),
PracticeMemorized = table.Column<bool>(type: "boolean", nullable: false),
PracticeVisualize = table.Column<bool>(type: "boolean", nullable: false),
PracticeApply = table.Column<bool>(type: "boolean", nullable: false),
PracticeReview = table.Column<bool>(type: "boolean", nullable: false),
PracticeSentence = table.Column<string>(type: "text", nullable: true),
FlashCardTimes = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Vocabulary", x => x.Id);
});
migrationBuilder.CreateTable(
name: "WhoIsSpy",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Answer1Cht = table.Column<string>(type: "text", nullable: true),
Answer1Chs = table.Column<string>(type: "text", nullable: true),
Answer1En = table.Column<string>(type: "text", nullable: true),
Answer2Cht = table.Column<string>(type: "text", nullable: true),
Answer2Chs = table.Column<string>(type: "text", nullable: true),
Answer2En = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_WhoIsSpy", x => x.Id);
});
migrationBuilder.CreateTable(
name: "FamilyMembers",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
Email = table.Column<string>(type: "text", nullable: false),
Password = table.Column<string>(type: "text", nullable: false),
AvatarImage = table.Column<string>(type: "text", nullable: true),
FirstName = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
LastName = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
Gender = table.Column<int>(type: "integer", nullable: false),
Birthday = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
Married = table.Column<bool>(type: "boolean", nullable: false),
DateOfBaptized = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
DateOfWalkIn = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
Address = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
ComunityAppId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
CareerId = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FamilyMembers", x => x.Id);
table.ForeignKey(
name: "FK_FamilyMembers_Careers_CareerId",
column: x => x.CareerId,
principalTable: "Careers",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "CellGroupRoutineEventAttendees",
columns: table => new
{
EventId = table.Column<string>(type: "text", nullable: false),
Id = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: true),
JoinPotluck = table.Column<bool>(type: "boolean", nullable: false),
PotluckItem = table.Column<string>(type: "text", nullable: true),
Comment = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_CellGroupRoutineEventAttendees", x => new { x.EventId, x.Id });
table.ForeignKey(
name: "FK_CellGroupRoutineEventAttendees_CellGroupRoutineEvents_Event~",
column: x => x.EventId,
principalTable: "CellGroupRoutineEvents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "HappinessBESTs",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
GroupId = table.Column<string>(type: "text", nullable: true),
Name = table.Column<string>(type: "text", nullable: false),
Email = table.Column<string>(type: "text", nullable: true),
Phone = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_HappinessBESTs", x => x.Id);
table.ForeignKey(
name: "FK_HappinessBESTs_HappinessGroups_GroupId",
column: x => x.GroupId,
principalTable: "HappinessGroups",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "HappinessWeeks",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
GroupId = table.Column<string>(type: "text", nullable: true),
Date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
InvitationText = table.Column<string>(type: "text", nullable: true),
Address = table.Column<string>(type: "text", nullable: true),
CityAndZipCode = table.Column<string>(type: "text", nullable: true),
SEQ = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_HappinessWeeks", x => x.Id);
table.ForeignKey(
name: "FK_HappinessWeeks_HappinessGroups_GroupId",
column: x => x.GroupId,
principalTable: "HappinessGroups",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "NewVisitors",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
FirstName = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
LastName = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
Gender = table.Column<int>(type: "integer", nullable: false),
Address = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: true),
Phone = table.Column<string>(type: "character varying(150)", maxLength: 150, nullable: false),
Email = table.Column<string>(type: "character varying(150)", maxLength: 150, nullable: true),
ComunityAppId = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
VisitingDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
BirthDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
Note = table.Column<string>(type: "text", nullable: true),
ReligionId = table.Column<int>(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_NewVisitors", x => x.Id);
table.ForeignKey(
name: "FK_NewVisitors_Religions_ReligionId",
column: x => x.ReligionId,
principalTable: "Religions",
principalColumn: "ReligionId");
});
migrationBuilder.CreateTable(
name: "FamilyMemberOAuths",
columns: table => new
{
FamilyMemberId = table.Column<string>(type: "text", nullable: false),
OAuthType = table.Column<string>(type: "text", nullable: false),
OAuthAccessToken = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FamilyMemberOAuths", x => new { x.FamilyMemberId, x.OAuthType });
table.ForeignKey(
name: "FK_FamilyMemberOAuths_FamilyMembers_FamilyMemberId",
column: x => x.FamilyMemberId,
principalTable: "FamilyMembers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "PastoralDomains",
columns: table => new
{
PastoralDomainId = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: true),
Description = table.Column<string>(type: "text", nullable: true),
Image1 = table.Column<string>(type: "text", nullable: true),
Image2 = table.Column<string>(type: "text", nullable: true),
Image3 = table.Column<string>(type: "text", nullable: true),
Image4 = table.Column<string>(type: "text", nullable: true),
Image5 = table.Column<string>(type: "text", nullable: true),
LeaderMemberId = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PastoralDomains", x => x.PastoralDomainId);
table.ForeignKey(
name: "FK_PastoralDomains_FamilyMembers_LeaderMemberId",
column: x => x.LeaderMemberId,
principalTable: "FamilyMembers",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "PastoralDomainMembers",
columns: table => new
{
PastoralDomainMembersId = table.Column<string>(type: "text", nullable: false),
PastoralDomainId = table.Column<string>(type: "text", nullable: true),
FamilyMemberId = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PastoralDomainMembers", x => x.PastoralDomainMembersId);
table.ForeignKey(
name: "FK_PastoralDomainMembers_FamilyMembers_FamilyMemberId",
column: x => x.FamilyMemberId,
principalTable: "FamilyMembers",
principalColumn: "Id");
table.ForeignKey(
name: "FK_PastoralDomainMembers_PastoralDomains_PastoralDomainId",
column: x => x.PastoralDomainId,
principalTable: "PastoralDomains",
principalColumn: "PastoralDomainId");
});
migrationBuilder.CreateIndex(
name: "IX_FamilyMembers_CareerId",
table: "FamilyMembers",
column: "CareerId");
migrationBuilder.CreateIndex(
name: "IX_HappinessBESTs_GroupId",
table: "HappinessBESTs",
column: "GroupId");
migrationBuilder.CreateIndex(
name: "IX_HappinessWeeks_GroupId",
table: "HappinessWeeks",
column: "GroupId");
migrationBuilder.CreateIndex(
name: "IX_NewVisitors_ReligionId",
table: "NewVisitors",
column: "ReligionId");
migrationBuilder.CreateIndex(
name: "IX_PastoralDomainMembers_FamilyMemberId",
table: "PastoralDomainMembers",
column: "FamilyMemberId");
migrationBuilder.CreateIndex(
name: "IX_PastoralDomainMembers_PastoralDomainId",
table: "PastoralDomainMembers",
column: "PastoralDomainId");
migrationBuilder.CreateIndex(
name: "IX_PastoralDomains_LeaderMemberId",
table: "PastoralDomains",
column: "LeaderMemberId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CellGroupRoutineEventAttendees");
migrationBuilder.DropTable(
name: "FamilyMemberOAuths");
migrationBuilder.DropTable(
name: "HappinessBESTs");
migrationBuilder.DropTable(
name: "HappinessWeeks");
migrationBuilder.DropTable(
name: "NewVisitors");
migrationBuilder.DropTable(
name: "PastoralDomainMembers");
migrationBuilder.DropTable(
name: "Vocabulary");
migrationBuilder.DropTable(
name: "WhoIsSpy");
migrationBuilder.DropTable(
name: "CellGroupRoutineEvents");
migrationBuilder.DropTable(
name: "HappinessGroups");
migrationBuilder.DropTable(
name: "Religions");
migrationBuilder.DropTable(
name: "PastoralDomains");
migrationBuilder.DropTable(
name: "FamilyMembers");
migrationBuilder.DropTable(
name: "Careers");
}
}
}
@@ -1,576 +0,0 @@
// <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("20220826040944_UpdateDomain")]
partial class UpdateDomain
{
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.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<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
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.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<DateTime>("Birthday")
.HasColumnType("timestamp with time zone");
b.Property<string>("CareerId")
.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")
.IsRequired()
.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")
.IsRequired()
.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>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("HappinessGroups");
});
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<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.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>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
b.ToTable("PastoralDomains");
});
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.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.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.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.Navigation("Leader");
});
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.CellGroupRoutineEvent", b =>
{
b.Navigation("Attendees");
});
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.PastoralDomain", b =>
{
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -1,160 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class UpdateDomain : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PastoralDomainMembers_FamilyMembers_FamilyMemberId",
table: "PastoralDomainMembers");
migrationBuilder.DropForeignKey(
name: "FK_PastoralDomainMembers_PastoralDomains_PastoralDomainId",
table: "PastoralDomainMembers");
migrationBuilder.DropPrimaryKey(
name: "PK_PastoralDomainMembers",
table: "PastoralDomainMembers");
migrationBuilder.DropIndex(
name: "IX_PastoralDomainMembers_PastoralDomainId",
table: "PastoralDomainMembers");
migrationBuilder.DropColumn(
name: "PastoralDomainMembersId",
table: "PastoralDomainMembers");
migrationBuilder.RenameColumn(
name: "PastoralDomainId",
table: "PastoralDomains",
newName: "Id");
migrationBuilder.AlterColumn<string>(
name: "PastoralDomainId",
table: "PastoralDomainMembers",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true)
.Annotation("Relational:ColumnOrder", 0);
migrationBuilder.AlterColumn<string>(
name: "FamilyMemberId",
table: "PastoralDomainMembers",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true)
.Annotation("Relational:ColumnOrder", 1);
migrationBuilder.AddColumn<int>(
name: "Role",
table: "FamilyMembers",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddPrimaryKey(
name: "PK_PastoralDomainMembers",
table: "PastoralDomainMembers",
columns: new[] { "PastoralDomainId", "FamilyMemberId" });
migrationBuilder.AddForeignKey(
name: "FK_PastoralDomainMembers_FamilyMembers_FamilyMemberId",
table: "PastoralDomainMembers",
column: "FamilyMemberId",
principalTable: "FamilyMembers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_PastoralDomainMembers_PastoralDomains_PastoralDomainId",
table: "PastoralDomainMembers",
column: "PastoralDomainId",
principalTable: "PastoralDomains",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PastoralDomainMembers_FamilyMembers_FamilyMemberId",
table: "PastoralDomainMembers");
migrationBuilder.DropForeignKey(
name: "FK_PastoralDomainMembers_PastoralDomains_PastoralDomainId",
table: "PastoralDomainMembers");
migrationBuilder.DropPrimaryKey(
name: "PK_PastoralDomainMembers",
table: "PastoralDomainMembers");
migrationBuilder.DropColumn(
name: "Role",
table: "FamilyMembers");
migrationBuilder.RenameColumn(
name: "Id",
table: "PastoralDomains",
newName: "PastoralDomainId");
migrationBuilder.AlterColumn<string>(
name: "FamilyMemberId",
table: "PastoralDomainMembers",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text")
.OldAnnotation("Relational:ColumnOrder", 1);
migrationBuilder.AlterColumn<string>(
name: "PastoralDomainId",
table: "PastoralDomainMembers",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text")
.OldAnnotation("Relational:ColumnOrder", 0);
migrationBuilder.AddColumn<string>(
name: "PastoralDomainMembersId",
table: "PastoralDomainMembers",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.AddPrimaryKey(
name: "PK_PastoralDomainMembers",
table: "PastoralDomainMembers",
column: "PastoralDomainMembersId");
migrationBuilder.CreateIndex(
name: "IX_PastoralDomainMembers_PastoralDomainId",
table: "PastoralDomainMembers",
column: "PastoralDomainId");
migrationBuilder.AddForeignKey(
name: "FK_PastoralDomainMembers_FamilyMembers_FamilyMemberId",
table: "PastoralDomainMembers",
column: "FamilyMemberId",
principalTable: "FamilyMembers",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_PastoralDomainMembers_PastoralDomains_PastoralDomainId",
table: "PastoralDomainMembers",
column: "PastoralDomainId",
principalTable: "PastoralDomains",
principalColumn: "PastoralDomainId");
}
}
}
@@ -1,610 +0,0 @@
// <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("20220827004541_AddPrayer")]
partial class AddPrayer
{
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.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<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
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<DateTime>("Birthday")
.HasColumnType("timestamp with time zone");
b.Property<string>("CareerId")
.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")
.IsRequired()
.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")
.IsRequired()
.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>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("HappinessGroups");
});
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<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.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>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
b.ToTable("PastoralDomains");
});
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.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.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.Navigation("Leader");
});
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.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.PastoralDomain", b =>
{
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -1,38 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddPrayer : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CellGroupRoutineEventPrayers",
columns: table => new
{
EventId = table.Column<string>(type: "text", nullable: false),
MemberId = table.Column<string>(type: "text", nullable: false),
Prayer = table.Column<string>(type: "text", nullable: true),
Comment = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_CellGroupRoutineEventPrayers", x => new { x.EventId, x.MemberId });
table.ForeignKey(
name: "FK_CellGroupRoutineEventPrayers_CellGroupRoutineEvents_EventId",
column: x => x.EventId,
principalTable: "CellGroupRoutineEvents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CellGroupRoutineEventPrayers");
}
}
}
@@ -1,650 +0,0 @@
// <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("20220828023808_AddLoggingService")]
partial class AddLoggingService
{
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.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<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
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<DateTime>("Birthday")
.HasColumnType("timestamp with time zone");
b.Property<string>("CareerId")
.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")
.IsRequired()
.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")
.IsRequired()
.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>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("HappinessGroups");
});
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<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.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.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>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
b.ToTable("PastoralDomains");
});
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.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.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.Navigation("Leader");
});
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.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.PastoralDomain", b =>
{
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -1,41 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddLoggingService : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "LogInfos",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
TrackNo = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Url = table.Column<string>(type: "text", nullable: true),
Message = table.Column<string>(type: "text", nullable: true),
Source = table.Column<string>(type: "text", nullable: true),
StackTrace = table.Column<string>(type: "text", nullable: true),
DetailMessage = table.Column<string>(type: "text", nullable: true),
UserId = table.Column<string>(type: "text", nullable: true),
Time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
Level = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_LogInfos", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "LogInfos");
}
}
}
@@ -1,717 +0,0 @@
// <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("20220830203338_AddAppId")]
partial class AddAppId
{
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.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<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
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<DateTime>("Birthday")
.HasColumnType("timestamp with time zone");
b.Property<string>("CareerId")
.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")
.IsRequired()
.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")
.IsRequired()
.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>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("HappinessGroups");
});
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<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.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.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>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
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.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.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.Navigation("Leader");
});
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.PastoralDomain", b =>
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -1,84 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddAppId : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "CommunityAppId",
table: "PastoralDomains",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.AddUniqueConstraint(
name: "AK_PastoralDomains_CommunityAppId",
table: "PastoralDomains",
column: "CommunityAppId");
migrationBuilder.CreateTable(
name: "AutoReplyItems",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
Command = table.Column<string>(type: "text", nullable: true),
Description = table.Column<string>(type: "text", nullable: true),
Content = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AutoReplyItems", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PastoralDomainAutoReplys",
columns: table => new
{
PastoralDomainCommunityAppId = table.Column<string>(type: "text", nullable: false),
AutoReplyItemId = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PastoralDomainAutoReplys", x => new { x.PastoralDomainCommunityAppId, x.AutoReplyItemId });
table.ForeignKey(
name: "FK_PastoralDomainAutoReplys_AutoReplyItems_AutoReplyItemId",
column: x => x.AutoReplyItemId,
principalTable: "AutoReplyItems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PastoralDomainAutoReplys_PastoralDomains_PastoralDomainComm~",
column: x => x.PastoralDomainCommunityAppId,
principalTable: "PastoralDomains",
principalColumn: "CommunityAppId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_PastoralDomainAutoReplys_AutoReplyItemId",
table: "PastoralDomainAutoReplys",
column: "AutoReplyItemId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PastoralDomainAutoReplys");
migrationBuilder.DropTable(
name: "AutoReplyItems");
migrationBuilder.DropUniqueConstraint(
name: "AK_PastoralDomains_CommunityAppId",
table: "PastoralDomains");
migrationBuilder.DropColumn(
name: "CommunityAppId",
table: "PastoralDomains");
}
}
}
@@ -1,757 +0,0 @@
// <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("20220907195903_AddMissingColumn")]
partial class AddMissingColumn
{
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<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
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>("Name")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("HappinessGroups");
});
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<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.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.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>("LogoImage")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("ServiceAddressId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
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.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.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.AddressInfo", "ServiceAddress")
.WithMany()
.HasForeignKey("ServiceAddressId");
b.Navigation("Leader");
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.PastoralDomain", b =>
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -1,167 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddMissingColumn : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "LogoImage",
table: "PastoralDomains",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ServiceAddressId",
table: "PastoralDomains",
type: "text",
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "Password",
table: "FamilyMembers",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "FamilyMembers",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<DateTime>(
name: "DateOfWalkIn",
table: "FamilyMembers",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "Birthday",
table: "FamilyMembers",
type: "timestamp with time zone",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AddColumn<bool>(
name: "Baptized",
table: "FamilyMembers",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "Comment",
table: "FamilyMembers",
type: "text",
nullable: true);
migrationBuilder.CreateTable(
name: "AddressInfos",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
Address = table.Column<string>(type: "text", nullable: true),
City = table.Column<string>(type: "text", nullable: true),
State = table.Column<string>(type: "text", nullable: true),
Zip = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AddressInfos", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_PastoralDomains_ServiceAddressId",
table: "PastoralDomains",
column: "ServiceAddressId");
migrationBuilder.AddForeignKey(
name: "FK_PastoralDomains_AddressInfos_ServiceAddressId",
table: "PastoralDomains",
column: "ServiceAddressId",
principalTable: "AddressInfos",
principalColumn: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_PastoralDomains_AddressInfos_ServiceAddressId",
table: "PastoralDomains");
migrationBuilder.DropTable(
name: "AddressInfos");
migrationBuilder.DropIndex(
name: "IX_PastoralDomains_ServiceAddressId",
table: "PastoralDomains");
migrationBuilder.DropColumn(
name: "LogoImage",
table: "PastoralDomains");
migrationBuilder.DropColumn(
name: "ServiceAddressId",
table: "PastoralDomains");
migrationBuilder.DropColumn(
name: "Baptized",
table: "FamilyMembers");
migrationBuilder.DropColumn(
name: "Comment",
table: "FamilyMembers");
migrationBuilder.AlterColumn<string>(
name: "Password",
table: "FamilyMembers",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "FamilyMembers",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "DateOfWalkIn",
table: "FamilyMembers",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "Birthday",
table: "FamilyMembers",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldNullable: true);
}
}
}
@@ -1,798 +0,0 @@
// <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("20220914151710_AddTaskToHappinessWeek")]
partial class AddTaskToHappinessWeek
{
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<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
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>("Name")
.HasColumnType("text");
b.HasKey("Id");
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.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.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>("LogoImage")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("ServiceAddressId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
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.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.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.AddressInfo", "ServiceAddress")
.WithMany()
.HasForeignKey("ServiceAddressId");
b.Navigation("Leader");
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
}
}
}
@@ -1,53 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddTaskToHappinessWeek : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Comment",
table: "HappinessWeeks",
type: "text",
nullable: true);
migrationBuilder.CreateTable(
name: "HappinessTask",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
WeekId = table.Column<string>(type: "text", nullable: true),
Type = table.Column<int>(type: "integer", nullable: false),
Tasker = table.Column<string>(type: "text", nullable: true),
Content = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_HappinessTask", x => x.Id);
table.ForeignKey(
name: "FK_HappinessTask_HappinessWeeks_WeekId",
column: x => x.WeekId,
principalTable: "HappinessWeeks",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_HappinessTask_WeekId",
table: "HappinessTask",
column: "WeekId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "HappinessTask");
migrationBuilder.DropColumn(
name: "Comment",
table: "HappinessWeeks");
}
}
}
@@ -1,823 +0,0 @@
// <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("20220929210007_AddLienClient")]
partial class AddLienClient
{
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<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
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>("Name")
.HasColumnType("text");
b.HasKey("Id");
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.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>("LogoImage")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("ServiceAddressId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
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.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.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.AddressInfo", "ServiceAddress")
.WithMany()
.HasForeignKey("ServiceAddressId");
b.Navigation("Leader");
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
}
}
}
@@ -1,43 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddLienClient : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "CommunityAppId",
table: "HappinessGroups",
type: "text",
nullable: true);
migrationBuilder.CreateTable(
name: "LineMessageClients",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
ClientId = table.Column<string>(type: "text", nullable: true),
IsGroup = table.Column<bool>(type: "boolean", nullable: false),
IsManager = table.Column<bool>(type: "boolean", nullable: false),
Name = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_LineMessageClients", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "LineMessageClients");
migrationBuilder.DropColumn(
name: "CommunityAppId",
table: "HappinessGroups");
}
}
}
@@ -1,845 +0,0 @@
// <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("20220930060508_LineMessageAccount")]
partial class LineMessageAccount
{
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<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
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>("Name")
.HasColumnType("text");
b.HasKey("Id");
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>("LogoImage")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("ServiceAddressId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LeaderMemberId");
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.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.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.AddressInfo", "ServiceAddress")
.WithMany()
.HasForeignKey("ServiceAddressId");
b.Navigation("Leader");
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
}
}
}
@@ -1,33 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class LineMessageAccount : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "LineMessagingAccounts",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: true),
ChatToken = table.Column<string>(type: "text", nullable: true),
TotalUsage = table.Column<int>(type: "integer", nullable: false),
Seq = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_LineMessagingAccounts", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "LineMessagingAccounts");
}
}
}
@@ -1,884 +0,0 @@
// <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
}
}
}
@@ -1,105 +0,0 @@
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");
}
}
}
@@ -1,882 +0,0 @@
// <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
}
}
}
@@ -1,79 +0,0 @@
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);
}
}
}
@@ -1,910 +0,0 @@
// <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
}
}
}
@@ -1,141 +0,0 @@
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");
}
}
}
@@ -1,843 +0,0 @@
// <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
}
}
}
@@ -1,107 +0,0 @@
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");
}
}
}
@@ -1,910 +0,0 @@
// <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("20221012223219_AddCost")]
partial class AddCost
{
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.Contribution", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<string>("Contributor")
.HasColumnType("text");
b.Property<string>("GroupId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("Contributions");
});
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.HappinessCost", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Tasker")
.HasColumnType("text");
b.Property<string>("WeekId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("WeekId");
b.ToTable("HappinessCosts");
});
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.Contribution", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "HappinessGroup")
.WithMany("Contributions")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
});
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.HappinessCost", b =>
{
b.HasOne("Church.Net.Entity.HappinessWeek", "HappinessWeek")
.WithMany("Costs")
.HasForeignKey("WeekId");
b.Navigation("HappinessWeek");
});
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("Costs");
b.Navigation("Tasks");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Bests");
b.Navigation("Contributions");
b.Navigation("HappinessWeeks");
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -1,70 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddCost : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Contributions",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
GroupId = table.Column<string>(type: "text", nullable: true),
Contributor = table.Column<string>(type: "text", nullable: true),
Amount = table.Column<decimal>(type: "numeric", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Contributions", x => x.Id);
table.ForeignKey(
name: "FK_Contributions_PastoralDomains_GroupId",
column: x => x.GroupId,
principalTable: "PastoralDomains",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "HappinessCosts",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
WeekId = table.Column<string>(type: "text", nullable: true),
Tasker = table.Column<string>(type: "text", nullable: true),
Content = table.Column<string>(type: "text", nullable: true),
Amount = table.Column<decimal>(type: "numeric", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_HappinessCosts", x => x.Id);
table.ForeignKey(
name: "FK_HappinessCosts_HappinessWeeks_WeekId",
column: x => x.WeekId,
principalTable: "HappinessWeeks",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_Contributions_GroupId",
table: "Contributions",
column: "GroupId");
migrationBuilder.CreateIndex(
name: "IX_HappinessCosts_WeekId",
table: "HappinessCosts",
column: "WeekId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Contributions");
migrationBuilder.DropTable(
name: "HappinessCosts");
}
}
}
@@ -1,916 +0,0 @@
// <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("20221017002753_AddTimeToContribution")]
partial class AddTimeToContribution
{
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.Contribution", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("Contributor")
.HasColumnType("text");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("Contributions");
});
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.HappinessCost", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Tasker")
.HasColumnType("text");
b.Property<string>("WeekId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("WeekId");
b.ToTable("HappinessCosts");
});
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.Contribution", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "HappinessGroup")
.WithMany("Contributions")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
});
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.HappinessCost", b =>
{
b.HasOne("Church.Net.Entity.HappinessWeek", "HappinessWeek")
.WithMany("Costs")
.HasForeignKey("WeekId");
b.Navigation("HappinessWeek");
});
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("Costs");
b.Navigation("Tasks");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Bests");
b.Navigation("Contributions");
b.Navigation("HappinessWeeks");
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -1,37 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddTimeToContribution : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Comment",
table: "Contributions",
type: "text",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "Time",
table: "Contributions",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Comment",
table: "Contributions");
migrationBuilder.DropColumn(
name: "Time",
table: "Contributions");
}
}
}
@@ -1,919 +0,0 @@
// <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("20230310201522_AddTimeZoneToGroup")]
partial class AddTimeZoneToGroup
{
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.Contribution", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("Contributor")
.HasColumnType("text");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("Contributions");
});
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.HappinessCost", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Tasker")
.HasColumnType("text");
b.Property<string>("WeekId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("WeekId");
b.ToTable("HappinessCosts");
});
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<string>("TimeZone")
.HasColumnType("text");
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.Contribution", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "HappinessGroup")
.WithMany("Contributions")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
});
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.HappinessCost", b =>
{
b.HasOne("Church.Net.Entity.HappinessWeek", "HappinessWeek")
.WithMany("Costs")
.HasForeignKey("WeekId");
b.Navigation("HappinessWeek");
});
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("Costs");
b.Navigation("Tasks");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Bests");
b.Navigation("Contributions");
b.Navigation("HappinessWeeks");
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -1,25 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddTimeZoneToGroup : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "TimeZone",
table: "PastoralDomains",
type: "text",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "TimeZone",
table: "PastoralDomains");
}
}
}
@@ -1,984 +0,0 @@
// <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("20240502213000_AddMD2MobInfo")]
partial class AddMD2MobInfo
{
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.Contribution", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("Contributor")
.HasColumnType("text");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("Contributions");
});
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.Games.MD2.MobInfo", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasDefaultValueSql("uuid_generate_v4()");
b.Property<int>("From")
.HasColumnType("integer");
b.Property<int>("Type")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Md2MobInfos");
});
modelBuilder.Entity("Church.Net.Entity.Games.MD2.MobLevelInfo", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasDefaultValueSql("uuid_generate_v4()");
b.Property<Guid>("MobInfoId")
.HasColumnType("uuid");
b.Property<Guid>("MobInfoId1")
.HasColumnType("uuid");
b.Property<Guid>("MobInfoId2")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("MobInfoId");
b.HasIndex("MobInfoId1");
b.ToTable("Md2MobLevelInfos");
});
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.HappinessCost", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Tasker")
.HasColumnType("text");
b.Property<string>("WeekId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("WeekId");
b.ToTable("HappinessCosts");
});
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<string>("TimeZone")
.HasColumnType("text");
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.Contribution", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "HappinessGroup")
.WithMany("Contributions")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
});
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.Games.MD2.MobLevelInfo", b =>
{
b.HasOne("Church.Net.Entity.Games.MD2.MobInfo", "MobInfo")
.WithMany()
.HasForeignKey("MobInfoId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Church.Net.Entity.Games.MD2.MobInfo", null)
.WithMany("MobLevelInfos")
.HasForeignKey("MobInfoId1")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MobInfo");
});
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.HappinessCost", b =>
{
b.HasOne("Church.Net.Entity.HappinessWeek", "HappinessWeek")
.WithMany("Costs")
.HasForeignKey("WeekId");
b.Navigation("HappinessWeek");
});
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.Games.MD2.MobInfo", b =>
{
b.Navigation("MobLevelInfos");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.Navigation("Costs");
b.Navigation("Tasks");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Bests");
b.Navigation("Contributions");
b.Navigation("HappinessWeeks");
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -1,71 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddMD2MobInfo : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Md2MobInfos",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false, defaultValueSql: "uuid_generate_v4()"),
Type = table.Column<int>(type: "integer", nullable: false),
From = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Md2MobInfos", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Md2MobLevelInfos",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false, defaultValueSql: "uuid_generate_v4()"),
MobInfoId = table.Column<Guid>(type: "uuid", nullable: false),
MobInfoId1 = table.Column<Guid>(type: "uuid", nullable: false),
MobInfoId2 = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Md2MobLevelInfos", x => x.Id);
table.ForeignKey(
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId",
column: x => x.MobInfoId,
principalTable: "Md2MobInfos",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId1",
column: x => x.MobInfoId1,
principalTable: "Md2MobInfos",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Md2MobLevelInfos_MobInfoId",
table: "Md2MobLevelInfos",
column: "MobInfoId");
migrationBuilder.CreateIndex(
name: "IX_Md2MobLevelInfos_MobInfoId1",
table: "Md2MobLevelInfos",
column: "MobInfoId1");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Md2MobLevelInfos");
migrationBuilder.DropTable(
name: "Md2MobInfos");
}
}
}
@@ -1,978 +0,0 @@
// <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("20240502213603_AddMD2MobInfoUpdateId")]
partial class AddMD2MobInfoUpdateId
{
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.Contribution", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("Contributor")
.HasColumnType("text");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("Contributions");
});
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.Games.MD2.MobInfo", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("text")
.HasDefaultValueSql("uuid_generate_v4()");
b.Property<int>("From")
.HasColumnType("integer");
b.Property<int>("Type")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Md2MobInfos");
});
modelBuilder.Entity("Church.Net.Entity.Games.MD2.MobLevelInfo", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("text")
.HasDefaultValueSql("uuid_generate_v4()");
b.Property<string>("MobInfoId")
.HasColumnType("text");
b.Property<string>("MobInfoId2")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("MobInfoId");
b.HasIndex("MobInfoId2");
b.ToTable("Md2MobLevelInfos");
});
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.HappinessCost", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Tasker")
.HasColumnType("text");
b.Property<string>("WeekId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("WeekId");
b.ToTable("HappinessCosts");
});
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<string>("TimeZone")
.HasColumnType("text");
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.Contribution", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "HappinessGroup")
.WithMany("Contributions")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
});
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.Games.MD2.MobLevelInfo", b =>
{
b.HasOne("Church.Net.Entity.Games.MD2.MobInfo", "MobInfo")
.WithMany()
.HasForeignKey("MobInfoId");
b.HasOne("Church.Net.Entity.Games.MD2.MobInfo", null)
.WithMany("MobLevelInfos")
.HasForeignKey("MobInfoId2")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("MobInfo");
});
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.HappinessCost", b =>
{
b.HasOne("Church.Net.Entity.HappinessWeek", "HappinessWeek")
.WithMany("Costs")
.HasForeignKey("WeekId");
b.Navigation("HappinessWeek");
});
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.Games.MD2.MobInfo", b =>
{
b.Navigation("MobLevelInfos");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.Navigation("Costs");
b.Navigation("Tasks");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Bests");
b.Navigation("Contributions");
b.Navigation("HappinessWeeks");
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
@@ -1,168 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
public partial class AddMD2MobInfoUpdateId : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId",
table: "Md2MobLevelInfos");
migrationBuilder.DropForeignKey(
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId1",
table: "Md2MobLevelInfos");
migrationBuilder.DropIndex(
name: "IX_Md2MobLevelInfos_MobInfoId1",
table: "Md2MobLevelInfos");
migrationBuilder.DropColumn(
name: "MobInfoId1",
table: "Md2MobLevelInfos");
migrationBuilder.AlterColumn<string>(
name: "MobInfoId2",
table: "Md2MobLevelInfos",
type: "text",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uuid");
migrationBuilder.AlterColumn<string>(
name: "MobInfoId",
table: "Md2MobLevelInfos",
type: "text",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uuid");
migrationBuilder.AlterColumn<string>(
name: "Id",
table: "Md2MobLevelInfos",
type: "text",
nullable: false,
defaultValueSql: "uuid_generate_v4()",
oldClrType: typeof(Guid),
oldType: "uuid",
oldDefaultValueSql: "uuid_generate_v4()");
migrationBuilder.AlterColumn<string>(
name: "Id",
table: "Md2MobInfos",
type: "text",
nullable: false,
defaultValueSql: "uuid_generate_v4()",
oldClrType: typeof(Guid),
oldType: "uuid",
oldDefaultValueSql: "uuid_generate_v4()");
migrationBuilder.CreateIndex(
name: "IX_Md2MobLevelInfos_MobInfoId2",
table: "Md2MobLevelInfos",
column: "MobInfoId2");
migrationBuilder.AddForeignKey(
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId",
table: "Md2MobLevelInfos",
column: "MobInfoId",
principalTable: "Md2MobInfos",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId2",
table: "Md2MobLevelInfos",
column: "MobInfoId2",
principalTable: "Md2MobInfos",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId",
table: "Md2MobLevelInfos");
migrationBuilder.DropForeignKey(
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId2",
table: "Md2MobLevelInfos");
migrationBuilder.DropIndex(
name: "IX_Md2MobLevelInfos_MobInfoId2",
table: "Md2MobLevelInfos");
migrationBuilder.AlterColumn<Guid>(
name: "MobInfoId2",
table: "Md2MobLevelInfos",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<Guid>(
name: "MobInfoId",
table: "Md2MobLevelInfos",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<Guid>(
name: "Id",
table: "Md2MobLevelInfos",
type: "uuid",
nullable: false,
defaultValueSql: "uuid_generate_v4()",
oldClrType: typeof(string),
oldType: "text",
oldDefaultValueSql: "uuid_generate_v4()");
migrationBuilder.AddColumn<Guid>(
name: "MobInfoId1",
table: "Md2MobLevelInfos",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
migrationBuilder.AlterColumn<Guid>(
name: "Id",
table: "Md2MobInfos",
type: "uuid",
nullable: false,
defaultValueSql: "uuid_generate_v4()",
oldClrType: typeof(string),
oldType: "text",
oldDefaultValueSql: "uuid_generate_v4()");
migrationBuilder.CreateIndex(
name: "IX_Md2MobLevelInfos_MobInfoId1",
table: "Md2MobLevelInfos",
column: "MobInfoId1");
migrationBuilder.AddForeignKey(
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId",
table: "Md2MobLevelInfos",
column: "MobInfoId",
principalTable: "Md2MobInfos",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Md2MobLevelInfos_Md2MobInfos_MobInfoId1",
table: "Md2MobLevelInfos",
column: "MobInfoId1",
principalTable: "Md2MobInfos",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}
@@ -1,976 +0,0 @@
// <auto-generated />
using System;
using Church.Net.DAL.EF;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Church.Net.DAL.EFCoreDBF.Migrations
{
[DbContext(typeof(ChurchNetContext))]
partial class ChurchNetContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(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.Contribution", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<string>("Comment")
.HasColumnType("text");
b.Property<string>("Contributor")
.HasColumnType("text");
b.Property<string>("GroupId")
.HasColumnType("text");
b.Property<DateTime>("Time")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("GroupId");
b.ToTable("Contributions");
});
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.Games.MD2.MobInfo", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("text")
.HasDefaultValueSql("uuid_generate_v4()");
b.Property<int>("From")
.HasColumnType("integer");
b.Property<int>("Type")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("Md2MobInfos");
});
modelBuilder.Entity("Church.Net.Entity.Games.MD2.MobLevelInfo", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("text")
.HasDefaultValueSql("uuid_generate_v4()");
b.Property<string>("MobInfoId")
.HasColumnType("text");
b.Property<string>("MobInfoId2")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("MobInfoId");
b.HasIndex("MobInfoId2");
b.ToTable("Md2MobLevelInfos");
});
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.HappinessCost", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal>("Amount")
.HasColumnType("numeric");
b.Property<string>("Content")
.HasColumnType("text");
b.Property<string>("Tasker")
.HasColumnType("text");
b.Property<string>("WeekId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("WeekId");
b.ToTable("HappinessCosts");
});
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<string>("TimeZone")
.HasColumnType("text");
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.Contribution", b =>
{
b.HasOne("Church.Net.Entity.PastoralDomain", "HappinessGroup")
.WithMany("Contributions")
.HasForeignKey("GroupId");
b.Navigation("HappinessGroup");
});
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.Games.MD2.MobLevelInfo", b =>
{
b.HasOne("Church.Net.Entity.Games.MD2.MobInfo", "MobInfo")
.WithMany()
.HasForeignKey("MobInfoId");
b.HasOne("Church.Net.Entity.Games.MD2.MobInfo", null)
.WithMany("MobLevelInfos")
.HasForeignKey("MobInfoId2")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("MobInfo");
});
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.HappinessCost", b =>
{
b.HasOne("Church.Net.Entity.HappinessWeek", "HappinessWeek")
.WithMany("Costs")
.HasForeignKey("WeekId");
b.Navigation("HappinessWeek");
});
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.Games.MD2.MobInfo", b =>
{
b.Navigation("MobLevelInfos");
});
modelBuilder.Entity("Church.Net.Entity.HappinessWeek", b =>
{
b.Navigation("Costs");
b.Navigation("Tasks");
});
modelBuilder.Entity("Church.Net.Entity.PastoralDomain", b =>
{
b.Navigation("AutoReplyItemRelations");
b.Navigation("Bests");
b.Navigation("Contributions");
b.Navigation("HappinessWeeks");
b.Navigation("Members");
});
#pragma warning restore 612, 618
}
}
}
-25
View File
@@ -1,25 +0,0 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["Church.Net.WebAPI/Church.Net.WebAPI.csproj", "Church.Net.WebAPI/"]
COPY ["Church.Net.DAL.EFCoreDBF/Church.Net.DAL.EFCoreDBF.csproj", "Church.Net.DAL.EFCoreDBF/"]
COPY ["Church.Net.Entity2/Church.Net.Entity.csproj", "Church.Net.Entity/"]
COPY ["Church.Net.Utility/Church.Net.Utility.csproj", "Church.Net.Utility/"]
RUN dotnet restore "Church.Net.WebAPI/Church.Net.WebAPI.csproj"
COPY . .
WORKDIR "/src/Church.Net.WebAPI"
RUN dotnet build "Church.Net.WebAPI.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Church.Net.WebAPI.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Church.Net.WebAPI.dll"]
-31
View File
@@ -1,31 +0,0 @@
using Church.Net.Entity.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Church.Net.Entity
{
public class AddressInfo : IEntity
{
public AddressInfo()
{
Id = "new";
}
[Key]
public string Id { get; set; }
public string Address { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Zip { get; set; }
public string GetCSZ()
{
string result = City;
string sz = $"{State} {Zip}".Trim();
return result + (string.IsNullOrWhiteSpace(sz) ? "" : $", {sz}");
}
}
}
@@ -1,46 +0,0 @@
using Church.Net.Entity.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.Entity
{
public class AutoReplyItem : IEntity
{
[Required, Key]
public string Id { get; set; }
public string Command { get; set; }
public string Description { get; set; }
public string Content { get; set; }
public virtual ICollection<PastoralDomainAutoReplys> AutoReplyItemRelations { get; set; }
}
public class PastoralDomainAutoReplys : ICombinedKeyEntity
{
public PastoralDomainAutoReplys()
{
}
public PastoralDomainAutoReplys(string pastoralDomainCId, string autoReplyItemId)
{
PastoralDomainCommunityAppId = pastoralDomainCId;
AutoReplyItemId = autoReplyItemId;
}
[ForeignKey("PastoralDomain")]
[Required, Key, Column(Order = 0)]
public string PastoralDomainCommunityAppId { get; set; }
public virtual PastoralDomain PastoralDomain { get; set; }
[ForeignKey("FamilyMember")]
[Required, Key, Column(Order = 1)]
public string AutoReplyItemId { get; set; }
public virtual AutoReplyItem FamilyMember { get; set; }
}
}
-18
View File
@@ -1,18 +0,0 @@
using Church.Net.Entity.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.Entity
{
public class BibleBook
{
public int Id { get; set; }
public string Chinese { get; set; }
public string ChineseShort { get; set; }
public string English { get; set; }
public string EnglishShort { get; set; }
}
}
-21
View File
@@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.Entity
{
public class BibleStudy
{
public DateTime Date { get; set; }
public string Topic { get; set; }
[ForeignKey("Book")]
public string Id { get; set; }
public BibleBook Book { get; set; }
public string Chapter { get; set; }
public int VerseStart { get; set; }
public int VerseEnd { get; set; }
}
}
-19
View File
@@ -1,19 +0,0 @@
using Church.Net.Entity.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.Entity
{
public class Career : IEntity
{
[Required, Key]
public string Id { get; set; }
[StringLength(50)]
public string Name { get; set; }
}
}
@@ -1,68 +0,0 @@
using Church.Net.Entity.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.Entity
{
public class CellGroupRoutineEvent : IEntity
{
[Required, Key]
public string Id { get; set; }
[Required]
public DateTime Time { get; set; }
public string Address { get; set; }
public virtual ICollection<CellGroupRoutineEventAttendee> Attendees { get; set; }
public virtual ICollection<CellGroupRoutineEventPrayer> Prayers { get; set; }
[ForeignKey("CellGroupInfo")]
public string PastoralDomainId { get; set; }
public PastoralDomain CellGroupInfo { get; set; }
}
public class CellGroupRoutineEventAttendee : ICombinedKeyEntity
{
[ForeignKey("CellGroupRoutineEvent")]
[Key, Column(Order = 0)]
public string EventId { get; set; }
public CellGroupRoutineEvent CellGroupRoutineEvent { get; set; }
[Required, Key, Column(Order = 1)]
public string Id { get; set; }
public string Name { get; set; }
public bool JoinPotluck { get; set; }
public string PotluckItem { get; set; }
public string Comment { get; set; }
}
public class CellGroupRoutineEventWorship : ICombinedKeyEntity
{
[ForeignKey("CellGroupRoutineEvent")]
[Key, Column(Order = 0)]
public string EventId { get; set; }
[Required, Key, Column(Order = 1)]
public string WorshipVideoId { get; set; }
public string Comment { get; set; }
}
public class CellGroupRoutineEventPrayer : ICombinedKeyEntity
{
[ForeignKey("CellGroupRoutineEvent")]
[Key, Column(Order = 0)]
public string EventId { get; set; }
public CellGroupRoutineEvent CellGroupRoutineEvent { get; set; }
[Required, Key, Column(Order = 1)]
public string MemberId { get; set; }
public string Prayer { get; set; }
public string Comment { get; set; }
}
}
@@ -1,23 +0,0 @@
using Church.Net.Entity.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.ComponentModel;
namespace Church.Net.Entity
{
public class Contribution : IEntity
{
[ForeignKey("HappinessGroup")]
public string GroupId { get; set; }
public PastoralDomain HappinessGroup { get; set; }
[Key]
public string Id { get; set; }
public string Contributor { get; set; }
public decimal Amount { get; set; }
public string Comment { get; set; }
public DateTime Time { get; set; }
}
}
-55
View File
@@ -1,55 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.Entity
{
public class Enumeration
{
public enum Gender
{
Female=0,
Male=1
}
public enum Month
{
January=1,
Feburary,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
}
public enum PartsOfSpeech
{
Nouns,
Verbs,
VerbsUnRegular,
Pronouns,
Adverbs,
Adjectives,
Conjunctions,
Articles,
Prepositions
}
public enum PracticeStage
{
Select,
Memorized,
Visualize,
Apply,
Review,
FlashCard
}
}
}
@@ -1,71 +0,0 @@
using Church.Net.Entity.Interface;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.Entity
{
[Flags]
public enum Role
{
None = 0,
FamilyMember = 1 << 0, // 0001 -- the bitshift is unnecessary, but done for consistency
CellGroupLeader = 1 << 1, // 0010
Pastor = 1 << 2, // 0100
Admin = 1 << 3, // 1111
Best = 1 << 4, // 1111
All = ~(~0 << 20) // 1111
}
public class FamilyMember : IEntity
{
public FamilyMember()
{
}
[Key]
public string Id { get; set; }
public string Email { get; set; }
[JsonIgnore]
public string Password { get; set; }
public string AvatarImage { get; set; }
[StringLength(50)]
public string FirstName { get; set; }
[StringLength(50)]
public string LastName { get; set; }
public Enumeration.Gender Gender { get; set; }
public DateTime? Birthday { get; set; }
public bool Married { get; set; }
public bool Baptized { get; set; }
public DateTime? DateOfBaptized { get; set; }
public DateTime? DateOfWalkIn { get; set; }
[StringLength(500)]
public string Address { get; set; }
[StringLength(50)]
public string ComunityAppId { get; set; }
[ForeignKey("Career")]
public string CareerId { get; set; }
public Career Career { get; set; }
public virtual ICollection<PastoralDomainMembers> PastoralDomains { get; set; }
public virtual ICollection<FamilyMemberOAuth> OAuthInfos { get; set; }
public string Comment { get; set; }
public Role Role { get; set; }
}
}
@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
namespace Church.Net.Entity
{
public class FamilyMemberOAuth
{
[ForeignKey("HappinessGroup")]
[Key, Column(Order = 0)]
public string FamilyMemberId { get; set; }
[Required, Key, Column(Order = 1)]
public string OAuthType { get; set; }
public string OAuthAccessToken { get; set; }
}
}
@@ -1,155 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Newtonsoft.Json;
using Church.Net.Entity.Interface;
namespace Church.Net.Entity.Games.MD2
{
public enum MobType
{
Mob,
RoamingMonster,
Boss
}
public enum GameBundle
{
CoreGame,
HeavenFallen,
Zombiecide,
}
public enum MobSkillType
{
Attack,
Defense,
Combat,
Passive
}
public enum MobSkillTarget
{
Random = 40,
LeastHp = 50,
LeastMp = 60,
HighestHp = 70,
HighestMp = 80,
LowestLevel = 90,
MostCorruption = 200,
LeastCorruption = 201
}
public enum MD2Icon
{
Attack,
Defense,
Mana,
Shadow,
EnemySkill,
EnemyClaw,
Reroll,
Fire,
Frost,
OneHand,
TwoHand,
Helmet,
Armor,
Ring,
Foot,
Melee,
Range,
Magic,
HP,
MP,
Dice,
Arrow,
ArrowBullseye,
ArrowOverload,
SoulToken,
Rage,
RedDice,
BlueDice,
YellowDice,
OrangeDice,
BlackDice
}
public class MobInfo : IEntity
{
[Key]
public string Id { get; set; }
public MobType Type { get; set; }
public GameBundle From { get; set; }
public string Name { get; set; }
public string LeaderImgUrl { get; set; }
public string MinionImgUrl { get; set; }
public virtual ICollection<MobLevelInfo> MobLevelInfos { get; set; }
public virtual ICollection<MobSkill> Skills { get; set; }
}
public class MobLevelInfo : IEntity
{
[Key]
public string Id { get; set; }
[ForeignKey("MobInfo")]
public string MobInfoId { get; set; }
[JsonIgnore]
public virtual MobInfo MobInfo { get; set; }
public int RewardTokens { get; set; }
public int FixedRareTreasure { get; set; }
public int FixedEpicTreasure { get; set; }
public int FixedLegendTreasure { get; set; }
public int FixedHp { get; set; }
public int HpPerHero { get; set; }
public int Actions { get; set; }
[ForeignKey("AttackInfo")]
public string AttackInfoId { get; set; }
public MD2DiceSet AttackInfo { get; set; }
[ForeignKey("DefenceInfo")]
public string DefenceInfoId { get; set; }
public MD2DiceSet DefenceInfo { get; set; }
public virtual ICollection<MobSkill> Skills { get; set; }
}
public class MobSkill : IEntity
{
[Key]
public string Id { get; set; }
[ForeignKey("MobLevelInfo")]
public string MobLevelInfoId { get; set; }
[ForeignKey("MobInfo")]
public string MobInfoId { get; set; }
[JsonIgnore]
public virtual MobInfo MobInfo { get; set; }
[JsonIgnore]
public virtual MobLevelInfo MobLevelInfo { get; set; }
public MobSkillType Type { get; set; }
public MobSkillTarget? SkillTarget { get; set; }
public int ClawRoll { get; set; }
public int SkillRoll { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
public class MD2DiceSet : IEntity
{
[Key]
public string Id { get; set; }
public int? Yellow { get; set; }
public int? Orange { get; set; }
public int? Red { get; set; }
public int? Blue { get; set; }
public int? Green { get; set; }
public int? Black { get; set; }
}
}
@@ -1,26 +0,0 @@
using Church.Net.Entity.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.Entity
{
public class HappinessBEST : IEntity
{
[ForeignKey("HappinessGroup")]
public string GroupId { get; set; }
public PastoralDomain HappinessGroup { get; set; }
[Key]
public string Id { get; set; }
[Required]
public string Name { get; set; }
public string Email { get; set; }
public string Phone { get; set; }
}
}
@@ -1,76 +0,0 @@
using Church.Net.Entity.Interface;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Church.Net.Entity
{
public class HappinessWeek : IEntity
{
[ForeignKey("HappinessGroup")]
public string GroupId { get; set; }
public PastoralDomain HappinessGroup { get; set; }
[Required, Key]
public string Id { get; set; }
public DateTime Date { get; set;}
public string InvitationText { get; set; }
public string Address { get; set; }
public string CityAndZipCode { get; set; }
public int SEQ { get; set; }
[NotMapped]
public bool UpdateRestWeekDate { get; set; }
[NotMapped]
public string Topic { get; set; }
public virtual ICollection<HappinessTask> Tasks { get; set; }
public virtual ICollection<HappinessCost> Costs { get; set; }
public string Comment { get; set; }
}
public enum HappinessTaskType
{
[Description("帶遊戲")]
IceBreak,
[Description("唱歌")]
Worship,
[Description("見證")]
Testimony,
[Description("信息")]
Message,
[Description("準備禮物")]
Gift,
[Description("準備點心")]
Dessert
}
public class HappinessTask : IEntity
{
[ForeignKey("HappinessWeek")]
public string WeekId { get; set; }
public HappinessWeek HappinessWeek { get; set; }
[Required, Key]
public string Id { get; set; }
public HappinessTaskType Type { get; set; }
public string Tasker { get; set; }
public string Content { get; set; }
}
public class HappinessCost : IEntity
{
[ForeignKey("HappinessWeek")]
public string WeekId { get; set; }
public HappinessWeek HappinessWeek { get; set; }
[Key]
public string Id { get; set; }
public string Tasker { get; set; }
public string Content { get; set; }
public decimal Amount { get; set; }
}
}

Some files were not shown because too many files have changed in this diff Show More