diff --git a/Documentation/Pf2eDataScrapper/AbstractEntityProcessor.md b/Documentation/Pf2eDataScrapper/AbstractEntityProcessor.md index eecf028..2e23884 100644 --- a/Documentation/Pf2eDataScrapper/AbstractEntityProcessor.md +++ b/Documentation/Pf2eDataScrapper/AbstractEntityProcessor.md @@ -20,6 +20,8 @@ Derived ↳ [ArchetypeProcessor](ArchetypeProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.ArchetypeProcessor') ↳ [BackgroundProcessor](BackgroundProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.BackgroundProcessor') ↳ [ClassProcessor](ClassProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.ClassProcessor') +↳ [DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') +↳ [DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') ↳ [FeatProcessor](FeatProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.FeatProcessor') ↳ [HeritageProcessor](HeritageProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.HeritageProcessor') ↳ [LanguageProcessor](LanguageProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.LanguageProcessor') diff --git a/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.Ignore.md b/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.Ignore.md new file mode 100644 index 0000000..15714cc --- /dev/null +++ b/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.Ignore.md @@ -0,0 +1,13 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers](Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers').[AonprdBuilderGlobals](AonprdBuilderGlobals.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers\.AonprdBuilderGlobals') + +## AonprdBuilderGlobals\.Ignore Property + +Список идентификаторов сущностей, которые нужно игнорировать при обработке\. + +```csharp +public System.Collections.Generic.List Ignore { get; } +``` + +#### Property Value +[System\.Collections\.Generic\.List<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.List-1 'System\.Collections\.Generic\.List\`1')[System\.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System\.String')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.List-1 'System\.Collections\.Generic\.List\`1') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.md b/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.md index 0ee21b8..472a542 100644 --- a/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.md +++ b/Documentation/Pf2eDataScrapper/AonprdBuilderGlobals.md @@ -18,6 +18,7 @@ Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System. | Properties | | | :--- | :--- | | [AonprdTarget](AonprdBuilderGlobals.AonprdTarget.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers\.AonprdBuilderGlobals\.AonprdTarget') | Цель внешних ссылок Архивов Нефисов\. | +| [Ignore](AonprdBuilderGlobals.Ignore.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers\.AonprdBuilderGlobals\.Ignore') | Список идентификаторов сущностей, которые нужно игнорировать при обработке\. | | [LegacyRemasterExtra](AonprdBuilderGlobals.LegacyRemasterExtra.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers\.AonprdBuilderGlobals\.LegacyRemasterExtra') | Словарь допольнительных проверок связей\. Ключ \- устаревшая сущность, значение \- обновлённая\. | | [MergeSources](AonprdBuilderGlobals.MergeSources.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers\.AonprdBuilderGlobals\.MergeSources') | Словарь сущностей, которые нужно слить с другой/другими\. Ключ \- пропускаемая сущность\. Значение \- целевая сущность\. | | [SlugSuffixes](AonprdBuilderGlobals.SlugSuffixes.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Helpers\.AonprdBuilderGlobals\.SlugSuffixes') | Словарей суффиксов для сущностей | diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.Add().md b/Documentation/Pf2eDataScrapper/DeityProcessor.Add().md new file mode 100644 index 0000000..53e3815 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.Add().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.Add\(\) Method + +Добавление основной сущности в контекст базы данных\. + +```csharp +protected override void Add(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.AddTraits().md b/Documentation/Pf2eDataScrapper/DeityProcessor.AddTraits().md new file mode 100644 index 0000000..ca181a3 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.AddTraits().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.AddTraits\(\) Method + +Генерация списка признаков сущности\. + +```csharp +protected override void AddTraits(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.MarkdownLinkRegex().md b/Documentation/Pf2eDataScrapper/DeityProcessor.MarkdownLinkRegex().md new file mode 100644 index 0000000..6117686 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.MarkdownLinkRegex().md @@ -0,0 +1,28 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.MarkdownLinkRegex\(\) Method + +```csharp +private static System.Text.RegularExpressions.Regex MarkdownLinkRegex(); +``` + +#### Returns +[System\.Text\.RegularExpressions\.Regex](https://docs.microsoft.com/en-us/dotnet/api/System.Text.RegularExpressions.Regex 'System\.Text\.RegularExpressions\.Regex') + +### Remarks +Pattern:
+ +```csharp +\\[([^\\]]+)\\]\\([^)]+\\) +```
+Explanation:
+ +```csharp +○ Match '['.
+○ 1st capture group.
+ ○ Match a character other than ']' atomically at least once.
+○ Match the string "](".
+○ Match a character other than ')' atomically at least once.
+○ Match ')'.
+``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.Object.md b/Documentation/Pf2eDataScrapper/DeityProcessor.Object.md new file mode 100644 index 0000000..fe58ea6 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.Object.md @@ -0,0 +1,13 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.Object Property + +Основная сущность\. + +```csharp +public virtual Pf2eModel.Model.Structure.Deity Object { get; } +``` + +#### Property Value +[Pf2eModel\.Model\.Structure\.Deity](https://docs.microsoft.com/en-us/dotnet/api/Pf2eModel.Model.Structure.Deity 'Pf2eModel\.Model\.Structure\.Deity') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.Process().md b/Documentation/Pf2eDataScrapper/DeityProcessor.Process().md new file mode 100644 index 0000000..122f4c4 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.Process().md @@ -0,0 +1,12 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.Process\(\) Method + +Основной метод обработки данных\. + +```csharp +public override void Process(); +``` + +Implements [Process\(\)](IProcessor.Process().md 'Pf2eDataScrapper\.Processors\.Definitions\.IProcessor\.Process\(\)') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessAttributes().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessAttributes().md new file mode 100644 index 0000000..7f26201 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessAttributes().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessAttributes\(\) Method + +Обработка атрибутов божества\. + +```csharp +private void ProcessAttributes(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomainMarkdown(string,bool).md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomainMarkdown(string,bool).md new file mode 100644 index 0000000..3387c04 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomainMarkdown(string,bool).md @@ -0,0 +1,23 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessDomainMarkdown\(string, bool\) Method + +Обработка markdown\-строки с доменами\. + +```csharp +private void ProcessDomainMarkdown(string markdown, bool isPrimary); +``` +#### Parameters + + + +`markdown` [System\.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System\.String') + +Markdown\-строка с доменами\. + + + +`isPrimary` [System\.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System\.Boolean') + +Флаг, указывающий, являются ли домены основными\. \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomains().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomains().md new file mode 100644 index 0000000..fe0752f --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessDomains().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessDomains\(\) Method + +Обработка доменов божества\. + +```csharp +private void ProcessDomains(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessFonts().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessFonts().md new file mode 100644 index 0000000..00b7312 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessFonts().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessFonts\(\) Method + +Обработка божественной силы\. + +```csharp +private void ProcessFonts(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSkills().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSkills().md new file mode 100644 index 0000000..66e0991 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSkills().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessSkills\(\) Method + +Обработка навыков божества\. + +```csharp +private void ProcessSkills(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSpells().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSpells().md new file mode 100644 index 0000000..96509de --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessSpells().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessSpells\(\) Method + +Обработка заклинаний божества\. + +```csharp +private void ProcessSpells(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessTexts().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessTexts().md new file mode 100644 index 0000000..febd01f --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessTexts().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessTexts\(\) Method + +Обработка текстов описания божества\. + +```csharp +private void ProcessTexts(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessWeapons().md b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessWeapons().md new file mode 100644 index 0000000..37aadd1 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.ProcessWeapons().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.ProcessWeapons\(\) Method + +Обработка оружия божества\. + +```csharp +private void ProcessWeapons(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.Type.md b/Documentation/Pf2eDataScrapper/DeityProcessor.Type.md new file mode 100644 index 0000000..666cb6b --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.Type.md @@ -0,0 +1,13 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') + +## DeityProcessor\.Type Property + +Тип сущности\. + +```csharp +public override Pf2eModel.Model.Enum.EntityType Type { get; } +``` + +#### Property Value +[Pf2eModel\.Model\.Enum\.EntityType](https://docs.microsoft.com/en-us/dotnet/api/Pf2eModel.Model.Enum.EntityType 'Pf2eModel\.Model\.Enum\.EntityType') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DeityProcessor.md b/Documentation/Pf2eDataScrapper/DeityProcessor.md new file mode 100644 index 0000000..5f18a63 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DeityProcessor.md @@ -0,0 +1,30 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types') + +## DeityProcessor Class + +```csharp +internal class DeityProcessor : Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.AbstractEntityProcessor +``` + +Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System\.Object') 🡒 [AbstractInputProcessor](AbstractInputProcessor.md 'Pf2eDataScrapper\.Processors\.Definitions\.AbstractInputProcessor') 🡒 [AbstractEntityProcessor](AbstractEntityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.AbstractEntityProcessor') 🡒 DeityProcessor + +| Properties | | +| :--- | :--- | +| [Object](DeityProcessor.Object.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.Object') | Основная сущность\. | +| [Type](DeityProcessor.Type.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.Type') | Тип сущности\. | + +| Methods | | +| :--- | :--- | +| [Add\(\)](DeityProcessor.Add().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.Add\(\)') | Добавление основной сущности в контекст базы данных\. | +| [AddTraits\(\)](DeityProcessor.AddTraits().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.AddTraits\(\)') | Генерация списка признаков сущности\. | +| [MarkdownLinkRegex\(\)](DeityProcessor.MarkdownLinkRegex().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.MarkdownLinkRegex\(\)') | | +| [Process\(\)](DeityProcessor.Process().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.Process\(\)') | Основной метод обработки данных\. | +| [ProcessAttributes\(\)](DeityProcessor.ProcessAttributes().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessAttributes\(\)') | Обработка атрибутов божества\. | +| [ProcessDomainMarkdown\(string, bool\)](DeityProcessor.ProcessDomainMarkdown(string,bool).md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessDomainMarkdown\(string, bool\)') | Обработка markdown\-строки с доменами\. | +| [ProcessDomains\(\)](DeityProcessor.ProcessDomains().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessDomains\(\)') | Обработка доменов божества\. | +| [ProcessFonts\(\)](DeityProcessor.ProcessFonts().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessFonts\(\)') | Обработка божественной силы\. | +| [ProcessSkills\(\)](DeityProcessor.ProcessSkills().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessSkills\(\)') | Обработка навыков божества\. | +| [ProcessSpells\(\)](DeityProcessor.ProcessSpells().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessSpells\(\)') | Обработка заклинаний божества\. | +| [ProcessTexts\(\)](DeityProcessor.ProcessTexts().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessTexts\(\)') | Обработка текстов описания божества\. | +| [ProcessWeapons\(\)](DeityProcessor.ProcessWeapons().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessWeapons\(\)') | Обработка оружия божества\. | diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.Add().md b/Documentation/Pf2eDataScrapper/DomainProcessor.Add().md new file mode 100644 index 0000000..d8faf07 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.Add().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.Add\(\) Method + +Добавление основной сущности в контекст базы данных\. + +```csharp +protected override void Add(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.GetSpellIdFromMarkdown(string).md b/Documentation/Pf2eDataScrapper/DomainProcessor.GetSpellIdFromMarkdown(string).md new file mode 100644 index 0000000..998ccf7 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.GetSpellIdFromMarkdown(string).md @@ -0,0 +1,21 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.GetSpellIdFromMarkdown\(string\) Method + +Получение идентификатора заклинания из markdown\-строки\. + +```csharp +private int GetSpellIdFromMarkdown(string markdown); +``` +#### Parameters + + + +`markdown` [System\.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System\.String') + +Markdown\-строка с информацией о заклинании\. + +#### Returns +[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32') +Идентификатор заклинания\. \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.MarkdownLinkRegex().md b/Documentation/Pf2eDataScrapper/DomainProcessor.MarkdownLinkRegex().md new file mode 100644 index 0000000..7247162 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.MarkdownLinkRegex().md @@ -0,0 +1,28 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.MarkdownLinkRegex\(\) Method + +```csharp +private static System.Text.RegularExpressions.Regex MarkdownLinkRegex(); +``` + +#### Returns +[System\.Text\.RegularExpressions\.Regex](https://docs.microsoft.com/en-us/dotnet/api/System.Text.RegularExpressions.Regex 'System\.Text\.RegularExpressions\.Regex') + +### Remarks +Pattern:
+ +```csharp +\\[([^\\]]+)\\]\\([^)]+\\) +```
+Explanation:
+ +```csharp +○ Match '['.
+○ 1st capture group.
+ ○ Match a character other than ']' atomically at least once.
+○ Match the string "](".
+○ Match a character other than ')' atomically at least once.
+○ Match ')'.
+``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.Object.md b/Documentation/Pf2eDataScrapper/DomainProcessor.Object.md new file mode 100644 index 0000000..3a40e65 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.Object.md @@ -0,0 +1,13 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.Object Property + +Основная сущность\. + +```csharp +public virtual Pf2eModel.Model.Structure.Domain Object { get; } +``` + +#### Property Value +[Pf2eModel\.Model\.Structure\.Domain](https://docs.microsoft.com/en-us/dotnet/api/Pf2eModel.Model.Structure.Domain 'Pf2eModel\.Model\.Structure\.Domain') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.Process().md b/Documentation/Pf2eDataScrapper/DomainProcessor.Process().md new file mode 100644 index 0000000..ac5d519 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.Process().md @@ -0,0 +1,12 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.Process\(\) Method + +Основной метод обработки данных\. + +```csharp +public override void Process(); +``` + +Implements [Process\(\)](IProcessor.Process().md 'Pf2eDataScrapper\.Processors\.Definitions\.IProcessor\.Process\(\)') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.ProcessDomainSpells().md b/Documentation/Pf2eDataScrapper/DomainProcessor.ProcessDomainSpells().md new file mode 100644 index 0000000..70f82ae --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.ProcessDomainSpells().md @@ -0,0 +1,10 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.ProcessDomainSpells\(\) Method + +Обработка заклинаний, связанных с доменом\. + +```csharp +private void ProcessDomainSpells(); +``` \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.Type.md b/Documentation/Pf2eDataScrapper/DomainProcessor.Type.md new file mode 100644 index 0000000..efed438 --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.Type.md @@ -0,0 +1,13 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') + +## DomainProcessor\.Type Property + +Тип сущности\. + +```csharp +public override Pf2eModel.Model.Enum.EntityType Type { get; } +``` + +#### Property Value +[Pf2eModel\.Model\.Enum\.EntityType](https://docs.microsoft.com/en-us/dotnet/api/Pf2eModel.Model.Enum.EntityType 'Pf2eModel\.Model\.Enum\.EntityType') \ No newline at end of file diff --git a/Documentation/Pf2eDataScrapper/DomainProcessor.md b/Documentation/Pf2eDataScrapper/DomainProcessor.md new file mode 100644 index 0000000..0d616dd --- /dev/null +++ b/Documentation/Pf2eDataScrapper/DomainProcessor.md @@ -0,0 +1,23 @@ +#### [Pf2eDataScrapper](index.md 'index') +### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types') + +## DomainProcessor Class + +```csharp +internal class DomainProcessor : Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.AbstractEntityProcessor +``` + +Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System\.Object') 🡒 [AbstractInputProcessor](AbstractInputProcessor.md 'Pf2eDataScrapper\.Processors\.Definitions\.AbstractInputProcessor') 🡒 [AbstractEntityProcessor](AbstractEntityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.AbstractEntityProcessor') 🡒 DomainProcessor + +| Properties | | +| :--- | :--- | +| [Object](DomainProcessor.Object.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.Object') | Основная сущность\. | +| [Type](DomainProcessor.Type.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.Type') | Тип сущности\. | + +| Methods | | +| :--- | :--- | +| [Add\(\)](DomainProcessor.Add().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.Add\(\)') | Добавление основной сущности в контекст базы данных\. | +| [GetSpellIdFromMarkdown\(string\)](DomainProcessor.GetSpellIdFromMarkdown(string).md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.GetSpellIdFromMarkdown\(string\)') | Получение идентификатора заклинания из markdown\-строки\. | +| [MarkdownLinkRegex\(\)](DomainProcessor.MarkdownLinkRegex().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.MarkdownLinkRegex\(\)') | | +| [Process\(\)](DomainProcessor.Process().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.Process\(\)') | Основной метод обработки данных\. | +| [ProcessDomainSpells\(\)](DomainProcessor.ProcessDomainSpells().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor\.ProcessDomainSpells\(\)') | Обработка заклинаний, связанных с доменом\. | diff --git a/Documentation/Pf2eDataScrapper/Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md b/Documentation/Pf2eDataScrapper/Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md index 03f2a85..8c51b04 100644 --- a/Documentation/Pf2eDataScrapper/Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md +++ b/Documentation/Pf2eDataScrapper/Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md @@ -11,6 +11,8 @@ | [ArchetypeProcessor](ArchetypeProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.ArchetypeProcessor') | | | [BackgroundProcessor](BackgroundProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.BackgroundProcessor') | | | [ClassProcessor](ClassProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.ClassProcessor') | | +| [DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') | | +| [DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') | | | [FeatProcessor](FeatProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.FeatProcessor') | | | [HeritageProcessor](HeritageProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.HeritageProcessor') | | | [LanguageProcessor](LanguageProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.LanguageProcessor') | | diff --git a/Documentation/Pf2eModel/Class.Spellcasting.md b/Documentation/Pf2eModel/Class.Spellcasting.md index 50af749..d960653 100644 --- a/Documentation/Pf2eModel/Class.Spellcasting.md +++ b/Documentation/Pf2eModel/Class.Spellcasting.md @@ -3,11 +3,11 @@ ## Class\.Spellcasting Property -Флаг, указывающий на то, что класс является заклинательным\. +Указание на тип заклинательства\. ```csharp -public bool Spellcasting { get; set; } +public Pf2eModel.Model.Enum.SpellcastingType Spellcasting { get; set; } ``` #### Property Value -[System\.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System\.Boolean') \ No newline at end of file +[SpellcastingType](SpellcastingType.md 'Pf2eModel\.Model\.Enum\.SpellcastingType') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Class.md b/Documentation/Pf2eModel/Class.md index e3c7114..14ca194 100644 --- a/Documentation/Pf2eModel/Class.md +++ b/Documentation/Pf2eModel/Class.md @@ -22,6 +22,6 @@ Implements [IEntity](IEntity.md 'Pf2eModel\.Model\.IEntity') | [Entity](Class.Entity.md 'Pf2eModel\.Model\.Structure\.Class\.Entity') | Корневая сущность\. | | [Hp](Class.Hp.md 'Pf2eModel\.Model\.Structure\.Class\.Hp') | Количество очков здоровья\. | | [Id](Class.Id.md 'Pf2eModel\.Model\.Structure\.Class\.Id') | Идентификатор сущности\. | -| [Spellcasting](Class.Spellcasting.md 'Pf2eModel\.Model\.Structure\.Class\.Spellcasting') | Флаг, указывающий на то, что класс является заклинательным\. | +| [Spellcasting](Class.Spellcasting.md 'Pf2eModel\.Model\.Structure\.Class\.Spellcasting') | Указание на тип заклинательства\. | | [SubclassGroups](Class.SubclassGroups.md 'Pf2eModel\.Model\.Structure\.Class\.SubclassGroups') | Группы подклассов\. | | [Tradition](Class.Tradition.md 'Pf2eModel\.Model\.Structure\.Class\.Tradition') | Традиция заклинаний класса\. | diff --git a/Documentation/Pf2eModel/Deity.Anathema.md b/Documentation/Pf2eModel/Deity.Anathema.md new file mode 100644 index 0000000..16dbde2 --- /dev/null +++ b/Documentation/Pf2eModel/Deity.Anathema.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') + +## Deity\.Anathema Property + +Анафемы божества\. + +```csharp +public Pf2eModel.Model.Common.I18n.LocaleString Anathema { get; set; } +``` + +#### Property Value +[LocaleString](LocaleString.md 'Pf2eModel\.Model\.Common\.I18n\.LocaleString') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.AreaOfConcern.md b/Documentation/Pf2eModel/Deity.AreaOfConcern.md new file mode 100644 index 0000000..c9780cb --- /dev/null +++ b/Documentation/Pf2eModel/Deity.AreaOfConcern.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') + +## Deity\.AreaOfConcern Property + +Область покровительства божества\. + +```csharp +public Pf2eModel.Model.Common.I18n.LocaleString AreaOfConcern { get; set; } +``` + +#### Property Value +[LocaleString](LocaleString.md 'Pf2eModel\.Model\.Common\.I18n\.LocaleString') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.Category.md b/Documentation/Pf2eModel/Deity.Category.md index f8a5e1b..f98d269 100644 --- a/Documentation/Pf2eModel/Deity.Category.md +++ b/Documentation/Pf2eModel/Deity.Category.md @@ -3,11 +3,11 @@ ## Deity\.Category Property -Тип божества\. +Категория божества\. ```csharp -public Pf2eModel.Model.Enum.DeityCategory Category { get; set; } +public string Category { get; set; } ``` #### Property Value -[DeityCategory](DeityCategory.md 'Pf2eModel\.Model\.Enum\.DeityCategory') \ No newline at end of file +[System\.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System\.String') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.DeityAttributes.md b/Documentation/Pf2eModel/Deity.DeityAttributes.md index 0a3a3c8..bf4f453 100644 --- a/Documentation/Pf2eModel/Deity.DeityAttributes.md +++ b/Documentation/Pf2eModel/Deity.DeityAttributes.md @@ -3,7 +3,7 @@ ## Deity\.DeityAttributes Property -Аттрибуты божества\. +Атрибуты божества\. ```csharp public System.Collections.Generic.ICollection DeityAttributes { get; set; } diff --git a/Documentation/Pf2eModel/Deity.Edicts.md b/Documentation/Pf2eModel/Deity.Edicts.md new file mode 100644 index 0000000..01c3894 --- /dev/null +++ b/Documentation/Pf2eModel/Deity.Edicts.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') + +## Deity\.Edicts Property + +Заветы божества\. + +```csharp +public Pf2eModel.Model.Common.I18n.LocaleString Edicts { get; set; } +``` + +#### Property Value +[LocaleString](LocaleString.md 'Pf2eModel\.Model\.Common\.I18n\.LocaleString') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.ReligiousSymbol.md b/Documentation/Pf2eModel/Deity.ReligiousSymbol.md new file mode 100644 index 0000000..657a57c --- /dev/null +++ b/Documentation/Pf2eModel/Deity.ReligiousSymbol.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') + +## Deity\.ReligiousSymbol Property + +Религиозный символ божества\. + +```csharp +public Pf2eModel.Model.Common.I18n.LocaleString ReligiousSymbol { get; set; } +``` + +#### Property Value +[LocaleString](LocaleString.md 'Pf2eModel\.Model\.Common\.I18n\.LocaleString') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.SacredAnimal.md b/Documentation/Pf2eModel/Deity.SacredAnimal.md new file mode 100644 index 0000000..74ca8b7 --- /dev/null +++ b/Documentation/Pf2eModel/Deity.SacredAnimal.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') + +## Deity\.SacredAnimal Property + +Священное животное божества\. + +```csharp +public Pf2eModel.Model.Common.I18n.LocaleString SacredAnimal { get; set; } +``` + +#### Property Value +[LocaleString](LocaleString.md 'Pf2eModel\.Model\.Common\.I18n\.LocaleString') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.Type.md b/Documentation/Pf2eModel/Deity.Type.md new file mode 100644 index 0000000..58b161f --- /dev/null +++ b/Documentation/Pf2eModel/Deity.Type.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') + +## Deity\.Type Property + +Тип божества\. + +```csharp +public Pf2eModel.Model.Enum.DeityType Type { get; set; } +``` + +#### Property Value +[DeityType](DeityType.md 'Pf2eModel\.Model\.Enum\.DeityType') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Deity.md b/Documentation/Pf2eModel/Deity.md index 8d755f2..8a76fd6 100644 --- a/Documentation/Pf2eModel/Deity.md +++ b/Documentation/Pf2eModel/Deity.md @@ -15,14 +15,20 @@ Implements [IEntity](IEntity.md 'Pf2eModel\.Model\.IEntity') | Properties | | | :--- | :--- | -| [Category](Deity.Category.md 'Pf2eModel\.Model\.Structure\.Deity\.Category') | Тип божества\. | -| [DeityAttributes](Deity.DeityAttributes.md 'Pf2eModel\.Model\.Structure\.Deity\.DeityAttributes') | Аттрибуты божества\. | +| [Anathema](Deity.Anathema.md 'Pf2eModel\.Model\.Structure\.Deity\.Anathema') | Анафемы божества\. | +| [AreaOfConcern](Deity.AreaOfConcern.md 'Pf2eModel\.Model\.Structure\.Deity\.AreaOfConcern') | Область покровительства божества\. | +| [Category](Deity.Category.md 'Pf2eModel\.Model\.Structure\.Deity\.Category') | Категория божества\. | +| [DeityAttributes](Deity.DeityAttributes.md 'Pf2eModel\.Model\.Structure\.Deity\.DeityAttributes') | Атрибуты божества\. | | [DeityDomains](Deity.DeityDomains.md 'Pf2eModel\.Model\.Structure\.Deity\.DeityDomains') | Домены божества\. | | [DeitySpells](Deity.DeitySpells.md 'Pf2eModel\.Model\.Structure\.Deity\.DeitySpells') | Заклинания божества\. | | [DeityWeapons](Deity.DeityWeapons.md 'Pf2eModel\.Model\.Structure\.Deity\.DeityWeapons') | Оружия божества\. | +| [Edicts](Deity.Edicts.md 'Pf2eModel\.Model\.Structure\.Deity\.Edicts') | Заветы божества\. | | [Entity](Deity.Entity.md 'Pf2eModel\.Model\.Structure\.Deity\.Entity') | Корневая сущность\. | | [Fonts](Deity.Fonts.md 'Pf2eModel\.Model\.Structure\.Deity\.Fonts') | Тип божественный силы\. | | [Id](Deity.Id.md 'Pf2eModel\.Model\.Structure\.Deity\.Id') | Идентификатор сущности\. | +| [ReligiousSymbol](Deity.ReligiousSymbol.md 'Pf2eModel\.Model\.Structure\.Deity\.ReligiousSymbol') | Религиозный символ божества\. | +| [SacredAnimal](Deity.SacredAnimal.md 'Pf2eModel\.Model\.Structure\.Deity\.SacredAnimal') | Священное животное божества\. | | [Sanctification](Deity.Sanctification.md 'Pf2eModel\.Model\.Structure\.Deity\.Sanctification') | Тип освящения\. | | [SanctificationMust](Deity.SanctificationMust.md 'Pf2eModel\.Model\.Structure\.Deity\.SanctificationMust') | Обязательное освящение\. | | [Skills](Deity.Skills.md 'Pf2eModel\.Model\.Structure\.Deity\.Skills') | Навыки божества\. | +| [Type](Deity.Type.md 'Pf2eModel\.Model\.Structure\.Deity\.Type') | Тип божества\. | diff --git a/Documentation/Pf2eModel/DeityAttribute.Id.md b/Documentation/Pf2eModel/DeityAttribute.Id.md new file mode 100644 index 0000000..dc7a330 --- /dev/null +++ b/Documentation/Pf2eModel/DeityAttribute.Id.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure\.DeityRelation](Pf2eModel.Model.Structure.DeityRelation.md 'Pf2eModel\.Model\.Structure\.DeityRelation').[DeityAttribute](DeityAttribute.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityAttribute') + +## DeityAttribute\.Id Property + +Идентификатор\. + +```csharp +public int Id { get; set; } +``` + +#### Property Value +[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32') \ No newline at end of file diff --git a/Documentation/Pf2eModel/DeityAttribute.md b/Documentation/Pf2eModel/DeityAttribute.md index 6a95a78..1b60532 100644 --- a/Documentation/Pf2eModel/DeityAttribute.md +++ b/Documentation/Pf2eModel/DeityAttribute.md @@ -16,3 +16,4 @@ Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System. | [Attribute](DeityAttribute.Attribute.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityAttribute\.Attribute') | Атрибут божества\. | | [Deity](DeityAttribute.Deity.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityAttribute\.Deity') | Божество, к которому относится атрибут\. | | [DeityId](DeityAttribute.DeityId.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityAttribute\.DeityId') | Идентификатор божества\. | +| [Id](DeityAttribute.Id.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityAttribute\.Id') | Идентификатор\. | diff --git a/Documentation/Pf2eModel/DeityCategory.md b/Documentation/Pf2eModel/DeityCategory.md deleted file mode 100644 index d2921b6..0000000 --- a/Documentation/Pf2eModel/DeityCategory.md +++ /dev/null @@ -1,35 +0,0 @@ -#### [Pf2eModel](index.md 'index') -### [Pf2eModel\.Model\.Enum](Pf2eModel.Model.Enum.md 'Pf2eModel\.Model\.Enum') - -## DeityCategory Enum - -Тип божества\. - -```csharp -public enum DeityCategory -``` -### Fields - - - -`Deity` 0 - -Божество\. - - - -`Pantheon` 1 - -Пантеон\. - - - -`Covenant` 2 - -Ковенант\. - - - -`Philosophy` 3 - -Философия\. \ No newline at end of file diff --git a/Documentation/Pf2eModel/DeityDomain.Domain.md b/Documentation/Pf2eModel/DeityDomain.Domain.md new file mode 100644 index 0000000..048533b --- /dev/null +++ b/Documentation/Pf2eModel/DeityDomain.Domain.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure\.DeityRelation](Pf2eModel.Model.Structure.DeityRelation.md 'Pf2eModel\.Model\.Structure\.DeityRelation').[DeityDomain](DeityDomain.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain') + +## DeityDomain\.Domain Property + +Домен, связанный с божеством\. + +```csharp +public virtual Pf2eModel.Model.Structure.Domain Domain { get; set; } +``` + +#### Property Value +[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') \ No newline at end of file diff --git a/Documentation/Pf2eModel/DeityDomain.DomainId.md b/Documentation/Pf2eModel/DeityDomain.DomainId.md new file mode 100644 index 0000000..3e90ac3 --- /dev/null +++ b/Documentation/Pf2eModel/DeityDomain.DomainId.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure\.DeityRelation](Pf2eModel.Model.Structure.DeityRelation.md 'Pf2eModel\.Model\.Structure\.DeityRelation').[DeityDomain](DeityDomain.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain') + +## DeityDomain\.DomainId Property + +Идентификатор домена\. + +```csharp +public int DomainId { get; set; } +``` + +#### Property Value +[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32') \ No newline at end of file diff --git a/Documentation/Pf2eModel/DeityDomain.md b/Documentation/Pf2eModel/DeityDomain.md index b7bcfb1..3a7ebd9 100644 --- a/Documentation/Pf2eModel/DeityDomain.md +++ b/Documentation/Pf2eModel/DeityDomain.md @@ -15,6 +15,8 @@ Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System. | :--- | :--- | | [Deity](DeityDomain.Deity.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.Deity') | Божество, к которому относится домен\. | | [DeityId](DeityDomain.DeityId.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.DeityId') | Идентификатор божества, к которому относится домен\. | +| [Domain](DeityDomain.Domain.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.Domain') | Домен, связанный с божеством\. | +| [DomainId](DeityDomain.DomainId.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.DomainId') | Идентификатор домена\. | | [Id](DeityDomain.Id.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.Id') | Идентификатор отношения божества и домена\. | | [IsPrimary](DeityDomain.IsPrimary.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.IsPrimary') | Флаг, указывающий, является ли домен основным для божества\. | | [Value](DeityDomain.Value.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain\.Value') | Значение домена божества, например, "Свет", "Тьма" и т\.д\. | diff --git a/Documentation/Pf2eModel/DeityType.md b/Documentation/Pf2eModel/DeityType.md new file mode 100644 index 0000000..20cc55b --- /dev/null +++ b/Documentation/Pf2eModel/DeityType.md @@ -0,0 +1,35 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Enum](Pf2eModel.Model.Enum.md 'Pf2eModel\.Model\.Enum') + +## DeityType Enum + +Тип божества\. + +```csharp +public enum DeityType +``` +### Fields + + + +`Deity` 0 + +Божество\. + + + +`Pantheon` 1 + +Пантеон\. + + + +`Covenant` 2 + +Ковенант\. + + + +`Philosophy` 3 + +Философия\. \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.AdvancedApocryphalSpell.md b/Documentation/Pf2eModel/Domain.AdvancedApocryphalSpell.md new file mode 100644 index 0000000..c8534fc --- /dev/null +++ b/Documentation/Pf2eModel/Domain.AdvancedApocryphalSpell.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.AdvancedApocryphalSpell Property + +Продвинутое апокрифическое заклинание домена\. + +```csharp +public virtual Pf2eModel.Model.Structure.Spell? AdvancedApocryphalSpell { get; set; } +``` + +#### Property Value +[Spell](Spell.md 'Pf2eModel\.Model\.Structure\.Spell') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.AdvancedApocryphalSpellId.md b/Documentation/Pf2eModel/Domain.AdvancedApocryphalSpellId.md new file mode 100644 index 0000000..f1fab1a --- /dev/null +++ b/Documentation/Pf2eModel/Domain.AdvancedApocryphalSpellId.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.AdvancedApocryphalSpellId Property + +Идентификатор продвинутого апокрифического заклинания домена\. + +```csharp +public System.Nullable AdvancedApocryphalSpellId { get; set; } +``` + +#### Property Value +[System\.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System\.Nullable\`1')[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System\.Nullable\`1') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.AdvancedDomainSpell.md b/Documentation/Pf2eModel/Domain.AdvancedDomainSpell.md new file mode 100644 index 0000000..6254b3a --- /dev/null +++ b/Documentation/Pf2eModel/Domain.AdvancedDomainSpell.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.AdvancedDomainSpell Property + +Продвинутое заклинание домена\. + +```csharp +public virtual Pf2eModel.Model.Structure.Spell AdvancedDomainSpell { get; set; } +``` + +#### Property Value +[Spell](Spell.md 'Pf2eModel\.Model\.Structure\.Spell') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.AdvancedDomainSpellId.md b/Documentation/Pf2eModel/Domain.AdvancedDomainSpellId.md new file mode 100644 index 0000000..dea80a1 --- /dev/null +++ b/Documentation/Pf2eModel/Domain.AdvancedDomainSpellId.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.AdvancedDomainSpellId Property + +Идентификатор продвинутого заклинания домена\. + +```csharp +public int AdvancedDomainSpellId { get; set; } +``` + +#### Property Value +[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.ApocryphalSpell.md b/Documentation/Pf2eModel/Domain.ApocryphalSpell.md new file mode 100644 index 0000000..c1e5985 --- /dev/null +++ b/Documentation/Pf2eModel/Domain.ApocryphalSpell.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.ApocryphalSpell Property + +Апокрифическое заклинание домена\. + +```csharp +public virtual Pf2eModel.Model.Structure.Spell? ApocryphalSpell { get; set; } +``` + +#### Property Value +[Spell](Spell.md 'Pf2eModel\.Model\.Structure\.Spell') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.ApocryphalSpellId.md b/Documentation/Pf2eModel/Domain.ApocryphalSpellId.md new file mode 100644 index 0000000..8799f79 --- /dev/null +++ b/Documentation/Pf2eModel/Domain.ApocryphalSpellId.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.ApocryphalSpellId Property + +Идентификатор апокрифического заклинания домена\. + +```csharp +public System.Nullable ApocryphalSpellId { get; set; } +``` + +#### Property Value +[System\.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System\.Nullable\`1')[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System\.Nullable\`1') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.DeityDomains.md b/Documentation/Pf2eModel/Domain.DeityDomains.md new file mode 100644 index 0000000..d1fb34b --- /dev/null +++ b/Documentation/Pf2eModel/Domain.DeityDomains.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.DeityDomains Property + +Связи с божествами, которые используют этот домен\. + +```csharp +public virtual System.Collections.Generic.ICollection DeityDomains { get; set; } +``` + +#### Property Value +[System\.Collections\.Generic\.ICollection<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.ICollection-1 'System\.Collections\.Generic\.ICollection\`1')[DeityDomain](DeityDomain.md 'Pf2eModel\.Model\.Structure\.DeityRelation\.DeityDomain')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.ICollection-1 'System\.Collections\.Generic\.ICollection\`1') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.DomainSpell.md b/Documentation/Pf2eModel/Domain.DomainSpell.md new file mode 100644 index 0000000..a1bce17 --- /dev/null +++ b/Documentation/Pf2eModel/Domain.DomainSpell.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.DomainSpell Property + +Заклинание домена\. + +```csharp +public virtual Pf2eModel.Model.Structure.Spell DomainSpell { get; set; } +``` + +#### Property Value +[Spell](Spell.md 'Pf2eModel\.Model\.Structure\.Spell') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.DomainSpellId.md b/Documentation/Pf2eModel/Domain.DomainSpellId.md new file mode 100644 index 0000000..3170956 --- /dev/null +++ b/Documentation/Pf2eModel/Domain.DomainSpellId.md @@ -0,0 +1,13 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.DomainSpellId Property + +Идентификатор заклинания домена\. + +```csharp +public int DomainSpellId { get; set; } +``` + +#### Property Value +[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.Entity.md b/Documentation/Pf2eModel/Domain.Entity.md new file mode 100644 index 0000000..0dba2ed --- /dev/null +++ b/Documentation/Pf2eModel/Domain.Entity.md @@ -0,0 +1,15 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.Entity Property + +Корневая сущность\. + +```csharp +public Pf2eModel.Model.Base.Entity Entity { get; set; } +``` + +Implements [Entity](IEntity.Entity.md 'Pf2eModel\.Model\.IEntity\.Entity') + +#### Property Value +[Entity](Entity.md 'Pf2eModel\.Model\.Base\.Entity') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.Id.md b/Documentation/Pf2eModel/Domain.Id.md new file mode 100644 index 0000000..52e6d53 --- /dev/null +++ b/Documentation/Pf2eModel/Domain.Id.md @@ -0,0 +1,15 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') + +## Domain\.Id Property + +Идентификатор сущности\. + +```csharp +public int Id { get; set; } +``` + +Implements [Id](IEntity.Id.md 'Pf2eModel\.Model\.IEntity\.Id') + +#### Property Value +[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32') \ No newline at end of file diff --git a/Documentation/Pf2eModel/Domain.md b/Documentation/Pf2eModel/Domain.md new file mode 100644 index 0000000..d71231d --- /dev/null +++ b/Documentation/Pf2eModel/Domain.md @@ -0,0 +1,28 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure') + +## Domain Class + +Домен\. + +```csharp +public class Domain : Pf2eModel.Model.IEntity +``` + +Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System\.Object') 🡒 Domain + +Implements [IEntity](IEntity.md 'Pf2eModel\.Model\.IEntity') + +| Properties | | +| :--- | :--- | +| [AdvancedApocryphalSpell](Domain.AdvancedApocryphalSpell.md 'Pf2eModel\.Model\.Structure\.Domain\.AdvancedApocryphalSpell') | Продвинутое апокрифическое заклинание домена\. | +| [AdvancedApocryphalSpellId](Domain.AdvancedApocryphalSpellId.md 'Pf2eModel\.Model\.Structure\.Domain\.AdvancedApocryphalSpellId') | Идентификатор продвинутого апокрифического заклинания домена\. | +| [AdvancedDomainSpell](Domain.AdvancedDomainSpell.md 'Pf2eModel\.Model\.Structure\.Domain\.AdvancedDomainSpell') | Продвинутое заклинание домена\. | +| [AdvancedDomainSpellId](Domain.AdvancedDomainSpellId.md 'Pf2eModel\.Model\.Structure\.Domain\.AdvancedDomainSpellId') | Идентификатор продвинутого заклинания домена\. | +| [ApocryphalSpell](Domain.ApocryphalSpell.md 'Pf2eModel\.Model\.Structure\.Domain\.ApocryphalSpell') | Апокрифическое заклинание домена\. | +| [ApocryphalSpellId](Domain.ApocryphalSpellId.md 'Pf2eModel\.Model\.Structure\.Domain\.ApocryphalSpellId') | Идентификатор апокрифического заклинания домена\. | +| [DeityDomains](Domain.DeityDomains.md 'Pf2eModel\.Model\.Structure\.Domain\.DeityDomains') | Связи с божествами, которые используют этот домен\. | +| [DomainSpell](Domain.DomainSpell.md 'Pf2eModel\.Model\.Structure\.Domain\.DomainSpell') | Заклинание домена\. | +| [DomainSpellId](Domain.DomainSpellId.md 'Pf2eModel\.Model\.Structure\.Domain\.DomainSpellId') | Идентификатор заклинания домена\. | +| [Entity](Domain.Entity.md 'Pf2eModel\.Model\.Structure\.Domain\.Entity') | Корневая сущность\. | +| [Id](Domain.Id.md 'Pf2eModel\.Model\.Structure\.Domain\.Id') | Идентификатор сущности\. | diff --git a/Documentation/Pf2eModel/EntityType.md b/Documentation/Pf2eModel/EntityType.md index e2fc266..76d4704 100644 --- a/Documentation/Pf2eModel/EntityType.md +++ b/Documentation/Pf2eModel/EntityType.md @@ -82,44 +82,50 @@ public enum EntityType Состояние\. + + +`Domain` 12 + +Домен божества\. + -`Deity` 12 +`Deity` 13 Божество\. -`Feat` 13 +`Feat` 14 Навык\. -`Heritage` 14 +`Heritage` 15 Наследие\. -`Spell` 15 +`Spell` 16 Заклианиние\. -`Ritual` 16 +`Ritual` 17 Ритуал\. -`Language` 17 +`Language` 18 Язык\. -`Rule` 18 +`Rule` 19 Правило\. \ No newline at end of file diff --git a/Documentation/Pf2eModel/IEntity.md b/Documentation/Pf2eModel/IEntity.md index 4cdc981..5383d58 100644 --- a/Documentation/Pf2eModel/IEntity.md +++ b/Documentation/Pf2eModel/IEntity.md @@ -17,6 +17,7 @@ Derived ↳ [Class](Class.md 'Pf2eModel\.Model\.Structure\.Class') ↳ [Condition](Condition.md 'Pf2eModel\.Model\.Structure\.Condition') ↳ [Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') +↳ [Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') ↳ [Feat](Feat.md 'Pf2eModel\.Model\.Structure\.Feat') ↳ [Heritage](Heritage.md 'Pf2eModel\.Model\.Structure\.Heritage') ↳ [Language](Language.md 'Pf2eModel\.Model\.Structure\.Language') diff --git a/Documentation/Pf2eModel/Pf2eModel.Model.Enum.md b/Documentation/Pf2eModel/Pf2eModel.Model.Enum.md index 45bce0b..46a4240 100644 --- a/Documentation/Pf2eModel/Pf2eModel.Model.Enum.md +++ b/Documentation/Pf2eModel/Pf2eModel.Model.Enum.md @@ -11,9 +11,9 @@ | [AttributeValues](AttributeValues.md 'Pf2eModel\.Model\.Enum\.AttributeValues') | Перечисление значений атрибутов\. | | [ClassProgressionType](ClassProgressionType.md 'Pf2eModel\.Model\.Enum\.ClassProgressionType') | Тип элемента прогрессии класса\. | | [ConditionGroup](ConditionGroup.md 'Pf2eModel\.Model\.Enum\.ConditionGroup') | Тип состояния | -| [DeityCategory](DeityCategory.md 'Pf2eModel\.Model\.Enum\.DeityCategory') | Тип божества\. | | [DeityFonts](DeityFonts.md 'Pf2eModel\.Model\.Enum\.DeityFonts') | Тип божественной силы\. | | [DeitySanctification](DeitySanctification.md 'Pf2eModel\.Model\.Enum\.DeitySanctification') | Тип освящения божества\. | +| [DeityType](DeityType.md 'Pf2eModel\.Model\.Enum\.DeityType') | Тип божества\. | | [ElementEnum](ElementEnum.md 'Pf2eModel\.Model\.Enum\.ElementEnum') | Перечисление элементов\. | | [EntityRarity](EntityRarity.md 'Pf2eModel\.Model\.Enum\.EntityRarity') | Перечисление редкости сущности\. | | [EntityType](EntityType.md 'Pf2eModel\.Model\.Enum\.EntityType') | Тип сущности\. | @@ -21,6 +21,7 @@ | [SizeEnum](SizeEnum.md 'Pf2eModel\.Model\.Enum\.SizeEnum') | Размер\. | | [SourceCategory](SourceCategory.md 'Pf2eModel\.Model\.Enum\.SourceCategory') | Перечисление категорий источников\. | | [SpellAreaType](SpellAreaType.md 'Pf2eModel\.Model\.Enum\.SpellAreaType') | Тип области заклинания\. | +| [SpellcastingType](SpellcastingType.md 'Pf2eModel\.Model\.Enum\.SpellcastingType') | Перечисление типа применения заклинаний\. | | [SpellDamageCategory](SpellDamageCategory.md 'Pf2eModel\.Model\.Enum\.SpellDamageCategory') | Тип урона заклинания\. | | [SpellDamageKinds](SpellDamageKinds.md 'Pf2eModel\.Model\.Enum\.SpellDamageKinds') | Тип урона заклинания\. | | [SpellTradition](SpellTradition.md 'Pf2eModel\.Model\.Enum\.SpellTradition') | Традиция заклинания\. | diff --git a/Documentation/Pf2eModel/Pf2eModel.Model.Structure.md b/Documentation/Pf2eModel/Pf2eModel.Model.Structure.md index cb0d2ca..c8e971b 100644 --- a/Documentation/Pf2eModel/Pf2eModel.Model.Structure.md +++ b/Documentation/Pf2eModel/Pf2eModel.Model.Structure.md @@ -14,6 +14,7 @@ | [Class](Class.md 'Pf2eModel\.Model\.Structure\.Class') | Класс\. | | [Condition](Condition.md 'Pf2eModel\.Model\.Structure\.Condition') | Состояние\. | | [Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') | Божество\. | +| [Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') | Домен\. | | [Feat](Feat.md 'Pf2eModel\.Model\.Structure\.Feat') | Способность\. | | [Heritage](Heritage.md 'Pf2eModel\.Model\.Structure\.Heritage') | Наследие\. | | [Language](Language.md 'Pf2eModel\.Model\.Structure\.Language') | Язык\. | diff --git a/Documentation/Pf2eModel/SpellcastingType.md b/Documentation/Pf2eModel/SpellcastingType.md new file mode 100644 index 0000000..e298090 --- /dev/null +++ b/Documentation/Pf2eModel/SpellcastingType.md @@ -0,0 +1,29 @@ +#### [Pf2eModel](index.md 'index') +### [Pf2eModel\.Model\.Enum](Pf2eModel.Model.Enum.md 'Pf2eModel\.Model\.Enum') + +## SpellcastingType Enum + +Перечисление типа применения заклинаний\. + +```csharp +public enum SpellcastingType +``` +### Fields + + + +`None` 0 + +Не применяет заклинания\. + + + +`Prepared` 1 + +Заготавливаемое заклинательство\. + + + +`Spontaneous` 2 + +Спонтанное заклинательство\. \ No newline at end of file diff --git a/Documentation/Pf2eModel/TraitType.md b/Documentation/Pf2eModel/TraitType.md index 5b27d88..3355aaa 100644 --- a/Documentation/Pf2eModel/TraitType.md +++ b/Documentation/Pf2eModel/TraitType.md @@ -16,14 +16,20 @@ public enum TraitType Обычный признак\. + + +`Alignment` 1 + +Мировоззрение\. + -`Class` 1 +`Class` 2 Признак класса\. -`Tradition` 2 +`Tradition` 3 Признак традиции\. \ No newline at end of file diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Helpers/AonprdBuilderGlobals.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Helpers/AonprdBuilderGlobals.cs index 71787da..ed69a49 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Helpers/AonprdBuilderGlobals.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Helpers/AonprdBuilderGlobals.cs @@ -26,6 +26,11 @@ internal class AonprdBuilderGlobals /// public Dictionary TraitIds { get; } = []; + /// + /// Список идентификаторов сущностей, которые нужно игнорировать при обработке. + /// + public List Ignore { get; } = []; + /// /// Словарей суффиксов для сущностей /// @@ -63,6 +68,8 @@ internal class AonprdBuilderGlobals if (json is not null) { + Ignore = json.SelectToken("Ignore")?.ToObject>() ?? []; + SlugSuffixes = JsonToDictionary(json, "SlugSuffixes"); LegacyRemasterExtra = JsonToDictionary(json, "LegacyRemasterExtra"); MergeSources = JsonToDictionary(json, "MergeSources"); diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/AbstractEntityProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/AbstractEntityProcessor.cs index be15076..25cfcc7 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/AbstractEntityProcessor.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/AbstractEntityProcessor.cs @@ -100,7 +100,14 @@ internal abstract class AbstractEntityProcessor( /// public virtual void Check() { - if (Globals.MergeSources.ContainsKey(Input.GetRequired("id"))) + string id = Input.GetRequired("id"); + + if (Globals.Ignore.Contains(id)) + { + throw new SkipItemException(Name, "игнорируется."); + } + + if (Globals.MergeSources.ContainsKey(id)) { throw new SkipItemException(Name, "помечено на слияние."); } diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/ClassProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/ClassProcessor.cs index a3db82f..7ce090a 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/ClassProcessor.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/ClassProcessor.cs @@ -7,7 +7,6 @@ using Pf2eDataScrapper.Helpers; using Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers; using Pf2eDataScrapper.Processors; using Pf2eDataScrapper.Processors.Attributes; -using Pf2eDataScrapper.Processors.Collection; using Pf2eModel; using Pf2eModel.Model.Common; using Pf2eModel.Model.Common.I18n; @@ -88,15 +87,12 @@ internal partial class ClassProcessor( switch (tradition.Count) { case 0: - Object.Spellcasting = false; Object.Tradition = SpellTradition.None; break; case 1: - Object.Spellcasting = true; Object.Tradition = Input.Enum(tradition[0].ToString()); break; default: - Object.Spellcasting = true; Object.Tradition = SpellTradition.All; break; } diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs new file mode 100644 index 0000000..70ea28d --- /dev/null +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs @@ -0,0 +1,261 @@ +using System.Linq; +using System.Text.RegularExpressions; +using Newtonsoft.Json.Linq; +using Pf2eDataScrapper.Helpers; +using Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers; +using Pf2eDataScrapper.Processors; +using Pf2eDataScrapper.Processors.Attributes; +using Pf2eModel; +using Pf2eModel.Model.Common; +using Pf2eModel.Model.Common.I18n; +using Pf2eModel.Model.Enum; +using Pf2eModel.Model.Structure; +using Pf2eModel.Model.Structure.DeityRelation; +using StringHelper = Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers.StringHelper; + +namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types; + +[ProcessorCollection( + "aonprd:deity", + InnerType = "deity", + CompendiumType = ProcessorCompendiumEnum.Aonprd, + Description = "Божества", + Group = ProcessorGroupEnum.AonprdEntities +)] +[ProcessorDependencies(["aonprd:domain", "aonprd:spell", "aonprd:trait", "aonprd:source"])] +internal partial class DeityProcessor( + ProcessorInput input, + StringHelper stringHelper, + DatabaseHelper helper, + AonprdBuilderGlobals globals +) : AbstractEntityProcessor(input, stringHelper, helper, globals) +{ + /// + public override EntityType Type => EntityType.Deity; + + /// + public override Deity Object { get; } = new(); + + /// + protected override void Add() => Context.Deities.Add(Object); + + /// + public override void Process() + { + base.Process(); + + // Установка категории божества + Object.Category = Input.GetRequired("deity_category"); + + ProcessFonts(); + + // Обработка атрибутов + ProcessAttributes(); + + // Обработка доменов + ProcessDomains(); + + // Обработка заклинаний + ProcessSpells(); + + // Обработка оружия + ProcessWeapons(); + + // Обработка навыков + ProcessSkills(); + + // Обработка текстов описания + ProcessTexts(); + + // Обработка освящения - в Foundry! + } + + /// + protected override void AddTraits() + { + // У божеств нет признаков. Не знаю, зачем они на Архивах. + } + + /// + /// Обработка божественной силы. + /// + private void ProcessFonts() + { + JArray fonts = Input.GetOptional("divine_font") ?? []; + + switch (fonts.Count) + { + case 0: + Object.Fonts = DeityFonts.None; + return; + + // Если есть и Heal, и Harm + case 2: + Object.Fonts = DeityFonts.Any; + return; + + default: + { + // Определяем тип по первому элементу + string font = fonts[0].ToString(); + Object.Fonts = Input.Enum(font); + break; + } + } + } + + /// + /// Обработка атрибутов божества. + /// + private void ProcessAttributes() + { + JArray attributes = Input.GetOptional("attribute") ?? []; + foreach (JToken token in attributes) + { + AttributeValues attribute = Input.Enum(token.ToString()); + Object.DeityAttributes.Add(new() { Deity = Object, Attribute = attribute }); + } + } + + /// + /// Обработка доменов божества. + /// + private void ProcessDomains() + { + // Обработка основных доменов + string primaryDomainsMarkdown = Input.GetRequired("domain_primary_markdown"); + ProcessDomainMarkdown(primaryDomainsMarkdown, true); + + // Обработка альтернативных доменов + string alternateDomainsMarkdown = Input.GetRequired("domain_alternate_markdown"); + ProcessDomainMarkdown(alternateDomainsMarkdown, false); + } + + /// + /// Обработка markdown-строки с доменами. + /// + /// Markdown-строка с доменами. + /// Флаг, указывающий, являются ли домены основными. + private void ProcessDomainMarkdown(string markdown, bool isPrimary) + { + // Разделяем markdown на отдельные ссылки + MatchCollection matches = MarkdownLinkRegex().Matches(markdown); + foreach (Match match in matches) + { + string domainName = match.Groups[1].Value; + + // Ищем домен в базе данных + Domain? domain = Context.Domains.FirstOrDefault(d => + Pf2eDbContext.LocaleSearch(d.Entity.Name, domainName) + ); + + if (domain != null) + { + Object.DeityDomains.Add( + new() + { + Deity = Object, + Domain = domain, + IsPrimary = isPrimary, + Value = domainName, + } + ); + } + } + } + + /// + /// Обработка заклинаний божества. + /// + private void ProcessSpells() + { + string spellsMarkdown = Input.GetRequired("spell_markdown"); + MatchCollection matches = MarkdownLinkRegex().Matches(spellsMarkdown); + + foreach (Match match in matches) + { + string spellName = match.Groups[1].Value; + + // Ищем заклинание в базе данных + Spell? spell = Context.Spells.FirstOrDefault(s => + Pf2eDbContext.LocaleSearch(s.Entity.Name, spellName) + ); + + if (spell != null) + { + Object.DeitySpells.Add( + new() + { + Deity = Object, + Spell = spell, + Level = spell.Level, + } + ); + } + } + } + + /// + /// Обработка оружия божества. + /// + private void ProcessWeapons() + { + string weaponsMarkdown = Input.GetRequired("favored_weapon_markdown"); + MatchCollection matches = MarkdownLinkRegex().Matches(weaponsMarkdown); + + foreach (Match match in matches) + { + string weaponName = match.Groups[1].Value; + Object.DeityWeapons.Add(new() { Deity = Object, Weapon = weaponName }); + } + } + + /// + /// Обработка навыков божества. + /// + private void ProcessSkills() + { + string skillsMarkdown = Input.GetRequired("skill_markdown"); + MatchCollection matches = MarkdownLinkRegex().Matches(skillsMarkdown); + + foreach (Match match in matches) + { + string skillName = match.Groups[1].Value; + + // Ищем навык в базе данных + Training? training = Context.Trainings.FirstOrDefault(t => + Pf2eDbContext.LocaleSearch(t.Name, skillName) + ); + + if (training != null) + { + Object.Skills.Add(training); + } + } + } + + /// + /// Обработка текстов описания божества. + /// + private void ProcessTexts() + { + Object.Edicts[LocaleType.English] = Input.GetRequired("edict"); + Object.Anathema[LocaleType.English] = Input.GetRequired("anathema"); + Object.ReligiousSymbol[LocaleType.English] = Input.GetOptional( + "religious_symbol", + "" + ); + Object.SacredAnimal[LocaleType.English] = Input.GetOptional("sacred_animal", ""); + Object.AreaOfConcern[LocaleType.English] = Input.GetOptional( + "area_of_concern_raw", + "" + ); + } + + /// + /// Регулярное выражение для извлечения названия из markdown-ссылки. + /// + /// Скомпилированное регулярное выражение. + [GeneratedRegex(@"\[([^\]]+)\]\([^)]+\)")] + private static partial Regex MarkdownLinkRegex(); +} diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DomainProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DomainProcessor.cs new file mode 100644 index 0000000..dc7edf9 --- /dev/null +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DomainProcessor.cs @@ -0,0 +1,119 @@ +using System; +using System.Linq; +using System.Text.RegularExpressions; +using Pf2eDataScrapper.Helpers; +using Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers; +using Pf2eDataScrapper.Processors; +using Pf2eDataScrapper.Processors.Attributes; +using Pf2eModel; +using Pf2eModel.Model.Enum; +using Pf2eModel.Model.Structure; +using StringHelper = Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers.StringHelper; + +namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types; + +[ProcessorCollection( + "aonprd:domain", + InnerType = "domain", + CompendiumType = ProcessorCompendiumEnum.Aonprd, + Description = "Домены", + Group = ProcessorGroupEnum.AonprdEntities +)] +[ProcessorDependencies(["aonprd:spell"])] +internal partial class DomainProcessor( + ProcessorInput input, + StringHelper stringHelper, + DatabaseHelper helper, + AonprdBuilderGlobals globals +) : AbstractEntityProcessor(input, stringHelper, helper, globals) +{ + /// + public override EntityType Type => EntityType.Domain; + + /// + public override Domain Object { get; } = new(); + + /// + protected override void Add() => Context.Domains.Add(Object); + + /// + public override void Process() + { + base.Process(); + + // Обработка заклинаний домена + ProcessDomainSpells(); + } + + /// + /// Обработка заклинаний, связанных с доменом. + /// + private void ProcessDomainSpells() + { + // Обработка основного заклинания домена + string domainSpellMarkdown = Input.GetRequired("domain_spell_markdown"); + Object.DomainSpellId = GetSpellIdFromMarkdown(domainSpellMarkdown); + + // Обработка продвинутого заклинания домена + string advancedDomainSpellMarkdown = Input.GetRequired( + "advanced_domain_spell_markdown" + ); + Object.AdvancedDomainSpellId = GetSpellIdFromMarkdown(advancedDomainSpellMarkdown); + + // Обработка апокрифического заклинания (если есть) + string? apocryphalSpellMarkdown = Input.GetOptional("apocryphal_spell_markdown"); + if (!string.IsNullOrEmpty(apocryphalSpellMarkdown)) + { + Object.ApocryphalSpellId = GetSpellIdFromMarkdown(apocryphalSpellMarkdown); + } + + // Обработка продвинутого апокрифического заклинания (если есть) + string? advancedApocryphalSpellMarkdown = Input.GetOptional( + "advanced_apocryphal_spell_markdown" + ); + if (!string.IsNullOrEmpty(advancedApocryphalSpellMarkdown)) + { + Object.AdvancedApocryphalSpellId = GetSpellIdFromMarkdown( + advancedApocryphalSpellMarkdown + ); + } + } + + /// + /// Получение идентификатора заклинания из markdown-строки. + /// + /// Markdown-строка с информацией о заклинании. + /// Идентификатор заклинания. + private int GetSpellIdFromMarkdown(string markdown) + { + // Используем регулярное выражение для извлечения названия заклинания + // Формат: [Название заклинания](/Spells.aspx?ID=XXX) + Match match = MarkdownLinkRegex().Match(markdown); + + if (!match.Success) + { + throw new InvalidOperationException($"Invalid markdown format: {markdown}"); + } + + string spellName = match.Groups[1].Value; + + // Поиск заклинания в базе данных + Spell? spell = Context.Spells.FirstOrDefault(s => + Pf2eDbContext.LocaleSearch(s.Entity.Name, spellName) + ); + + if (spell == null) + { + throw new InvalidOperationException($"Spell '{spellName}' not found in database"); + } + + return spell.Id; + } + + /// + /// Регулярное выражение для извлечения названия из markdown-ссылки. + /// + /// Скомпилированное регулярное выражение. + [GeneratedRegex(@"\[([^\]]+)\]\([^)]+\)")] + private static partial Regex MarkdownLinkRegex(); +} diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitAlignmentsProcessorFactory.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitAlignmentsProcessorFactory.cs new file mode 100644 index 0000000..f42fad7 --- /dev/null +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitAlignmentsProcessorFactory.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using Microsoft.Extensions.DependencyInjection; +using Pf2eDataScrapper.Helpers; +using Pf2eDataScrapper.Importers.Implementations.Aonprd.Helpers; +using Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Subclasses; +using Pf2eDataScrapper.Processors.Attributes; +using Pf2eDataScrapper.Processors.Definitions; +using Pf2eDataScrapper.Processors.Factory; +using Pf2eModel; +using Pf2eModel.Model.Base; +using Pf2eModel.Model.Enum; +using Pf2eModel.Model.Structure; + +namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types; + +[ProcessorFactory( + "aonprd:trait-alignments", + ProcessorType = typeof(TraitAlignmentsProcessor), + Description = "Трейты мировоззрений", + Group = ProcessorGroupEnum.AonprdPreparation, + Parallel = false +)] +internal class TraitAlignmentsProcessorFactory(IServiceProvider serviceProvider) + : AbstractProcessorFactory +{ + public IServiceProvider ServiceProvider { get; } = serviceProvider; + public List Alignments { get; } = ["LG", "NG", "CG", "LN", "N", "CN", "LE", "NE", "CE"]; + + public override int Count() + { + return Alignments.Count; + } + + public override IEnumerable> GetEnumerator() + { + foreach (string alignment in Alignments) + { + TraitAlignmentsProcessor processor = + ActivatorUtilities.CreateInstance( + ServiceProvider, + alignment + ); + + yield return new($"{alignment}", processor); + } + } +} + +internal class TraitAlignmentsProcessor( + string alignment, + DatabaseHelper helper, + AonprdBuilderGlobals globals +) : IProcessor +{ + public string Alignment { get; } = alignment; + public DatabaseHelper Helper { get; } = helper; + public AonprdBuilderGlobals Globals { get; } = globals; + public Pf2eDbContext Context { get; } = new(); + + public Entity Entity { get; set; } = null!; + public Trait Trait { get; set; } = null!; + + public void Process() + { + Entity = new() + { + Name = new() { ["en"] = Alignment }, + Type = EntityType.Trait, + Img = "", + Description = "", + Rarity = EntityRarity.Common, + IsTranslated = false, + IsChecked = false, + Slug = Helper.GenerateSlug(Alignment), + }; + + Trait = new() { Entity = Entity, Type = TraitType.Alignment }; + } + + public void Save() + { + Context.Entities.Add(Entity); + Context.Traits.Add(Trait); + + Globals.TraitIds[Alignment] = Entity.Id; + } +} diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitProcessor.cs index 0d179ff..78238a3 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitProcessor.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/TraitProcessor.cs @@ -16,7 +16,9 @@ namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types; Description = "Признаки", Group = ProcessorGroupEnum.AonprdEntities )] -[ProcessorDependencies(["aonprd:external", "aonprd:source"])] +[ProcessorDependencies( + ["aonprd:external", "aonprd:source", "aonprd:source", "aonprd:trait-alignments"] +)] internal class TraitProcessor( ProcessorInput input, StringHelper stringHelper, diff --git a/Pf2eDataScrapper/Resources/ImportAdaptation.json b/Pf2eDataScrapper/Resources/ImportAdaptation.json index 0a012bc..71fe152 100644 --- a/Pf2eDataScrapper/Resources/ImportAdaptation.json +++ b/Pf2eDataScrapper/Resources/ImportAdaptation.json @@ -1,5 +1,8 @@ { "Aonprd": { + "Ignore": [ + "domain-38" + ], "SlugSuffixes": { "spell-843": "initial", "feat-455": "initial", diff --git a/Pf2eModel/Migrations/20250912112500_1.Designer.cs b/Pf2eModel/Migrations/20250912112500_1.Designer.cs index b871bcd..3270e16 100644 --- a/Pf2eModel/Migrations/20250912112500_1.Designer.cs +++ b/Pf2eModel/Migrations/20250912112500_1.Designer.cs @@ -13,7 +13,11 @@ using Pf2eModel.Model.Enum; namespace Pf2eModel.Migrations { [DbContext(typeof(Pf2eDbContext))] +<<<<<<<< HEAD:Pf2eModel/Migrations/20250912112500_1.Designer.cs [Migration("20250912112500_1")] +======== + [Migration("20250914093120_1")] +>>>>>>>> origin/dev2:Pf2eModel/Migrations/20250914093120_1.Designer.cs partial class _1 { /// @@ -29,12 +33,12 @@ namespace Pf2eModel.Migrations NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "attribute_values", new[] { "cha", "con", "dex", "free", "int", "str", "wis" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "class_progression_type", new[] { "ancestry_feat", "attribute_increase", "class_feat", "entity", "general_feat", "skill_feat", "skill_increase" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "condition_group", new[] { "abilities", "attitudes", "death", "detection", "senses", "unknown" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_category", new[] { "covenant", "deity", "pantheon", "philosophy" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_fonts", new[] { "any", "harm", "heal", "none" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_sanctification", new[] { "any", "holy", "unholy" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_type", new[] { "covenant", "deity", "pantheon", "philosophy" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "element_enum", new[] { "air", "earth", "fire", "metal", "universal", "water", "wood" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_rarity", new[] { "common", "rare", "uncommon", "unique" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "domain", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_category", new[] { "ancestry", "ancestry-feature", "archetype", "bonus", "calling", "campaign-feature", "class", "class-feature", "curse", "deityboon", "general", "pfsboon", "skill", "uncategorized" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "locale_type", new[] { "english", "hobby", "other", "russian" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "size_enum", new[] { "huge", "large", "medium", "small", "tiny" }); @@ -44,7 +48,7 @@ namespace Pf2eModel.Migrations NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_kinds", new[] { "any", "damage", "healing" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_tradition", new[] { "all", "arcane", "divine", "elemental", "none", "occult", "primal" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "training_rank", new[] { "expert", "legendary", "master", "mythic", "trained", "untrained" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "class", "regular", "tradition" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "alignment", "class", "regular", "tradition" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "vision_enum", new[] { "dark-vision", "low-light-vision", "normal" }); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -896,11 +900,11 @@ namespace Pf2eModel.Migrations .HasColumnOrder(2) .HasComment("Количество очков здоровья"); - b.Property("Spellcasting") - .HasColumnType("boolean") + b.Property("Spellcasting") + .HasColumnType("integer") .HasColumnName("spellcasting") .HasColumnOrder(3) - .HasComment("Заклинатель?"); + .HasComment("Тип заклинательства"); b.Property("Tradition") .HasColumnType("spell_tradition") @@ -1128,30 +1132,72 @@ namespace Pf2eModel.Migrations .HasColumnOrder(1) .HasComment("Идентификатор"); - b.Property("Category") - .HasColumnType("deity_category") + b.Property("Anathema") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("anathema") + .HasColumnOrder(8) + .HasComment("Анафемы божества"); + + b.Property("AreaOfConcern") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("area_of_concern") + .HasColumnOrder(11) + .HasComment("Область покровительства божества"); + + b.Property("Category") + .IsRequired() + .HasColumnType("text") .HasColumnName("category") - .HasColumnOrder(2) - .HasComment("Тип божества"); + .HasColumnOrder(3) + .HasComment("Категория божества"); + + b.Property("Edicts") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("edicts") + .HasColumnOrder(7) + .HasComment("Заветы божества"); b.Property("Fonts") .HasColumnType("deity_fonts") .HasColumnName("fonts") - .HasColumnOrder(3) + .HasColumnOrder(4) .HasComment("Тип божественной силы"); + b.Property("ReligiousSymbol") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("religious_symbol") + .HasColumnOrder(9) + .HasComment("Религиозный символ божества"); + + b.Property("SacredAnimal") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("sacred_animal") + .HasColumnOrder(10) + .HasComment("Священное животное божества"); + b.Property("Sanctification") .HasColumnType("deity_sanctification") .HasColumnName("sanctification") - .HasColumnOrder(4) + .HasColumnOrder(5) .HasComment("Тип освящения"); b.Property("SanctificationMust") .HasColumnType("boolean") .HasColumnName("sanctification_must") - .HasColumnOrder(5) + .HasColumnOrder(6) .HasComment("Обязательное освящение"); + b.Property("Type") + .HasColumnType("deity_type") + .HasColumnName("type") + .HasColumnOrder(2) + .HasComment("Тип божества"); + b.HasKey("Id") .HasName("pk_deities"); @@ -1160,21 +1206,33 @@ namespace Pf2eModel.Migrations modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeityAttribute", b => { - b.Property("DeityId") + b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("integer") - .HasColumnName("deity_id") + .HasColumnName("id") .HasColumnOrder(1) - .HasComment("Идентификатор божества"); + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Attribute") .HasColumnType("attribute_values") .HasColumnName("attribute") - .HasColumnOrder(2) + .HasColumnOrder(3) .HasComment("Атрибут божества"); - b.HasKey("DeityId", "Attribute") + b.Property("DeityId") + .HasColumnType("integer") + .HasColumnName("deity_id") + .HasColumnOrder(2) + .HasComment("Идентификатор божества"); + + b.HasKey("Id") .HasName("pk_deity_attributes"); + b.HasIndex("DeityId") + .HasDatabaseName("ix_deity_attributes_deity_id"); + b.ToTable("deity_attributes", (string)null); }); @@ -1195,6 +1253,12 @@ namespace Pf2eModel.Migrations .HasColumnOrder(2) .HasComment("Идентификатор божества"); + b.Property("DomainId") + .HasColumnType("integer") + .HasColumnName("domain_id") + .HasColumnOrder(4) + .HasComment("Идентификатор домена"); + b.Property("IsPrimary") .HasColumnType("boolean") .HasColumnName("is_primary") @@ -1206,7 +1270,7 @@ namespace Pf2eModel.Migrations .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("value") - .HasColumnOrder(4); + .HasColumnOrder(5); b.HasKey("Id") .HasName("pk_deity_domains"); @@ -1214,6 +1278,9 @@ namespace Pf2eModel.Migrations b.HasIndex("DeityId") .HasDatabaseName("ix_deity_domains_deity_id"); + b.HasIndex("DomainId") + .HasDatabaseName("ix_deity_domains_domain_id"); + b.ToTable("deity_domains", (string)null); }); @@ -1292,6 +1359,56 @@ namespace Pf2eModel.Migrations b.ToTable("deity_weapons", (string)null); }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("AdvancedApocryphalSpellId") + .HasColumnType("integer") + .HasColumnName("advanced_apocryphal_spell_id") + .HasColumnOrder(5) + .HasComment("Продвинутое апокрифическое заклинание домена"); + + b.Property("AdvancedDomainSpellId") + .HasColumnType("integer") + .HasColumnName("advanced_domain_spell_id") + .HasColumnOrder(3) + .HasComment("Продвинутое заклинание домена"); + + b.Property("ApocryphalSpellId") + .HasColumnType("integer") + .HasColumnName("apocryphal_spell_id") + .HasColumnOrder(4) + .HasComment("Апокрифическое заклинание домена"); + + b.Property("DomainSpellId") + .HasColumnType("integer") + .HasColumnName("domain_spell_id") + .HasColumnOrder(2) + .HasComment("Заклинание домена"); + + b.HasKey("Id") + .HasName("pk_domains"); + + b.HasIndex("AdvancedApocryphalSpellId") + .HasDatabaseName("ix_domains_advanced_apocryphal_spell_id"); + + b.HasIndex("AdvancedDomainSpellId") + .HasDatabaseName("ix_domains_advanced_domain_spell_id"); + + b.HasIndex("ApocryphalSpellId") + .HasDatabaseName("ix_domains_apocryphal_spell_id"); + + b.HasIndex("DomainSpellId") + .HasDatabaseName("ix_domains_domain_spell_id"); + + b.ToTable("domains", (string)null); + }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => { b.Property("Id") @@ -2406,7 +2523,16 @@ namespace Pf2eModel.Migrations .IsRequired() .HasConstraintName("fk_deity_domains_deities_deity_id"); + b.HasOne("Pf2eModel.Model.Structure.Domain", "Domain") + .WithMany("DeityDomains") + .HasForeignKey("DomainId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deity_domains_domains_domain_id"); + b.Navigation("Deity"); + + b.Navigation("Domain"); }); modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeitySpell", b => @@ -2442,6 +2568,52 @@ namespace Pf2eModel.Migrations b.Navigation("Deity"); }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.HasOne("Pf2eModel.Model.Structure.Spell", "AdvancedApocryphalSpell") + .WithMany() + .HasForeignKey("AdvancedApocryphalSpellId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_domains_spells_advanced_apocryphal_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "AdvancedDomainSpell") + .WithMany() + .HasForeignKey("AdvancedDomainSpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_spells_advanced_domain_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "ApocryphalSpell") + .WithMany() + .HasForeignKey("ApocryphalSpellId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_domains_spells_apocryphal_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "DomainSpell") + .WithMany() + .HasForeignKey("DomainSpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_spells_domain_spell_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Domain", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_entities_id"); + + b.Navigation("AdvancedApocryphalSpell"); + + b.Navigation("AdvancedDomainSpell"); + + b.Navigation("ApocryphalSpell"); + + b.Navigation("DomainSpell"); + + b.Navigation("Entity"); + }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => { b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") @@ -2732,6 +2904,11 @@ namespace Pf2eModel.Migrations b.Navigation("DeityWeapons"); }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.Navigation("DeityDomains"); + }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => { b.Navigation("FeatPrerequisites"); diff --git a/Pf2eModel/Migrations/20250912112500_1.cs b/Pf2eModel/Migrations/20250912112500_1.cs index 47887f7..face626 100644 --- a/Pf2eModel/Migrations/20250912112500_1.cs +++ b/Pf2eModel/Migrations/20250912112500_1.cs @@ -19,12 +19,12 @@ namespace Pf2eModel.Migrations .Annotation("Npgsql:Enum:attribute_values", "cha,con,dex,free,int,str,wis") .Annotation("Npgsql:Enum:class_progression_type", "ancestry_feat,attribute_increase,class_feat,entity,general_feat,skill_feat,skill_increase") .Annotation("Npgsql:Enum:condition_group", "abilities,attitudes,death,detection,senses,unknown") - .Annotation("Npgsql:Enum:deity_category", "covenant,deity,pantheon,philosophy") .Annotation("Npgsql:Enum:deity_fonts", "any,harm,heal,none") .Annotation("Npgsql:Enum:deity_sanctification", "any,holy,unholy") + .Annotation("Npgsql:Enum:deity_type", "covenant,deity,pantheon,philosophy") .Annotation("Npgsql:Enum:element_enum", "air,earth,fire,metal,universal,water,wood") .Annotation("Npgsql:Enum:entity_rarity", "common,rare,uncommon,unique") - .Annotation("Npgsql:Enum:entity_type", "action,ancestry,archetype,background,backpack,campaign_feature,class,condition,deity,feat,heritage,language,ritual,rule,spell,subclass,subclass_group,trait,unknown") + .Annotation("Npgsql:Enum:entity_type", "action,ancestry,archetype,background,backpack,campaign_feature,class,condition,deity,domain,feat,heritage,language,ritual,rule,spell,subclass,subclass_group,trait,unknown") .Annotation("Npgsql:Enum:feat_category", "ancestry,ancestry-feature,archetype,bonus,calling,campaign-feature,class,class-feature,curse,deityboon,general,pfsboon,skill,uncategorized") .Annotation("Npgsql:Enum:locale_type", "english,hobby,other,russian") .Annotation("Npgsql:Enum:size_enum", "huge,large,medium,small,tiny") @@ -34,7 +34,7 @@ namespace Pf2eModel.Migrations .Annotation("Npgsql:Enum:spell_damage_kinds", "any,damage,healing") .Annotation("Npgsql:Enum:spell_tradition", "all,arcane,divine,elemental,none,occult,primal") .Annotation("Npgsql:Enum:training_rank", "expert,legendary,master,mythic,trained,untrained") - .Annotation("Npgsql:Enum:trait_type", "class,regular,tradition") + .Annotation("Npgsql:Enum:trait_type", "alignment,class,regular,tradition") .Annotation("Npgsql:Enum:vision_enum", "dark-vision,low-light-vision,normal"); migrationBuilder.CreateTable( @@ -195,7 +195,7 @@ namespace Pf2eModel.Migrations { id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), hp = table.Column(type: "integer", nullable: false, comment: "Количество очков здоровья"), - spellcasting = table.Column(type: "boolean", nullable: false, comment: "Заклинатель?"), + spellcasting = table.Column(type: "integer", nullable: false, comment: "Тип заклинательства"), tradition = table.Column(type: "spell_tradition", nullable: true, comment: "Традиция заклинаний"), additional_trained_skills = table.Column(type: "integer", nullable: false, comment: "Дополнительные навыки") }, @@ -234,10 +234,16 @@ namespace Pf2eModel.Migrations columns: table => new { id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), - category = table.Column(type: "deity_category", nullable: false, comment: "Тип божества"), + type = table.Column(type: "deity_type", nullable: false, comment: "Тип божества"), + category = table.Column(type: "text", nullable: false, comment: "Категория божества"), fonts = table.Column(type: "deity_fonts", nullable: false, comment: "Тип божественной силы"), sanctification = table.Column(type: "deity_sanctification", nullable: false, comment: "Тип освящения"), - sanctification_must = table.Column(type: "boolean", nullable: false, comment: "Обязательное освящение") + sanctification_must = table.Column(type: "boolean", nullable: false, comment: "Обязательное освящение"), + edicts = table.Column(type: "jsonb", nullable: false, comment: "Заветы божества"), + anathema = table.Column(type: "jsonb", nullable: false, comment: "Анафемы божества"), + religious_symbol = table.Column(type: "jsonb", nullable: false, comment: "Религиозный символ божества"), + sacred_animal = table.Column(type: "jsonb", nullable: false, comment: "Священное животное божества"), + area_of_concern = table.Column(type: "jsonb", nullable: false, comment: "Область покровительства божества") }, constraints: table => { @@ -778,12 +784,14 @@ namespace Pf2eModel.Migrations name: "deity_attributes", columns: table => new { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), deity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор божества"), attribute = table.Column(type: "attribute_values", nullable: false, comment: "Атрибут божества") }, constraints: table => { - table.PrimaryKey("pk_deity_attributes", x => new { x.deity_id, x.attribute }); + table.PrimaryKey("pk_deity_attributes", x => x.id); table.ForeignKey( name: "fk_deity_attributes_deities_deity_id", column: x => x.deity_id, @@ -792,27 +800,6 @@ namespace Pf2eModel.Migrations onDelete: ReferentialAction.Cascade); }); - migrationBuilder.CreateTable( - name: "deity_domains", - columns: table => new - { - id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - deity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор божества"), - is_primary = table.Column(type: "boolean", nullable: false, comment: "Флаг основного домена"), - value = table.Column(type: "character varying(255)", maxLength: 255, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_deity_domains", x => x.id); - table.ForeignKey( - name: "fk_deity_domains_deities_deity_id", - column: x => x.deity_id, - principalTable: "deities", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - migrationBuilder.CreateTable( name: "deity_training", columns: table => new @@ -1003,6 +990,51 @@ namespace Pf2eModel.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "domains", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + domain_spell_id = table.Column(type: "integer", nullable: false, comment: "Заклинание домена"), + advanced_domain_spell_id = table.Column(type: "integer", nullable: false, comment: "Продвинутое заклинание домена"), + apocryphal_spell_id = table.Column(type: "integer", nullable: true, comment: "Апокрифическое заклинание домена"), + advanced_apocryphal_spell_id = table.Column(type: "integer", nullable: true, comment: "Продвинутое апокрифическое заклинание домена") + }, + constraints: table => + { + table.PrimaryKey("pk_domains", x => x.id); + table.ForeignKey( + name: "fk_domains_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_domains_spells_advanced_apocryphal_spell_id", + column: x => x.advanced_apocryphal_spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.SetNull); + table.ForeignKey( + name: "fk_domains_spells_advanced_domain_spell_id", + column: x => x.advanced_domain_spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_domains_spells_apocryphal_spell_id", + column: x => x.apocryphal_spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.SetNull); + table.ForeignKey( + name: "fk_domains_spells_domain_spell_id", + column: x => x.domain_spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "spell_areas", columns: table => new @@ -1146,6 +1178,34 @@ namespace Pf2eModel.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "deity_domains", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + deity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор божества"), + is_primary = table.Column(type: "boolean", nullable: false, comment: "Флаг основного домена"), + domain_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор домена"), + value = table.Column(type: "character varying(255)", maxLength: 255, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_deity_domains", x => x.id); + table.ForeignKey( + name: "fk_deity_domains_deities_deity_id", + column: x => x.deity_id, + principalTable: "deities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_deity_domains_domains_domain_id", + column: x => x.domain_id, + principalTable: "domains", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "subclass_provided_entities", columns: table => new @@ -1268,11 +1328,21 @@ namespace Pf2eModel.Migrations table: "class_trainings", column: "training_id"); + migrationBuilder.CreateIndex( + name: "ix_deity_attributes_deity_id", + table: "deity_attributes", + column: "deity_id"); + migrationBuilder.CreateIndex( name: "ix_deity_domains_deity_id", table: "deity_domains", column: "deity_id"); + migrationBuilder.CreateIndex( + name: "ix_deity_domains_domain_id", + table: "deity_domains", + column: "domain_id"); + migrationBuilder.CreateIndex( name: "ix_deity_spells_deity_id", table: "deity_spells", @@ -1293,6 +1363,26 @@ namespace Pf2eModel.Migrations table: "deity_weapons", column: "deity_id"); + migrationBuilder.CreateIndex( + name: "ix_domains_advanced_apocryphal_spell_id", + table: "domains", + column: "advanced_apocryphal_spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_domains_advanced_domain_spell_id", + table: "domains", + column: "advanced_domain_spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_domains_apocryphal_spell_id", + table: "domains", + column: "apocryphal_spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_domains_domain_spell_id", + table: "domains", + column: "domain_spell_id"); + migrationBuilder.CreateIndex( name: "ix_entity_aliases_entity_id", table: "entity_aliases", @@ -1521,6 +1611,9 @@ namespace Pf2eModel.Migrations migrationBuilder.DropTable( name: "backgrounds"); + migrationBuilder.DropTable( + name: "domains"); + migrationBuilder.DropTable( name: "deities"); @@ -1542,9 +1635,6 @@ namespace Pf2eModel.Migrations migrationBuilder.DropTable( name: "rituals"); - migrationBuilder.DropTable( - name: "spells"); - migrationBuilder.DropTable( name: "subclasses"); @@ -1554,6 +1644,9 @@ namespace Pf2eModel.Migrations migrationBuilder.DropTable( name: "feats"); + migrationBuilder.DropTable( + name: "spells"); + migrationBuilder.DropTable( name: "subclass_groups"); diff --git a/Pf2eModel/Migrations/20250914093120_1.Designer.cs b/Pf2eModel/Migrations/20250914093120_1.Designer.cs new file mode 100644 index 0000000..3270e16 --- /dev/null +++ b/Pf2eModel/Migrations/20250914093120_1.Designer.cs @@ -0,0 +1,2948 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Pf2eModel; +using Pf2eModel.Model.Enum; + +#nullable disable + +namespace Pf2eModel.Migrations +{ + [DbContext(typeof(Pf2eDbContext))] +<<<<<<<< HEAD:Pf2eModel/Migrations/20250912112500_1.Designer.cs + [Migration("20250912112500_1")] +======== + [Migration("20250914093120_1")] +>>>>>>>> origin/dev2:Pf2eModel/Migrations/20250914093120_1.Designer.cs + partial class _1 + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "action_category", new[] { "archetype", "army_tactic", "army_war_action", "class-feat", "class-feature", "familiar", "kingdom_activity", "kingdom_feat", "kingdom_feature", "skill-action", "unknown" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "action_enum", new[] { "1", "1 hour", "1 minute", "1-2", "1-3", "10 minutes", "2", "2-3", "2/2 rounds", "3", "30 minutes", "5 minutes", "free", "free/1", "other", "passive", "reaction", "reaction/1", "reaction/2", "reaction/3", "unknown" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "attribute_values", new[] { "cha", "con", "dex", "free", "int", "str", "wis" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "class_progression_type", new[] { "ancestry_feat", "attribute_increase", "class_feat", "entity", "general_feat", "skill_feat", "skill_increase" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "condition_group", new[] { "abilities", "attitudes", "death", "detection", "senses", "unknown" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_fonts", new[] { "any", "harm", "heal", "none" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_sanctification", new[] { "any", "holy", "unholy" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_type", new[] { "covenant", "deity", "pantheon", "philosophy" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "element_enum", new[] { "air", "earth", "fire", "metal", "universal", "water", "wood" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_rarity", new[] { "common", "rare", "uncommon", "unique" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "domain", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_category", new[] { "ancestry", "ancestry-feature", "archetype", "bonus", "calling", "campaign-feature", "class", "class-feature", "curse", "deityboon", "general", "pfsboon", "skill", "uncategorized" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "locale_type", new[] { "english", "hobby", "other", "russian" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "size_enum", new[] { "huge", "large", "medium", "small", "tiny" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "source_category", new[] { "adventure-path", "adventures", "blog-posts", "comics", "lost-omens", "rulebook", "society" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_area_type", new[] { "burst", "circle", "cone", "cube", "cuboid", "cylinder", "emanation", "line", "other", "square", "varies" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_category", new[] { "normal", "persistent", "splash" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_kinds", new[] { "any", "damage", "healing" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_tradition", new[] { "all", "arcane", "divine", "elemental", "none", "occult", "primal" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "training_rank", new[] { "expert", "legendary", "master", "mythic", "trained", "untrained" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "alignment", "class", "regular", "tradition" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "vision_enum", new[] { "dark-vision", "low-light-vision", "normal" }); + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("DeityTraining", b => + { + b.Property("DeityId") + .HasColumnType("integer") + .HasColumnName("deity_id"); + + b.Property("SkillsId") + .HasColumnType("integer") + .HasColumnName("skills_id"); + + b.HasKey("DeityId", "SkillsId") + .HasName("pk_deity_training"); + + b.HasIndex("SkillsId") + .HasDatabaseName("ix_deity_training_skills_id"); + + b.ToTable("deity_training", (string)null); + }); + + modelBuilder.Entity("EntityKeyword", b => + { + b.Property("EntitiesId") + .HasColumnType("integer") + .HasColumnName("entities_id"); + + b.Property("KeywordsId") + .HasColumnType("integer") + .HasColumnName("keywords_id"); + + b.HasKey("EntitiesId", "KeywordsId") + .HasName("pk_entity_keyword"); + + b.HasIndex("KeywordsId") + .HasDatabaseName("ix_entity_keyword_keywords_id"); + + b.ToTable("entity_keyword", (string)null); + }); + + modelBuilder.Entity("EntityTrait", b => + { + b.Property("EntitiesId") + .HasColumnType("integer") + .HasColumnName("entities_id"); + + b.Property("TraitsId") + .HasColumnType("integer") + .HasColumnName("traits_id"); + + b.HasKey("EntitiesId", "TraitsId") + .HasName("pk_entity_trait"); + + b.HasIndex("TraitsId") + .HasDatabaseName("ix_entity_trait_traits_id"); + + b.ToTable("entity_trait", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Entity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text") + .HasColumnName("description") + .HasColumnOrder(6) + .HasComment("Текстовое описание сущности"); + + b.Property("Img") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("img") + .HasColumnOrder(5) + .HasComment("Изображение объекта"); + + b.Property("IsChecked") + .HasColumnType("boolean") + .HasColumnName("is_checked") + .HasColumnOrder(9) + .HasComment("Проверено?"); + + b.Property("IsLegacy") + .HasColumnType("boolean") + .HasColumnName("is_legacy") + .HasColumnOrder(10) + .HasComment("Устаревшая?"); + + b.Property("IsTranslated") + .HasColumnType("boolean") + .HasColumnName("is_translated") + .HasColumnOrder(8) + .HasComment("Есть перевод?"); + + b.Property("Name") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("name") + .HasColumnOrder(2) + .HasComment("Отображаемое имя"); + + b.Property("Rarity") + .HasColumnType("entity_rarity") + .HasColumnName("rarity") + .HasColumnOrder(7) + .HasComment("Редкость сущности"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("slug") + .HasColumnOrder(4) + .HasComment("Часть имени в URL"); + + b.Property("Type") + .HasColumnType("entity_type") + .HasColumnName("type") + .HasColumnOrder(3) + .HasComment("Тип сущности"); + + b.HasKey("Id") + .HasName("pk_entities"); + + b.ToTable("entities", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.EntityAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EntityId") + .HasColumnType("integer") + .HasColumnName("entity_id") + .HasColumnOrder(2) + .HasComment("Связанная сущность"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name") + .HasColumnOrder(3) + .HasComment("Алиас"); + + b.HasKey("Id") + .HasName("pk_entity_aliases"); + + b.HasIndex("EntityId") + .HasDatabaseName("ix_entity_aliases_entity_id"); + + b.ToTable("entity_aliases", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Keywords.Keyword", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("name") + .HasColumnOrder(2) + .HasComment("Отображаемое имя"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("slug") + .HasColumnOrder(3) + .HasComment("Часть имени в URL"); + + b.HasKey("Id") + .HasName("pk_keywords"); + + b.ToTable("keywords", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Keywords.KeywordAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("KeywordId") + .HasColumnType("integer") + .HasColumnName("keyword_id") + .HasColumnOrder(2) + .HasComment("Идентификатор ключевого слова"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("value") + .HasColumnOrder(3) + .HasComment("Синоним"); + + b.HasKey("Id") + .HasName("pk_keyword_aliases"); + + b.HasIndex("KeywordId") + .HasDatabaseName("ix_keyword_aliases_keyword_id"); + + b.ToTable("keyword_aliases", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.LegacyRemaster", b => + { + b.Property("LegacyId") + .HasColumnType("integer") + .HasColumnName("legacy_id") + .HasColumnOrder(1) + .HasComment("Идентификатор сущности"); + + b.Property("RemasterId") + .HasColumnType("integer") + .HasColumnName("remaster_id") + .HasColumnOrder(2) + .HasComment("Идентификатор цели"); + + b.HasKey("LegacyId", "RemasterId") + .HasName("pk_legacy_remasters"); + + b.HasIndex("RemasterId") + .HasDatabaseName("ix_legacy_remasters_remaster_id"); + + b.ToTable("legacy_remasters", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Source.EntitySource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(0) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EntityId") + .HasColumnType("integer") + .HasColumnName("entity_id") + .HasColumnOrder(1) + .HasComment("Идентификатор сущности"); + + b.Property("IsRemaster") + .HasColumnType("boolean") + .HasColumnName("is_remaster") + .HasColumnOrder(4) + .HasComment("Флаг, указывающий, что объект является частью ремастера"); + + b.Property("SourceId") + .HasColumnType("integer") + .HasColumnName("source_id") + .HasColumnOrder(2) + .HasComment("Идентификатор источника"); + + b.Property("Suffix") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("suffix") + .HasColumnOrder(3) + .HasComment("Номер страницы, эррата и т.д."); + + b.HasKey("Id") + .HasName("pk_entity_sources"); + + b.HasIndex("EntityId") + .HasDatabaseName("ix_entity_sources_entity_id"); + + b.HasIndex("SourceId") + .HasDatabaseName("ix_entity_sources_source_id"); + + b.ToTable("entity_sources", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Source.Source", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Category") + .HasColumnType("source_category") + .HasColumnName("category") + .HasColumnOrder(3) + .HasComment("Категория источника"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name") + .HasColumnOrder(2) + .HasComment("Отображаемое имя"); + + b.Property("ReleaseDate") + .HasColumnType("date") + .HasColumnName("release_date") + .HasColumnOrder(4) + .HasComment("Дата выхода источника"); + + b.HasKey("Id") + .HasName("pk_sources"); + + b.ToTable("sources", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Targets.EntityExternal", b => + { + b.Property("EntityId") + .HasColumnType("integer") + .HasColumnName("entity_id") + .HasColumnOrder(1) + .HasComment("Идентификатор сущности"); + + b.Property("TargetId") + .HasColumnType("integer") + .HasColumnName("target_id") + .HasColumnOrder(2) + .HasComment("Идентификатор цели"); + + b.Property("ExternalId") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("external_id") + .HasColumnOrder(3) + .HasComment("Идентификатор элемента в ссылке"); + + b.Property("Md5") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)") + .HasColumnName("md5") + .HasColumnOrder(5) + .HasComment("Контрольная сумма объекта"); + + b.Property("Suffix") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("suffix") + .HasColumnOrder(4) + .HasComment("Часть URL до объекта. Для источников Foundry - полный UUID объекта"); + + b.HasKey("EntityId", "TargetId") + .HasName("pk_entity_externals"); + + b.HasIndex("TargetId") + .HasDatabaseName("ix_entity_externals_target_id"); + + b.ToTable("entity_externals", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Targets.ExternalTarget", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Icon") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("icon") + .HasColumnOrder(3) + .HasComment("Иконка цели"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("name") + .HasColumnOrder(2) + .HasComment("Отображаемое имя"); + + b.Property("Prefix") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("prefix") + .HasColumnOrder(3) + .HasComment("Префикс для URL-адреса внешней ссылки"); + + b.HasKey("Id") + .HasName("pk_external_targets"); + + b.ToTable("external_targets", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Common.Frequency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Max") + .HasColumnType("integer") + .HasColumnName("max") + .HasColumnOrder(2) + .HasComment("Максимальная продолжительсность"); + + b.Property("Per") + .HasColumnType("integer") + .HasColumnName("per") + .HasColumnOrder(3) + .HasComment("Частота использования"); + + b.Property("Value") + .HasColumnType("integer") + .HasColumnName("value") + .HasColumnOrder(4) + .HasComment("Значение использования"); + + b.HasKey("Id") + .HasName("pk_frequencies"); + + b.ToTable("frequencies", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Common.Training", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("name") + .HasColumnOrder(2) + .HasComment("Название способности"); + + b.Property("Type") + .HasColumnType("integer") + .HasColumnName("type") + .HasColumnOrder(3) + .HasComment("Тип способности"); + + b.HasKey("Id") + .HasName("pk_trainings"); + + b.ToTable("trainings", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Action", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("Actions") + .HasColumnType("action_enum") + .HasColumnName("actions") + .HasColumnOrder(2) + .HasComment("Количество действий"); + + b.Property("Category") + .HasColumnType("action_category") + .HasColumnName("category") + .HasColumnOrder(3) + .HasComment("Категория действия"); + + b.Property("Extra") + .HasColumnType("text") + .HasColumnName("extra") + .HasColumnOrder(4) + .HasComment("Дополнительная информация"); + + b.HasKey("Id") + .HasName("pk_actions"); + + b.ToTable("actions", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Ancestry", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("Hp") + .HasColumnType("integer") + .HasColumnName("hp") + .HasColumnOrder(3) + .HasComment("Количество очков здоровья"); + + b.PrimitiveCollection("Size") + .IsRequired() + .HasColumnType("size_enum[]") + .HasColumnName("size") + .HasColumnOrder(2) + .HasComment("Размеры родословной"); + + b.Property("Speed") + .HasColumnType("integer") + .HasColumnName("speed") + .HasColumnOrder(4) + .HasComment("Скорость передвижения"); + + b.Property("VisionEnum") + .HasColumnType("vision_enum") + .HasColumnName("vision_enum") + .HasColumnOrder(5) + .HasComment("Тип зрения"); + + b.HasKey("Id") + .HasName("pk_ancestries"); + + b.ToTable("ancestries", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.AncestryRelation.AncestryBoost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AncestryId") + .HasColumnType("integer") + .HasColumnName("ancestry_id") + .HasColumnOrder(2) + .HasComment("Идентификатор родословной"); + + b.Property("Boost") + .HasColumnType("boolean") + .HasColumnName("boost") + .HasColumnOrder(3) + .HasComment("Флаг повышения/снижения"); + + b.Property("Value") + .HasColumnType("attribute_values") + .HasColumnName("value") + .HasColumnOrder(4) + .HasComment("Значение атрибута"); + + b.HasKey("Id") + .HasName("pk_ancestry_boosts"); + + b.HasIndex("AncestryId") + .HasDatabaseName("ix_ancestry_boosts_ancestry_id"); + + b.ToTable("ancestry_boosts", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.AncestryRelation.AncestryItem", b => + { + b.Property("AncestryId") + .HasColumnType("integer") + .HasColumnName("ancestry_id") + .HasColumnOrder(1) + .HasComment("Идентификатор родословной"); + + b.Property("ItemId") + .HasColumnType("integer") + .HasColumnName("item_id") + .HasColumnOrder(2) + .HasComment("Идентификатор связанной сущности"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level") + .HasColumnOrder(3) + .HasComment("Уровень сущности в родословной"); + + b.HasKey("AncestryId", "ItemId") + .HasName("pk_ancestry_items"); + + b.HasIndex("ItemId") + .HasDatabaseName("ix_ancestry_items_item_id"); + + b.ToTable("ancestry_items", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.AncestryRelation.AncestryLanguage", b => + { + b.Property("AncestryId") + .HasColumnType("integer") + .HasColumnName("ancestry_id") + .HasColumnOrder(1) + .HasComment("Идентификатор родословной"); + + b.Property("LanguageId") + .HasColumnType("integer") + .HasColumnName("language_id") + .HasColumnOrder(2) + .HasComment("Идентификатор связанного языка"); + + b.Property("IsAdditional") + .HasColumnType("boolean") + .HasColumnName("is_additional") + .HasColumnOrder(3) + .HasComment("Флаг дополнительного"); + + b.HasKey("AncestryId", "LanguageId") + .HasName("pk_ancestry_languages"); + + b.HasIndex("LanguageId") + .HasDatabaseName("ix_ancestry_languages_language_id"); + + b.ToTable("ancestry_languages", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Archetype", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("DedicationFeatId") + .HasColumnType("integer") + .HasColumnName("dedication_feat_id") + .HasColumnOrder(3) + .HasComment("ID посвящения"); + + b.Property("Extra") + .HasColumnType("text") + .HasColumnName("extra") + .HasColumnOrder(4) + .HasComment("Дополнительная информация"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level") + .HasColumnOrder(2) + .HasComment("Уровень"); + + b.HasKey("Id") + .HasName("pk_archetypes"); + + b.HasIndex("DedicationFeatId") + .IsUnique() + .HasDatabaseName("ix_archetypes_dedication_feat_id"); + + b.ToTable("archetypes", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.ArchetypeRelation.ArchetypeFeats", b => + { + b.Property("ArchetypeId") + .HasColumnType("integer") + .HasColumnName("archetype_id") + .HasComment("Идентификатор архетипа"); + + b.Property("FeatId") + .HasColumnType("integer") + .HasColumnName("feat_id") + .HasComment("Идентификатор черты"); + + b.HasKey("ArchetypeId", "FeatId") + .HasName("pk_archetype_feats"); + + b.HasIndex("FeatId") + .HasDatabaseName("ix_archetype_feats_feat_id"); + + b.ToTable("archetype_feats", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Background", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.HasKey("Id") + .HasName("pk_backgrounds"); + + b.ToTable("backgrounds", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.BackgroundRelation.BackgroundBoost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Attribute") + .HasColumnType("attribute_values") + .HasColumnName("attribute") + .HasColumnOrder(3) + .HasComment("Атрибут"); + + b.Property("BackgroundId") + .HasColumnType("integer") + .HasColumnName("background_id") + .HasColumnOrder(2) + .HasComment("Идентификатор предыстории"); + + b.HasKey("Id") + .HasName("pk_background_boosts"); + + b.HasIndex("BackgroundId") + .HasDatabaseName("ix_background_boosts_background_id"); + + b.ToTable("background_boosts", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.BackgroundRelation.BackgroundItem", b => + { + b.Property("BackgroundId") + .HasColumnType("integer") + .HasColumnName("background_id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("EntityId") + .HasColumnType("integer") + .HasColumnName("entity_id") + .HasColumnOrder(2) + .HasComment("Идентификатор сущности"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level") + .HasColumnOrder(3); + + b.HasKey("BackgroundId", "EntityId") + .HasName("pk_background_items"); + + b.HasIndex("EntityId") + .HasDatabaseName("ix_background_items_entity_id"); + + b.ToTable("background_items", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.BackgroundRelation.BackgroundTraining", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("BackgroundId") + .HasColumnType("integer") + .HasColumnName("background_id") + .HasColumnOrder(2) + .HasComment("Идентификатор предыстории"); + + b.Property("Rank") + .HasColumnType("training_rank") + .HasColumnName("rank") + .HasColumnOrder(4) + .HasComment("Ранг тренировки"); + + b.Property("TrainingId") + .HasColumnType("integer") + .HasColumnName("training_id") + .HasColumnOrder(3) + .HasComment("Идентификатор тренируемого навыка"); + + b.HasKey("Id") + .HasName("pk_background_skills"); + + b.HasIndex("BackgroundId") + .HasDatabaseName("ix_background_skills_background_id"); + + b.HasIndex("TrainingId") + .HasDatabaseName("ix_background_skills_training_id"); + + b.ToTable("background_skills", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Class", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("AdditionalTrainedSkills") + .HasColumnType("integer") + .HasColumnName("additional_trained_skills") + .HasColumnOrder(7) + .HasComment("Дополнительные навыки"); + + b.Property("Hp") + .HasColumnType("integer") + .HasColumnName("hp") + .HasColumnOrder(2) + .HasComment("Количество очков здоровья"); + + b.Property("Spellcasting") + .HasColumnType("integer") + .HasColumnName("spellcasting") + .HasColumnOrder(3) + .HasComment("Тип заклинательства"); + + b.Property("Tradition") + .HasColumnType("spell_tradition") + .HasColumnName("tradition") + .HasColumnOrder(6) + .HasComment("Традиция заклинаний"); + + b.HasKey("Id") + .HasName("pk_classes"); + + b.ToTable("classes", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.ClassRelation.ClassKeyAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClassId") + .HasColumnType("integer") + .HasColumnName("class_id") + .HasColumnOrder(2) + .HasComment("Идентификатор класса"); + + b.Property("Value") + .HasColumnType("attribute_values") + .HasColumnName("value") + .HasColumnOrder(3) + .HasComment("Атрибут"); + + b.HasKey("Id") + .HasName("pk_class_key_abilities"); + + b.HasIndex("ClassId") + .HasDatabaseName("ix_class_key_abilities_class_id"); + + b.ToTable("class_key_abilities", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.ClassRelation.ClassProgression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClassId") + .HasColumnType("integer") + .HasColumnName("class_id") + .HasColumnOrder(2) + .HasComment("Идентификатор класса"); + + b.Property("EntityId") + .HasColumnType("integer") + .HasColumnName("entity_id") + .HasColumnOrder(5) + .HasComment("Идентификатор сущности"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level") + .HasColumnOrder(3) + .HasComment("Уровень класса"); + + b.Property("Type") + .HasColumnType("class_progression_type") + .HasColumnName("type") + .HasColumnOrder(4) + .HasComment("Тип элемента прогрессии класса"); + + b.HasKey("Id") + .HasName("pk_class_progressions"); + + b.HasIndex("ClassId") + .HasDatabaseName("ix_class_progressions_class_id"); + + b.HasIndex("EntityId") + .HasDatabaseName("ix_class_progressions_entity_id"); + + b.ToTable("class_progressions", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.ClassRelation.ClassTraining", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClassId") + .HasColumnType("integer") + .HasColumnName("class_id") + .HasColumnOrder(2) + .HasComment("Идентификатор класса"); + + b.Property("Rank") + .HasColumnType("training_rank") + .HasColumnName("rank") + .HasColumnOrder(4) + .HasComment("Ранг тренировки"); + + b.Property("TrainingId") + .HasColumnType("integer") + .HasColumnName("training_id") + .HasColumnOrder(3) + .HasComment("Идентификатор тренируемого навыка"); + + b.HasKey("Id") + .HasName("pk_class_trainings"); + + b.HasIndex("ClassId") + .HasDatabaseName("ix_class_trainings_class_id"); + + b.HasIndex("TrainingId") + .HasDatabaseName("ix_class_trainings_training_id"); + + b.ToTable("class_trainings", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.ClassRelation.SubclassProvidedEntities", b => + { + b.Property("SubclassId") + .HasColumnType("integer") + .HasColumnName("subclass_id"); + + b.Property("EntityId") + .HasColumnType("integer") + .HasColumnName("entity_id"); + + b.HasKey("SubclassId", "EntityId") + .HasName("pk_subclass_provided_entities"); + + b.HasIndex("EntityId") + .HasDatabaseName("ix_subclass_provided_entities_entity_id"); + + b.ToTable("subclass_provided_entities", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.ClassRelation.SubclassTrainings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор связи"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Rank") + .HasColumnType("training_rank") + .HasColumnName("rank") + .HasColumnOrder(4) + .HasComment("Ранг тренировки"); + + b.Property("SubclassId") + .HasColumnType("integer") + .HasColumnName("subclass_id") + .HasColumnOrder(2) + .HasComment("Идентификатор подкласса"); + + b.Property("TrainingId") + .HasColumnType("integer") + .HasColumnName("training_id") + .HasColumnOrder(3) + .HasComment("Идентификатор тренировки"); + + b.HasKey("Id") + .HasName("pk_subclass_trainings"); + + b.HasIndex("SubclassId") + .HasDatabaseName("ix_subclass_trainings_subclass_id"); + + b.HasIndex("TrainingId") + .HasDatabaseName("ix_subclass_trainings_training_id"); + + b.ToTable("subclass_trainings", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Condition", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("Extra") + .HasColumnType("text") + .HasColumnName("extra") + .HasColumnOrder(3) + .HasComment("Дополнительная информация"); + + b.Property("Group") + .HasColumnType("condition_group") + .HasColumnName("group") + .HasColumnOrder(2) + .HasComment("Группа состояния"); + + b.HasKey("Id") + .HasName("pk_conditions"); + + b.ToTable("conditions", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Deity", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("Anathema") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("anathema") + .HasColumnOrder(8) + .HasComment("Анафемы божества"); + + b.Property("AreaOfConcern") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("area_of_concern") + .HasColumnOrder(11) + .HasComment("Область покровительства божества"); + + b.Property("Category") + .IsRequired() + .HasColumnType("text") + .HasColumnName("category") + .HasColumnOrder(3) + .HasComment("Категория божества"); + + b.Property("Edicts") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("edicts") + .HasColumnOrder(7) + .HasComment("Заветы божества"); + + b.Property("Fonts") + .HasColumnType("deity_fonts") + .HasColumnName("fonts") + .HasColumnOrder(4) + .HasComment("Тип божественной силы"); + + b.Property("ReligiousSymbol") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("religious_symbol") + .HasColumnOrder(9) + .HasComment("Религиозный символ божества"); + + b.Property("SacredAnimal") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("sacred_animal") + .HasColumnOrder(10) + .HasComment("Священное животное божества"); + + b.Property("Sanctification") + .HasColumnType("deity_sanctification") + .HasColumnName("sanctification") + .HasColumnOrder(5) + .HasComment("Тип освящения"); + + b.Property("SanctificationMust") + .HasColumnType("boolean") + .HasColumnName("sanctification_must") + .HasColumnOrder(6) + .HasComment("Обязательное освящение"); + + b.Property("Type") + .HasColumnType("deity_type") + .HasColumnName("type") + .HasColumnOrder(2) + .HasComment("Тип божества"); + + b.HasKey("Id") + .HasName("pk_deities"); + + b.ToTable("deities", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeityAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Attribute") + .HasColumnType("attribute_values") + .HasColumnName("attribute") + .HasColumnOrder(3) + .HasComment("Атрибут божества"); + + b.Property("DeityId") + .HasColumnType("integer") + .HasColumnName("deity_id") + .HasColumnOrder(2) + .HasComment("Идентификатор божества"); + + b.HasKey("Id") + .HasName("pk_deity_attributes"); + + b.HasIndex("DeityId") + .HasDatabaseName("ix_deity_attributes_deity_id"); + + b.ToTable("deity_attributes", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeityDomain", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DeityId") + .HasColumnType("integer") + .HasColumnName("deity_id") + .HasColumnOrder(2) + .HasComment("Идентификатор божества"); + + b.Property("DomainId") + .HasColumnType("integer") + .HasColumnName("domain_id") + .HasColumnOrder(4) + .HasComment("Идентификатор домена"); + + b.Property("IsPrimary") + .HasColumnType("boolean") + .HasColumnName("is_primary") + .HasColumnOrder(3) + .HasComment("Флаг основного домена"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("value") + .HasColumnOrder(5); + + b.HasKey("Id") + .HasName("pk_deity_domains"); + + b.HasIndex("DeityId") + .HasDatabaseName("ix_deity_domains_deity_id"); + + b.HasIndex("DomainId") + .HasDatabaseName("ix_deity_domains_domain_id"); + + b.ToTable("deity_domains", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeitySpell", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DeityId") + .HasColumnType("integer") + .HasColumnName("deity_id") + .HasColumnOrder(2) + .HasComment("Идентификатор божества"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level") + .HasColumnOrder(3) + .HasComment("Уровень заклинания"); + + b.Property("SpellId") + .HasColumnType("integer") + .HasColumnName("spell_id") + .HasColumnOrder(4) + .HasComment("Идентификатор заклинания"); + + b.HasKey("Id") + .HasName("pk_deity_spells"); + + b.HasIndex("DeityId") + .HasDatabaseName("ix_deity_spells_deity_id"); + + b.HasIndex("SpellId") + .HasDatabaseName("ix_deity_spells_spell_id"); + + b.ToTable("deity_spells", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeityWeapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DeityId") + .HasColumnType("integer") + .HasColumnName("deity_id") + .HasColumnOrder(2) + .HasComment("Идентификатор божества"); + + b.Property("Weapon") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("weapon") + .HasColumnOrder(3) + .HasComment("Название оружия"); + + b.HasKey("Id") + .HasName("pk_deity_weapons"); + + b.HasIndex("DeityId") + .HasDatabaseName("ix_deity_weapons_deity_id"); + + b.ToTable("deity_weapons", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("AdvancedApocryphalSpellId") + .HasColumnType("integer") + .HasColumnName("advanced_apocryphal_spell_id") + .HasColumnOrder(5) + .HasComment("Продвинутое апокрифическое заклинание домена"); + + b.Property("AdvancedDomainSpellId") + .HasColumnType("integer") + .HasColumnName("advanced_domain_spell_id") + .HasColumnOrder(3) + .HasComment("Продвинутое заклинание домена"); + + b.Property("ApocryphalSpellId") + .HasColumnType("integer") + .HasColumnName("apocryphal_spell_id") + .HasColumnOrder(4) + .HasComment("Апокрифическое заклинание домена"); + + b.Property("DomainSpellId") + .HasColumnType("integer") + .HasColumnName("domain_spell_id") + .HasColumnOrder(2) + .HasComment("Заклинание домена"); + + b.HasKey("Id") + .HasName("pk_domains"); + + b.HasIndex("AdvancedApocryphalSpellId") + .HasDatabaseName("ix_domains_advanced_apocryphal_spell_id"); + + b.HasIndex("AdvancedDomainSpellId") + .HasDatabaseName("ix_domains_advanced_domain_spell_id"); + + b.HasIndex("ApocryphalSpellId") + .HasDatabaseName("ix_domains_apocryphal_spell_id"); + + b.HasIndex("DomainSpellId") + .HasDatabaseName("ix_domains_domain_spell_id"); + + b.ToTable("domains", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("Actions") + .HasColumnType("action_enum") + .HasColumnName("actions") + .HasColumnOrder(5) + .HasComment("Количество действий"); + + b.Property("Category") + .HasColumnType("feat_category") + .HasColumnName("category") + .HasColumnOrder(3) + .HasComment("Категория способности"); + + b.Property("Extra") + .HasColumnType("text") + .HasColumnName("extra") + .HasColumnOrder(6) + .HasComment("Дополнительная информация"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level") + .HasColumnOrder(4) + .HasComment("Уровень способности"); + + b.HasKey("Id") + .HasName("pk_feats"); + + b.ToTable("feats", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.FeatRelation.FeatPrerequisite", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("FeatId") + .HasColumnType("integer") + .HasColumnName("feat_id") + .HasColumnOrder(2) + .HasComment("Идентификатор черты"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("value") + .HasColumnOrder(3) + .HasComment("Предварительное требование"); + + b.HasKey("Id") + .HasName("pk_feat_prerequisites"); + + b.HasIndex("FeatId") + .HasDatabaseName("ix_feat_prerequisites_feat_id"); + + b.ToTable("feat_prerequisites", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Heritage", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("AncestryId") + .HasColumnType("integer") + .HasColumnName("ancestry_id") + .HasColumnOrder(2) + .HasComment("Идентификатор родословной"); + + b.HasKey("Id") + .HasName("pk_heritages"); + + b.HasIndex("AncestryId") + .HasDatabaseName("ix_heritages_ancestry_id"); + + b.ToTable("heritages", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Language", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("EntityId") + .HasColumnType("integer") + .HasColumnName("entity_id"); + + b.HasKey("Id") + .HasName("pk_languages"); + + b.HasIndex("EntityId") + .HasDatabaseName("ix_languages_entity_id"); + + b.ToTable("languages", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Ritual", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("CastTime") + .HasColumnType("integer") + .HasColumnName("cast_time") + .HasColumnOrder(3) + .HasComment("Продолжительность ритуала в секундах"); + + b.Property("Cost") + .HasColumnType("jsonb") + .HasColumnName("cost") + .HasColumnOrder(14) + .HasComment("Стоимость ритуала"); + + b.Property("Duration") + .HasColumnType("integer") + .HasColumnName("duration") + .HasColumnOrder(4) + .HasComment("Время действия эффекта ритуала в секундах"); + + b.PrimitiveCollection("Elements") + .IsRequired() + .HasColumnType("element_enum[]") + .HasColumnName("elements") + .HasColumnOrder(5) + .HasComment("Элементы ритуала"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level") + .HasColumnOrder(2) + .HasComment("Уровень ритуала"); + + b.Property("PrimaryCheckRank") + .HasColumnType("training_rank") + .HasColumnName("primary_check_rank") + .HasColumnOrder(7) + .HasComment("Ранг основной проверки"); + + b.Property("PrimaryCheckSuffix") + .HasColumnType("jsonb") + .HasColumnName("primary_check_suffix") + .HasColumnOrder(8) + .HasComment("Дополнительная информация об основной проверки"); + + b.Property("Range") + .HasColumnType("integer") + .HasColumnName("range") + .HasColumnOrder(6) + .HasComment("Дальнность ритуала"); + + b.Property("RangeString") + .HasColumnType("jsonb") + .HasColumnName("range_string") + .HasColumnOrder(12) + .HasComment("Дальность ритуала"); + + b.Property("Requirement") + .HasColumnType("jsonb") + .HasColumnName("requirement") + .HasColumnOrder(15) + .HasComment("Требования к ритуалу"); + + b.Property("SecondaryCasters") + .HasColumnType("integer") + .HasColumnName("secondary_casters") + .HasColumnOrder(9) + .HasComment("Количество дополнительных заклинателей"); + + b.Property("SecondaryCastersMax") + .HasColumnType("integer") + .HasColumnName("secondary_casters_max") + .HasColumnOrder(10) + .HasComment("Максимальное количество дополнительных заклинателей"); + + b.Property("SecondaryCastersSuffix") + .HasColumnType("jsonb") + .HasColumnName("secondary_casters_suffix") + .HasColumnOrder(11) + .HasComment("Дополнительная информация о дополнительных заклинателях"); + + b.Property("Target") + .HasColumnType("jsonb") + .HasColumnName("target") + .HasColumnOrder(13) + .HasComment("Цель ритуала"); + + b.HasKey("Id") + .HasName("pk_rituals"); + + b.ToTable("rituals", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.RitualRelation.RitualArea", b => + { + b.Property("RitualId") + .HasColumnType("integer") + .HasColumnName("ritual_id") + .HasColumnOrder(1) + .HasComment("Идентификатор ритуала"); + + b.Property("Details") + .HasMaxLength(255) + .HasColumnType("jsonb") + .HasColumnName("details") + .HasColumnOrder(2) + .HasComment("Описание области действия ритуала"); + + b.Property("Type") + .HasColumnType("spell_area_type") + .HasColumnName("type") + .HasColumnOrder(3) + .HasComment("Тип области действия ритуала"); + + b.HasKey("RitualId") + .HasName("pk_ritual_areas"); + + b.ToTable("ritual_areas", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.RitualRelation.RitualCheck", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IsPrimary") + .HasColumnType("boolean") + .HasColumnName("is_primary") + .HasColumnOrder(6) + .HasComment("Флаг основной проверки"); + + b.Property("Rank") + .HasColumnType("training_rank") + .HasColumnName("rank") + .HasColumnOrder(5) + .HasComment("Ранг тренировки"); + + b.Property("RitualId") + .HasColumnType("integer") + .HasColumnName("ritual_id") + .HasColumnOrder(2) + .HasComment("Идентификатор ритуала"); + + b.Property("TrainingId") + .HasColumnType("integer") + .HasColumnName("training_id") + .HasColumnOrder(3) + .HasComment("Идентификатор тренировки"); + + b.Property("TrainingString") + .HasColumnType("jsonb") + .HasColumnName("training_string") + .HasColumnOrder(4) + .HasComment("Дополнение к проверке"); + + b.HasKey("Id") + .HasName("pk_ritual_checks"); + + b.HasIndex("RitualId") + .HasDatabaseName("ix_ritual_checks_ritual_id"); + + b.HasIndex("TrainingId") + .HasDatabaseName("ix_ritual_checks_training_id"); + + b.ToTable("ritual_checks", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Rule", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.PrimitiveCollection("Breadcrumbs") + .IsRequired() + .HasColumnType("text[]") + .HasColumnName("breadcrumbs"); + + b.Property("Order") + .HasColumnType("integer") + .HasColumnName("order") + .HasColumnOrder(2) + .HasComment("Порядок отображения"); + + b.Property("ParentId") + .HasColumnType("integer") + .HasColumnName("parent_id") + .HasColumnOrder(3) + .HasComment("Родительского правило"); + + b.HasKey("Id") + .HasName("pk_rules"); + + b.HasIndex("ParentId") + .HasDatabaseName("ix_rules_parent_id"); + + b.ToTable("rules", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Spell", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("Actions") + .HasColumnType("action_enum") + .HasColumnName("actions") + .HasColumnOrder(4) + .HasComment("Количество действий"); + + b.Property("Cost") + .HasColumnType("jsonb") + .HasColumnName("cost") + .HasColumnOrder(11) + .HasComment("Стоимость заклинания"); + + b.Property("Duration") + .HasMaxLength(255) + .HasColumnType("integer") + .HasColumnName("duration") + .HasColumnOrder(5) + .HasComment("Время длительности заклинания"); + + b.PrimitiveCollection("Elements") + .IsRequired() + .HasColumnType("element_enum[]") + .HasColumnName("elements") + .HasColumnOrder(8) + .HasComment("Элементы заклинания"); + + b.Property("IsFocus") + .HasColumnType("boolean") + .HasColumnName("is_focus") + .HasColumnOrder(3) + .HasComment("Фокус?"); + + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level") + .HasColumnOrder(2); + + b.Property("Range") + .HasColumnType("integer") + .HasColumnName("range") + .HasColumnOrder(6) + .HasComment("Дальность заклинания"); + + b.Property("Requirement") + .HasColumnType("jsonb") + .HasColumnName("requirement") + .HasColumnOrder(12) + .HasComment("Требования к заклинанию"); + + b.Property("Target") + .HasColumnType("jsonb") + .HasColumnName("target") + .HasColumnOrder(10) + .HasComment("Цель заклинания"); + + b.PrimitiveCollection("Traditions") + .IsRequired() + .HasColumnType("spell_tradition[]") + .HasColumnName("traditions") + .HasColumnOrder(7) + .HasComment("Традиции заклинания"); + + b.Property("Trigger") + .HasColumnType("jsonb") + .HasColumnName("trigger") + .HasColumnOrder(9) + .HasComment("Триггер заклинания"); + + b.HasKey("Id") + .HasName("pk_spells"); + + b.ToTable("spells", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.SpellRelation.SpellArea", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Details") + .HasMaxLength(255) + .HasColumnType("jsonb") + .HasColumnName("details") + .HasColumnOrder(3) + .HasComment("Описание области заклинания"); + + b.Property("SpellId") + .HasColumnType("integer") + .HasColumnName("spell_id") + .HasColumnOrder(2) + .HasComment("Идентификатор заклинания"); + + b.Property("Type") + .HasColumnType("spell_area_type") + .HasColumnName("type") + .HasColumnOrder(4) + .HasComment("Тип области заклинания"); + + b.HasKey("Id") + .HasName("pk_spell_areas"); + + b.HasIndex("SpellId") + .HasDatabaseName("ix_spell_areas_spell_id"); + + b.ToTable("spell_areas", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.SpellRelation.SpellDamage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор урона заклинания"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ApplyMod") + .HasColumnType("boolean") + .HasColumnName("apply_mod") + .HasColumnOrder(4) + .HasComment("Применяется модификатор?"); + + b.Property("Category") + .HasColumnType("spell_damage_category") + .HasColumnName("category") + .HasColumnOrder(5) + .HasComment("Категория урона заклинания"); + + b.Property("Formula") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("formula") + .HasColumnOrder(6) + .HasComment("Формула урона заклинания"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("key") + .HasColumnOrder(3) + .HasComment("Уровень заклинания"); + + b.Property("Kinds") + .HasColumnType("spell_damage_kinds") + .HasColumnName("kinds") + .HasColumnOrder(7) + .HasComment("Тип урона заклинания"); + + b.Property("Materials") + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("materials") + .HasColumnOrder(8) + .HasComment("Материалы для заклинания"); + + b.Property("SpellId") + .HasColumnType("integer") + .HasColumnName("spell_id") + .HasColumnOrder(2) + .HasComment("Идентификатор заклинания"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("type") + .HasColumnOrder(9) + .HasComment("Тип урона заклинания"); + + b.HasKey("Id") + .HasName("pk_spell_damages"); + + b.HasIndex("SpellId") + .HasDatabaseName("ix_spell_damages_spell_id"); + + b.ToTable("spell_damages", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.SpellRelation.SpellDefense", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IsBasic") + .HasColumnType("boolean") + .HasColumnName("is_basic") + .HasColumnOrder(4) + .HasComment("Базовый спасборосок?"); + + b.Property("IsPassive") + .HasColumnType("boolean") + .HasColumnName("is_passive") + .HasColumnOrder(3); + + b.Property("SpellId") + .HasColumnType("integer") + .HasColumnName("spell_id") + .HasColumnOrder(2) + .HasComment("Идентификатор заклинания"); + + b.Property("Statistic") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)") + .HasColumnName("statistic") + .HasColumnOrder(5); + + b.HasKey("Id") + .HasName("pk_spell_defenses"); + + b.HasIndex("SpellId") + .HasDatabaseName("ix_spell_defenses_spell_id"); + + b.ToTable("spell_defenses", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Subclass", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("Additional") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("additional") + .HasColumnOrder(3) + .HasComment("Дополнительная информация"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("text") + .HasColumnName("extra") + .HasColumnOrder(4); + + b.Property("GroupId") + .HasColumnType("integer") + .HasColumnName("group_id") + .HasColumnOrder(2) + .HasComment("Группа подклассов"); + + b.HasKey("Id") + .HasName("pk_subclasses"); + + b.HasIndex("GroupId") + .HasDatabaseName("ix_subclasses_group_id"); + + b.ToTable("subclasses", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.SubclassGroup", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("ClassId") + .HasColumnType("integer") + .HasColumnName("class_id") + .HasColumnOrder(2) + .HasComment("Идентификатор класса"); + + b.HasKey("Id") + .HasName("pk_subclass_groups"); + + b.HasIndex("ClassId") + .HasDatabaseName("ix_subclass_groups_class_id"); + + b.ToTable("subclass_groups", (string)null); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Trait", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("Type") + .HasColumnType("trait_type") + .HasColumnName("type") + .HasColumnOrder(2) + .HasComment("Тип признака"); + + b.HasKey("Id") + .HasName("pk_traits"); + + b.ToTable("traits", (string)null); + }); + + modelBuilder.Entity("DeityTraining", b => + { + b.HasOne("Pf2eModel.Model.Structure.Deity", null) + .WithMany() + .HasForeignKey("DeityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deity_training_deities_deity_id"); + + b.HasOne("Pf2eModel.Model.Common.Training", null) + .WithMany() + .HasForeignKey("SkillsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deity_training_trainings_skills_id"); + }); + + modelBuilder.Entity("EntityKeyword", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", null) + .WithMany() + .HasForeignKey("EntitiesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_entity_keyword_entities_entities_id"); + + b.HasOne("Pf2eModel.Model.Base.Keywords.Keyword", null) + .WithMany() + .HasForeignKey("KeywordsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_entity_keyword_keywords_keywords_id"); + }); + + modelBuilder.Entity("EntityTrait", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", null) + .WithMany() + .HasForeignKey("EntitiesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_entity_trait_entities_entities_id"); + + b.HasOne("Pf2eModel.Model.Structure.Trait", null) + .WithMany() + .HasForeignKey("TraitsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_entity_trait_traits_traits_id"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.EntityAlias", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithMany("Aliases") + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_entity_aliases_entities_entity_id"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Keywords.KeywordAlias", b => + { + b.HasOne("Pf2eModel.Model.Base.Keywords.Keyword", "Keyword") + .WithMany("Aliases") + .HasForeignKey("KeywordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_keyword_aliases_keywords_keyword_id"); + + b.Navigation("Keyword"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.LegacyRemaster", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "LegacyEntity") + .WithMany("LegacyTransferEntities") + .HasForeignKey("LegacyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_legacy_remasters_entities_legacy_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "RemasterEntity") + .WithMany("RemasterTransferEntities") + .HasForeignKey("RemasterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_legacy_remasters_entities_remaster_id"); + + b.Navigation("LegacyEntity"); + + b.Navigation("RemasterEntity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Source.EntitySource", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithMany("Sources") + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_entity_sources_entities_entity_id"); + + b.HasOne("Pf2eModel.Model.Base.Source.Source", "Source") + .WithMany("EntitySources") + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_entity_sources_sources_source_id"); + + b.Navigation("Entity"); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Targets.EntityExternal", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithMany("Externals") + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_entity_externals_entities_entity_id"); + + b.HasOne("Pf2eModel.Model.Base.Targets.ExternalTarget", "Target") + .WithMany("EntityExternals") + .HasForeignKey("TargetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_entity_externals_external_targets_target_id"); + + b.Navigation("Entity"); + + b.Navigation("Target"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Action", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Action", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_actions_entities_id"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Ancestry", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Ancestry", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ancestries_entities_id"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.AncestryRelation.AncestryBoost", b => + { + b.HasOne("Pf2eModel.Model.Structure.Ancestry", "Ancestry") + .WithMany("AncestryBoosts") + .HasForeignKey("AncestryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ancestry_boosts_ancestries_ancestry_id"); + + b.Navigation("Ancestry"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.AncestryRelation.AncestryItem", b => + { + b.HasOne("Pf2eModel.Model.Structure.Ancestry", "Ancestry") + .WithMany("AncestryItems") + .HasForeignKey("AncestryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ancestry_items_ancestries_ancestry_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "Item") + .WithMany() + .HasForeignKey("ItemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ancestry_items_entities_item_id"); + + b.Navigation("Ancestry"); + + b.Navigation("Item"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.AncestryRelation.AncestryLanguage", b => + { + b.HasOne("Pf2eModel.Model.Structure.Ancestry", "Ancestry") + .WithMany("AncestryLanguages") + .HasForeignKey("AncestryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ancestry_languages_ancestries_ancestry_id"); + + b.HasOne("Pf2eModel.Model.Structure.Language", "Language") + .WithMany() + .HasForeignKey("LanguageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ancestry_languages_languages_language_id"); + + b.Navigation("Ancestry"); + + b.Navigation("Language"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Archetype", b => + { + b.HasOne("Pf2eModel.Model.Structure.Feat", "DedicationFeat") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Archetype", "DedicationFeatId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_archetypes_feats_dedication_feat_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Archetype", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_archetypes_entities_id"); + + b.Navigation("DedicationFeat"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.ArchetypeRelation.ArchetypeFeats", b => + { + b.HasOne("Pf2eModel.Model.Structure.Archetype", null) + .WithMany() + .HasForeignKey("ArchetypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_archetype_feats_archetypes_archetype_id"); + + b.HasOne("Pf2eModel.Model.Structure.Feat", null) + .WithMany() + .HasForeignKey("FeatId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_archetype_feats_feats_feat_id"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Background", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Background", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_backgrounds_entities_id"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.BackgroundRelation.BackgroundBoost", b => + { + b.HasOne("Pf2eModel.Model.Structure.Background", "Background") + .WithMany("BackgroundBoosts") + .HasForeignKey("BackgroundId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_background_boosts_backgrounds_background_id"); + + b.Navigation("Background"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.BackgroundRelation.BackgroundItem", b => + { + b.HasOne("Pf2eModel.Model.Structure.Background", "Background") + .WithMany("BackgroundItems") + .HasForeignKey("BackgroundId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_background_items_backgrounds_background_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithMany() + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_background_items_entities_entity_id"); + + b.Navigation("Background"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.BackgroundRelation.BackgroundTraining", b => + { + b.HasOne("Pf2eModel.Model.Structure.Background", "Background") + .WithMany("BackgroundSkills") + .HasForeignKey("BackgroundId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_background_skills_backgrounds_background_id"); + + b.HasOne("Pf2eModel.Model.Common.Training", "Training") + .WithMany() + .HasForeignKey("TrainingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_background_skills_trainings_training_id"); + + b.Navigation("Background"); + + b.Navigation("Training"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Class", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Class", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_classes_entities_id"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.ClassRelation.ClassKeyAttribute", b => + { + b.HasOne("Pf2eModel.Model.Structure.Class", "Class") + .WithMany("ClassKeyAbilities") + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_class_key_abilities_classes_class_id"); + + b.Navigation("Class"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.ClassRelation.ClassProgression", b => + { + b.HasOne("Pf2eModel.Model.Structure.Class", "Class") + .WithMany("ClassProgressions") + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_class_progressions_classes_class_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithMany() + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_class_progressions_entities_entity_id"); + + b.Navigation("Class"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.ClassRelation.ClassTraining", b => + { + b.HasOne("Pf2eModel.Model.Structure.Class", "Class") + .WithMany("ClassTrainings") + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_class_trainings_classes_class_id"); + + b.HasOne("Pf2eModel.Model.Common.Training", "Training") + .WithMany() + .HasForeignKey("TrainingId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_class_trainings_trainings_training_id"); + + b.Navigation("Class"); + + b.Navigation("Training"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.ClassRelation.SubclassProvidedEntities", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", null) + .WithMany() + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_subclass_provided_entities_entities_entity_id"); + + b.HasOne("Pf2eModel.Model.Structure.Subclass", null) + .WithMany() + .HasForeignKey("SubclassId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_subclass_provided_entities_subclasses_subclass_id"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.ClassRelation.SubclassTrainings", b => + { + b.HasOne("Pf2eModel.Model.Structure.Subclass", "Subclass") + .WithMany("Trainings") + .HasForeignKey("SubclassId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_subclass_trainings_subclasses_subclass_id"); + + b.HasOne("Pf2eModel.Model.Common.Training", "Training") + .WithMany() + .HasForeignKey("TrainingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_subclass_trainings_trainings_training_id"); + + b.Navigation("Subclass"); + + b.Navigation("Training"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Condition", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Condition", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_conditions_entities_id"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Deity", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Deity", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deities_entities_id"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeityAttribute", b => + { + b.HasOne("Pf2eModel.Model.Structure.Deity", "Deity") + .WithMany("DeityAttributes") + .HasForeignKey("DeityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deity_attributes_deities_deity_id"); + + b.Navigation("Deity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeityDomain", b => + { + b.HasOne("Pf2eModel.Model.Structure.Deity", "Deity") + .WithMany("DeityDomains") + .HasForeignKey("DeityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deity_domains_deities_deity_id"); + + b.HasOne("Pf2eModel.Model.Structure.Domain", "Domain") + .WithMany("DeityDomains") + .HasForeignKey("DomainId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deity_domains_domains_domain_id"); + + b.Navigation("Deity"); + + b.Navigation("Domain"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeitySpell", b => + { + b.HasOne("Pf2eModel.Model.Structure.Deity", "Deity") + .WithMany("DeitySpells") + .HasForeignKey("DeityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deity_spells_deities_deity_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "Spell") + .WithMany() + .HasForeignKey("SpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deity_spells_spells_spell_id"); + + b.Navigation("Deity"); + + b.Navigation("Spell"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeityWeapon", b => + { + b.HasOne("Pf2eModel.Model.Structure.Deity", "Deity") + .WithMany("DeityWeapons") + .HasForeignKey("DeityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deity_weapons_deities_deity_id"); + + b.Navigation("Deity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.HasOne("Pf2eModel.Model.Structure.Spell", "AdvancedApocryphalSpell") + .WithMany() + .HasForeignKey("AdvancedApocryphalSpellId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_domains_spells_advanced_apocryphal_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "AdvancedDomainSpell") + .WithMany() + .HasForeignKey("AdvancedDomainSpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_spells_advanced_domain_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "ApocryphalSpell") + .WithMany() + .HasForeignKey("ApocryphalSpellId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_domains_spells_apocryphal_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "DomainSpell") + .WithMany() + .HasForeignKey("DomainSpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_spells_domain_spell_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Domain", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_entities_id"); + + b.Navigation("AdvancedApocryphalSpell"); + + b.Navigation("AdvancedDomainSpell"); + + b.Navigation("ApocryphalSpell"); + + b.Navigation("DomainSpell"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Feat", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feats_entities_id"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.FeatRelation.FeatPrerequisite", b => + { + b.HasOne("Pf2eModel.Model.Structure.Feat", "Feat") + .WithMany("FeatPrerequisites") + .HasForeignKey("FeatId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feat_prerequisites_feats_feat_id"); + + b.Navigation("Feat"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Heritage", b => + { + b.HasOne("Pf2eModel.Model.Structure.Ancestry", "Ancestry") + .WithMany("Heritages") + .HasForeignKey("AncestryId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_heritages_ancestries_ancestry_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Heritage", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_heritages_entities_id"); + + b.Navigation("Ancestry"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Language", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithMany() + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_languages_entities_entity_id"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Ritual", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Ritual", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_rituals_entities_id"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.RitualRelation.RitualArea", b => + { + b.HasOne("Pf2eModel.Model.Structure.Ritual", "Ritual") + .WithOne("Area") + .HasForeignKey("Pf2eModel.Model.Structure.RitualRelation.RitualArea", "RitualId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ritual_areas_rituals_ritual_id"); + + b.Navigation("Ritual"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.RitualRelation.RitualCheck", b => + { + b.HasOne("Pf2eModel.Model.Structure.Ritual", "Ritual") + .WithMany("Checks") + .HasForeignKey("RitualId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ritual_checks_rituals_ritual_id"); + + b.HasOne("Pf2eModel.Model.Common.Training", "Training") + .WithMany() + .HasForeignKey("TrainingId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_ritual_checks_trainings_training_id"); + + b.Navigation("Ritual"); + + b.Navigation("Training"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Rule", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Rule", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_rules_entities_id"); + + b.HasOne("Pf2eModel.Model.Structure.Rule", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .HasConstraintName("fk_rules_rules_parent_id"); + + b.Navigation("Entity"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Spell", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Spell", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_spells_entities_id"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.SpellRelation.SpellArea", b => + { + b.HasOne("Pf2eModel.Model.Structure.Spell", "Spell") + .WithMany("SpellAreas") + .HasForeignKey("SpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_spell_areas_spells_spell_id"); + + b.Navigation("Spell"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.SpellRelation.SpellDamage", b => + { + b.HasOne("Pf2eModel.Model.Structure.Spell", "Spell") + .WithMany() + .HasForeignKey("SpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_spell_damages_spells_spell_id"); + + b.Navigation("Spell"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.SpellRelation.SpellDefense", b => + { + b.HasOne("Pf2eModel.Model.Structure.Spell", "Spell") + .WithMany("SpellDefenses") + .HasForeignKey("SpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_spell_defenses_spells_spell_id"); + + b.Navigation("Spell"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Subclass", b => + { + b.HasOne("Pf2eModel.Model.Structure.SubclassGroup", "Group") + .WithMany("Subclasses") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_subclasses_subclass_groups_group_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Subclass", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_subclasses_entities_id"); + + b.Navigation("Entity"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.SubclassGroup", b => + { + b.HasOne("Pf2eModel.Model.Structure.Class", "Class") + .WithMany("SubclassGroups") + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_subclass_groups_classes_class_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.SubclassGroup", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_subclass_groups_entities_id"); + + b.Navigation("Class"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Trait", b => + { + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Trait", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_traits_entities_id"); + + b.Navigation("Entity"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Entity", b => + { + b.Navigation("Aliases"); + + b.Navigation("Externals"); + + b.Navigation("LegacyTransferEntities"); + + b.Navigation("RemasterTransferEntities"); + + b.Navigation("Sources"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Keywords.Keyword", b => + { + b.Navigation("Aliases"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Source.Source", b => + { + b.Navigation("EntitySources"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Base.Targets.ExternalTarget", b => + { + b.Navigation("EntityExternals"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Ancestry", b => + { + b.Navigation("AncestryBoosts"); + + b.Navigation("AncestryItems"); + + b.Navigation("AncestryLanguages"); + + b.Navigation("Heritages"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Background", b => + { + b.Navigation("BackgroundBoosts"); + + b.Navigation("BackgroundItems"); + + b.Navigation("BackgroundSkills"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Class", b => + { + b.Navigation("ClassKeyAbilities"); + + b.Navigation("ClassProgressions"); + + b.Navigation("ClassTrainings"); + + b.Navigation("SubclassGroups"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Deity", b => + { + b.Navigation("DeityAttributes"); + + b.Navigation("DeityDomains"); + + b.Navigation("DeitySpells"); + + b.Navigation("DeityWeapons"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.Navigation("DeityDomains"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => + { + b.Navigation("FeatPrerequisites"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Ritual", b => + { + b.Navigation("Area"); + + b.Navigation("Checks"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Rule", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Spell", b => + { + b.Navigation("SpellAreas"); + + b.Navigation("SpellDefenses"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.Subclass", b => + { + b.Navigation("Trainings"); + }); + + modelBuilder.Entity("Pf2eModel.Model.Structure.SubclassGroup", b => + { + b.Navigation("Subclasses"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Pf2eModel/Migrations/20250914093120_1.cs b/Pf2eModel/Migrations/20250914093120_1.cs new file mode 100644 index 0000000..face626 --- /dev/null +++ b/Pf2eModel/Migrations/20250914093120_1.cs @@ -0,0 +1,1660 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Pf2eModel.Model.Enum; + +#nullable disable + +namespace Pf2eModel.Migrations +{ + /// + public partial class _1 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("Npgsql:Enum:action_category", "archetype,army_tactic,army_war_action,class-feat,class-feature,familiar,kingdom_activity,kingdom_feat,kingdom_feature,skill-action,unknown") + .Annotation("Npgsql:Enum:action_enum", "1,1 hour,1 minute,1-2,1-3,10 minutes,2,2-3,2/2 rounds,3,30 minutes,5 minutes,free,free/1,other,passive,reaction,reaction/1,reaction/2,reaction/3,unknown") + .Annotation("Npgsql:Enum:attribute_values", "cha,con,dex,free,int,str,wis") + .Annotation("Npgsql:Enum:class_progression_type", "ancestry_feat,attribute_increase,class_feat,entity,general_feat,skill_feat,skill_increase") + .Annotation("Npgsql:Enum:condition_group", "abilities,attitudes,death,detection,senses,unknown") + .Annotation("Npgsql:Enum:deity_fonts", "any,harm,heal,none") + .Annotation("Npgsql:Enum:deity_sanctification", "any,holy,unholy") + .Annotation("Npgsql:Enum:deity_type", "covenant,deity,pantheon,philosophy") + .Annotation("Npgsql:Enum:element_enum", "air,earth,fire,metal,universal,water,wood") + .Annotation("Npgsql:Enum:entity_rarity", "common,rare,uncommon,unique") + .Annotation("Npgsql:Enum:entity_type", "action,ancestry,archetype,background,backpack,campaign_feature,class,condition,deity,domain,feat,heritage,language,ritual,rule,spell,subclass,subclass_group,trait,unknown") + .Annotation("Npgsql:Enum:feat_category", "ancestry,ancestry-feature,archetype,bonus,calling,campaign-feature,class,class-feature,curse,deityboon,general,pfsboon,skill,uncategorized") + .Annotation("Npgsql:Enum:locale_type", "english,hobby,other,russian") + .Annotation("Npgsql:Enum:size_enum", "huge,large,medium,small,tiny") + .Annotation("Npgsql:Enum:source_category", "adventure-path,adventures,blog-posts,comics,lost-omens,rulebook,society") + .Annotation("Npgsql:Enum:spell_area_type", "burst,circle,cone,cube,cuboid,cylinder,emanation,line,other,square,varies") + .Annotation("Npgsql:Enum:spell_damage_category", "normal,persistent,splash") + .Annotation("Npgsql:Enum:spell_damage_kinds", "any,damage,healing") + .Annotation("Npgsql:Enum:spell_tradition", "all,arcane,divine,elemental,none,occult,primal") + .Annotation("Npgsql:Enum:training_rank", "expert,legendary,master,mythic,trained,untrained") + .Annotation("Npgsql:Enum:trait_type", "alignment,class,regular,tradition") + .Annotation("Npgsql:Enum:vision_enum", "dark-vision,low-light-vision,normal"); + + migrationBuilder.CreateTable( + name: "entities", + columns: table => new + { + id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + name = table.Column(type: "jsonb", nullable: false, comment: "Отображаемое имя"), + type = table.Column(type: "entity_type", nullable: false, comment: "Тип сущности"), + slug = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Часть имени в URL"), + img = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Изображение объекта"), + description = table.Column(type: "text", nullable: false, comment: "Текстовое описание сущности"), + rarity = table.Column(type: "entity_rarity", nullable: false, comment: "Редкость сущности"), + is_translated = table.Column(type: "boolean", nullable: true, comment: "Есть перевод?"), + is_checked = table.Column(type: "boolean", nullable: true, comment: "Проверено?"), + is_legacy = table.Column(type: "boolean", nullable: true, comment: "Устаревшая?") + }, + constraints: table => + { + table.PrimaryKey("pk_entities", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "external_targets", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + name = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Отображаемое имя"), + icon = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Иконка цели"), + prefix = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Префикс для URL-адреса внешней ссылки") + }, + constraints: table => + { + table.PrimaryKey("pk_external_targets", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "frequencies", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + max = table.Column(type: "integer", nullable: false, comment: "Максимальная продолжительсность"), + per = table.Column(type: "integer", nullable: false, comment: "Частота использования"), + value = table.Column(type: "integer", nullable: true, comment: "Значение использования") + }, + constraints: table => + { + table.PrimaryKey("pk_frequencies", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "keywords", + columns: table => new + { + id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + name = table.Column(type: "jsonb", nullable: false, comment: "Отображаемое имя"), + slug = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Часть имени в URL") + }, + constraints: table => + { + table.PrimaryKey("pk_keywords", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "sources", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + name = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Отображаемое имя"), + category = table.Column(type: "source_category", nullable: false, comment: "Категория источника"), + release_date = table.Column(type: "date", nullable: true, comment: "Дата выхода источника") + }, + constraints: table => + { + table.PrimaryKey("pk_sources", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "trainings", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + name = table.Column(type: "jsonb", nullable: false, comment: "Название способности"), + type = table.Column(type: "integer", nullable: false, comment: "Тип способности") + }, + constraints: table => + { + table.PrimaryKey("pk_trainings", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "actions", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + actions = table.Column(type: "action_enum", nullable: false, comment: "Количество действий"), + category = table.Column(type: "action_category", nullable: false, comment: "Категория действия"), + extra = table.Column(type: "text", nullable: true, comment: "Дополнительная информация") + }, + constraints: table => + { + table.PrimaryKey("pk_actions", x => x.id); + table.ForeignKey( + name: "fk_actions_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ancestries", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + size = table.Column(type: "size_enum[]", nullable: false, comment: "Размеры родословной"), + hp = table.Column(type: "integer", nullable: false, comment: "Количество очков здоровья"), + speed = table.Column(type: "integer", nullable: false, comment: "Скорость передвижения"), + vision_enum = table.Column(type: "vision_enum", nullable: false, comment: "Тип зрения") + }, + constraints: table => + { + table.PrimaryKey("pk_ancestries", x => x.id); + table.ForeignKey( + name: "fk_ancestries_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "backgrounds", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + }, + constraints: table => + { + table.PrimaryKey("pk_backgrounds", x => x.id); + table.ForeignKey( + name: "fk_backgrounds_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "classes", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + hp = table.Column(type: "integer", nullable: false, comment: "Количество очков здоровья"), + spellcasting = table.Column(type: "integer", nullable: false, comment: "Тип заклинательства"), + tradition = table.Column(type: "spell_tradition", nullable: true, comment: "Традиция заклинаний"), + additional_trained_skills = table.Column(type: "integer", nullable: false, comment: "Дополнительные навыки") + }, + constraints: table => + { + table.PrimaryKey("pk_classes", x => x.id); + table.ForeignKey( + name: "fk_classes_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "conditions", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + group = table.Column(type: "condition_group", nullable: true, comment: "Группа состояния"), + extra = table.Column(type: "text", nullable: true, comment: "Дополнительная информация") + }, + constraints: table => + { + table.PrimaryKey("pk_conditions", x => x.id); + table.ForeignKey( + name: "fk_conditions_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "deities", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + type = table.Column(type: "deity_type", nullable: false, comment: "Тип божества"), + category = table.Column(type: "text", nullable: false, comment: "Категория божества"), + fonts = table.Column(type: "deity_fonts", nullable: false, comment: "Тип божественной силы"), + sanctification = table.Column(type: "deity_sanctification", nullable: false, comment: "Тип освящения"), + sanctification_must = table.Column(type: "boolean", nullable: false, comment: "Обязательное освящение"), + edicts = table.Column(type: "jsonb", nullable: false, comment: "Заветы божества"), + anathema = table.Column(type: "jsonb", nullable: false, comment: "Анафемы божества"), + religious_symbol = table.Column(type: "jsonb", nullable: false, comment: "Религиозный символ божества"), + sacred_animal = table.Column(type: "jsonb", nullable: false, comment: "Священное животное божества"), + area_of_concern = table.Column(type: "jsonb", nullable: false, comment: "Область покровительства божества") + }, + constraints: table => + { + table.PrimaryKey("pk_deities", x => x.id); + table.ForeignKey( + name: "fk_deities_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "entity_aliases", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + entity_id = table.Column(type: "integer", nullable: false, comment: "Связанная сущность"), + name = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Алиас") + }, + constraints: table => + { + table.PrimaryKey("pk_entity_aliases", x => x.id); + table.ForeignKey( + name: "fk_entity_aliases_entities_entity_id", + column: x => x.entity_id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "feats", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + category = table.Column(type: "feat_category", nullable: false, comment: "Категория способности"), + level = table.Column(type: "integer", nullable: false, comment: "Уровень способности"), + actions = table.Column(type: "action_enum", nullable: false, comment: "Количество действий"), + extra = table.Column(type: "text", nullable: true, comment: "Дополнительная информация") + }, + constraints: table => + { + table.PrimaryKey("pk_feats", x => x.id); + table.ForeignKey( + name: "fk_feats_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "languages", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + entity_id = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_languages", x => x.id); + table.ForeignKey( + name: "fk_languages_entities_entity_id", + column: x => x.entity_id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "legacy_remasters", + columns: table => new + { + legacy_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор сущности"), + remaster_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор цели") + }, + constraints: table => + { + table.PrimaryKey("pk_legacy_remasters", x => new { x.legacy_id, x.remaster_id }); + table.ForeignKey( + name: "fk_legacy_remasters_entities_legacy_id", + column: x => x.legacy_id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_legacy_remasters_entities_remaster_id", + column: x => x.remaster_id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "rituals", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + level = table.Column(type: "integer", nullable: false, comment: "Уровень ритуала"), + cast_time = table.Column(type: "integer", nullable: false, comment: "Продолжительность ритуала в секундах"), + duration = table.Column(type: "integer", nullable: false, comment: "Время действия эффекта ритуала в секундах"), + elements = table.Column(type: "element_enum[]", nullable: false, comment: "Элементы ритуала"), + range = table.Column(type: "integer", nullable: false, comment: "Дальнность ритуала"), + primary_check_rank = table.Column(type: "training_rank", nullable: false, comment: "Ранг основной проверки"), + primary_check_suffix = table.Column(type: "jsonb", nullable: true, comment: "Дополнительная информация об основной проверки"), + secondary_casters = table.Column(type: "integer", nullable: false, comment: "Количество дополнительных заклинателей"), + secondary_casters_max = table.Column(type: "integer", nullable: false, comment: "Максимальное количество дополнительных заклинателей"), + secondary_casters_suffix = table.Column(type: "jsonb", nullable: true, comment: "Дополнительная информация о дополнительных заклинателях"), + range_string = table.Column(type: "jsonb", nullable: true, comment: "Дальность ритуала"), + target = table.Column(type: "jsonb", nullable: true, comment: "Цель ритуала"), + cost = table.Column(type: "jsonb", nullable: true, comment: "Стоимость ритуала"), + requirement = table.Column(type: "jsonb", nullable: true, comment: "Требования к ритуалу") + }, + constraints: table => + { + table.PrimaryKey("pk_rituals", x => x.id); + table.ForeignKey( + name: "fk_rituals_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "rules", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + order = table.Column(type: "integer", nullable: false, comment: "Порядок отображения"), + parent_id = table.Column(type: "integer", nullable: true, comment: "Родительского правило"), + breadcrumbs = table.Column(type: "text[]", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_rules", x => x.id); + table.ForeignKey( + name: "fk_rules_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_rules_rules_parent_id", + column: x => x.parent_id, + principalTable: "rules", + principalColumn: "id"); + }); + + migrationBuilder.CreateTable( + name: "spells", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + level = table.Column(type: "integer", nullable: false), + is_focus = table.Column(type: "boolean", nullable: false, comment: "Фокус?"), + actions = table.Column(type: "action_enum", nullable: false, comment: "Количество действий"), + duration = table.Column(type: "integer", maxLength: 255, nullable: true, comment: "Время длительности заклинания"), + range = table.Column(type: "integer", nullable: false, comment: "Дальность заклинания"), + traditions = table.Column(type: "spell_tradition[]", nullable: false, comment: "Традиции заклинания"), + elements = table.Column(type: "element_enum[]", nullable: false, comment: "Элементы заклинания"), + trigger = table.Column(type: "jsonb", nullable: true, comment: "Триггер заклинания"), + target = table.Column(type: "jsonb", nullable: true, comment: "Цель заклинания"), + cost = table.Column(type: "jsonb", nullable: true, comment: "Стоимость заклинания"), + requirement = table.Column(type: "jsonb", nullable: true, comment: "Требования к заклинанию") + }, + constraints: table => + { + table.PrimaryKey("pk_spells", x => x.id); + table.ForeignKey( + name: "fk_spells_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "traits", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + type = table.Column(type: "trait_type", nullable: false, comment: "Тип признака") + }, + constraints: table => + { + table.PrimaryKey("pk_traits", x => x.id); + table.ForeignKey( + name: "fk_traits_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "entity_externals", + columns: table => new + { + entity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор сущности"), + target_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор цели"), + external_id = table.Column(type: "character varying(255)", maxLength: 255, nullable: true, comment: "Идентификатор элемента в ссылке"), + suffix = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Часть URL до объекта. Для источников Foundry - полный UUID объекта"), + md5 = table.Column(type: "character varying(32)", maxLength: 32, nullable: false, comment: "Контрольная сумма объекта") + }, + constraints: table => + { + table.PrimaryKey("pk_entity_externals", x => new { x.entity_id, x.target_id }); + table.ForeignKey( + name: "fk_entity_externals_entities_entity_id", + column: x => x.entity_id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_entity_externals_external_targets_target_id", + column: x => x.target_id, + principalTable: "external_targets", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "entity_keyword", + columns: table => new + { + entities_id = table.Column(type: "integer", nullable: false), + keywords_id = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_entity_keyword", x => new { x.entities_id, x.keywords_id }); + table.ForeignKey( + name: "fk_entity_keyword_entities_entities_id", + column: x => x.entities_id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_entity_keyword_keywords_keywords_id", + column: x => x.keywords_id, + principalTable: "keywords", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "keyword_aliases", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + keyword_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор ключевого слова"), + value = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Синоним") + }, + constraints: table => + { + table.PrimaryKey("pk_keyword_aliases", x => x.id); + table.ForeignKey( + name: "fk_keyword_aliases_keywords_keyword_id", + column: x => x.keyword_id, + principalTable: "keywords", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "entity_sources", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + entity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор сущности"), + source_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор источника"), + suffix = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Номер страницы, эррата и т.д."), + is_remaster = table.Column(type: "boolean", nullable: false, comment: "Флаг, указывающий, что объект является частью ремастера") + }, + constraints: table => + { + table.PrimaryKey("pk_entity_sources", x => x.id); + table.ForeignKey( + name: "fk_entity_sources_entities_entity_id", + column: x => x.entity_id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_entity_sources_sources_source_id", + column: x => x.source_id, + principalTable: "sources", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ancestry_boosts", + columns: table => new + { + id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ancestry_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор родословной"), + boost = table.Column(type: "boolean", nullable: false, comment: "Флаг повышения/снижения"), + value = table.Column(type: "attribute_values", nullable: false, comment: "Значение атрибута") + }, + constraints: table => + { + table.PrimaryKey("pk_ancestry_boosts", x => x.id); + table.ForeignKey( + name: "fk_ancestry_boosts_ancestries_ancestry_id", + column: x => x.ancestry_id, + principalTable: "ancestries", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ancestry_items", + columns: table => new + { + ancestry_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор родословной"), + item_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор связанной сущности"), + level = table.Column(type: "integer", nullable: false, comment: "Уровень сущности в родословной") + }, + constraints: table => + { + table.PrimaryKey("pk_ancestry_items", x => new { x.ancestry_id, x.item_id }); + table.ForeignKey( + name: "fk_ancestry_items_ancestries_ancestry_id", + column: x => x.ancestry_id, + principalTable: "ancestries", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_ancestry_items_entities_item_id", + column: x => x.item_id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "heritages", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + ancestry_id = table.Column(type: "integer", nullable: true, comment: "Идентификатор родословной") + }, + constraints: table => + { + table.PrimaryKey("pk_heritages", x => x.id); + table.ForeignKey( + name: "fk_heritages_ancestries_ancestry_id", + column: x => x.ancestry_id, + principalTable: "ancestries", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_heritages_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "background_boosts", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + background_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор предыстории"), + attribute = table.Column(type: "attribute_values", nullable: false, comment: "Атрибут") + }, + constraints: table => + { + table.PrimaryKey("pk_background_boosts", x => x.id); + table.ForeignKey( + name: "fk_background_boosts_backgrounds_background_id", + column: x => x.background_id, + principalTable: "backgrounds", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "background_items", + columns: table => new + { + background_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + entity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор сущности"), + level = table.Column(type: "integer", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_background_items", x => new { x.background_id, x.entity_id }); + table.ForeignKey( + name: "fk_background_items_backgrounds_background_id", + column: x => x.background_id, + principalTable: "backgrounds", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_background_items_entities_entity_id", + column: x => x.entity_id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "background_skills", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + background_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор предыстории"), + training_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор тренируемого навыка"), + rank = table.Column(type: "training_rank", nullable: false, comment: "Ранг тренировки") + }, + constraints: table => + { + table.PrimaryKey("pk_background_skills", x => x.id); + table.ForeignKey( + name: "fk_background_skills_backgrounds_background_id", + column: x => x.background_id, + principalTable: "backgrounds", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_background_skills_trainings_training_id", + column: x => x.training_id, + principalTable: "trainings", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "class_key_abilities", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + class_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор класса"), + value = table.Column(type: "attribute_values", nullable: false, comment: "Атрибут") + }, + constraints: table => + { + table.PrimaryKey("pk_class_key_abilities", x => x.id); + table.ForeignKey( + name: "fk_class_key_abilities_classes_class_id", + column: x => x.class_id, + principalTable: "classes", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "class_progressions", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + class_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор класса"), + level = table.Column(type: "integer", nullable: false, comment: "Уровень класса"), + type = table.Column(type: "class_progression_type", nullable: false, comment: "Тип элемента прогрессии класса"), + entity_id = table.Column(type: "integer", nullable: true, comment: "Идентификатор сущности") + }, + constraints: table => + { + table.PrimaryKey("pk_class_progressions", x => x.id); + table.ForeignKey( + name: "fk_class_progressions_classes_class_id", + column: x => x.class_id, + principalTable: "classes", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_class_progressions_entities_entity_id", + column: x => x.entity_id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.SetNull); + }); + + migrationBuilder.CreateTable( + name: "class_trainings", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + class_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор класса"), + training_id = table.Column(type: "integer", nullable: true, comment: "Идентификатор тренируемого навыка"), + rank = table.Column(type: "training_rank", nullable: false, comment: "Ранг тренировки") + }, + constraints: table => + { + table.PrimaryKey("pk_class_trainings", x => x.id); + table.ForeignKey( + name: "fk_class_trainings_classes_class_id", + column: x => x.class_id, + principalTable: "classes", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_class_trainings_trainings_training_id", + column: x => x.training_id, + principalTable: "trainings", + principalColumn: "id", + onDelete: ReferentialAction.SetNull); + }); + + migrationBuilder.CreateTable( + name: "subclass_groups", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + class_id = table.Column(type: "integer", nullable: true, comment: "Идентификатор класса") + }, + constraints: table => + { + table.PrimaryKey("pk_subclass_groups", x => x.id); + table.ForeignKey( + name: "fk_subclass_groups_classes_class_id", + column: x => x.class_id, + principalTable: "classes", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_subclass_groups_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "deity_attributes", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + deity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор божества"), + attribute = table.Column(type: "attribute_values", nullable: false, comment: "Атрибут божества") + }, + constraints: table => + { + table.PrimaryKey("pk_deity_attributes", x => x.id); + table.ForeignKey( + name: "fk_deity_attributes_deities_deity_id", + column: x => x.deity_id, + principalTable: "deities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "deity_training", + columns: table => new + { + deity_id = table.Column(type: "integer", nullable: false), + skills_id = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_deity_training", x => new { x.deity_id, x.skills_id }); + table.ForeignKey( + name: "fk_deity_training_deities_deity_id", + column: x => x.deity_id, + principalTable: "deities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_deity_training_trainings_skills_id", + column: x => x.skills_id, + principalTable: "trainings", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "deity_weapons", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + deity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор божества"), + weapon = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Название оружия") + }, + constraints: table => + { + table.PrimaryKey("pk_deity_weapons", x => x.id); + table.ForeignKey( + name: "fk_deity_weapons_deities_deity_id", + column: x => x.deity_id, + principalTable: "deities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "archetypes", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + level = table.Column(type: "integer", nullable: false, comment: "Уровень"), + dedication_feat_id = table.Column(type: "integer", nullable: true, comment: "ID посвящения"), + extra = table.Column(type: "text", nullable: true, comment: "Дополнительная информация") + }, + constraints: table => + { + table.PrimaryKey("pk_archetypes", x => x.id); + table.ForeignKey( + name: "fk_archetypes_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_archetypes_feats_dedication_feat_id", + column: x => x.dedication_feat_id, + principalTable: "feats", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "feat_prerequisites", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + feat_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор черты"), + value = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Предварительное требование") + }, + constraints: table => + { + table.PrimaryKey("pk_feat_prerequisites", x => x.id); + table.ForeignKey( + name: "fk_feat_prerequisites_feats_feat_id", + column: x => x.feat_id, + principalTable: "feats", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ancestry_languages", + columns: table => new + { + ancestry_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор родословной"), + language_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор связанного языка"), + is_additional = table.Column(type: "boolean", nullable: false, comment: "Флаг дополнительного") + }, + constraints: table => + { + table.PrimaryKey("pk_ancestry_languages", x => new { x.ancestry_id, x.language_id }); + table.ForeignKey( + name: "fk_ancestry_languages_ancestries_ancestry_id", + column: x => x.ancestry_id, + principalTable: "ancestries", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_ancestry_languages_languages_language_id", + column: x => x.language_id, + principalTable: "languages", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ritual_areas", + columns: table => new + { + ritual_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор ритуала"), + details = table.Column(type: "jsonb", maxLength: 255, nullable: true, comment: "Описание области действия ритуала"), + type = table.Column(type: "spell_area_type", nullable: false, comment: "Тип области действия ритуала") + }, + constraints: table => + { + table.PrimaryKey("pk_ritual_areas", x => x.ritual_id); + table.ForeignKey( + name: "fk_ritual_areas_rituals_ritual_id", + column: x => x.ritual_id, + principalTable: "rituals", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "ritual_checks", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + ritual_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор ритуала"), + training_id = table.Column(type: "integer", nullable: true, comment: "Идентификатор тренировки"), + training_string = table.Column(type: "jsonb", nullable: true, comment: "Дополнение к проверке"), + rank = table.Column(type: "training_rank", nullable: false, comment: "Ранг тренировки"), + is_primary = table.Column(type: "boolean", nullable: false, comment: "Флаг основной проверки") + }, + constraints: table => + { + table.PrimaryKey("pk_ritual_checks", x => x.id); + table.ForeignKey( + name: "fk_ritual_checks_rituals_ritual_id", + column: x => x.ritual_id, + principalTable: "rituals", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_ritual_checks_trainings_training_id", + column: x => x.training_id, + principalTable: "trainings", + principalColumn: "id", + onDelete: ReferentialAction.SetNull); + }); + + migrationBuilder.CreateTable( + name: "deity_spells", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + deity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор божества"), + level = table.Column(type: "integer", nullable: false, comment: "Уровень заклинания"), + spell_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор заклинания") + }, + constraints: table => + { + table.PrimaryKey("pk_deity_spells", x => x.id); + table.ForeignKey( + name: "fk_deity_spells_deities_deity_id", + column: x => x.deity_id, + principalTable: "deities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_deity_spells_spells_spell_id", + column: x => x.spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "domains", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + domain_spell_id = table.Column(type: "integer", nullable: false, comment: "Заклинание домена"), + advanced_domain_spell_id = table.Column(type: "integer", nullable: false, comment: "Продвинутое заклинание домена"), + apocryphal_spell_id = table.Column(type: "integer", nullable: true, comment: "Апокрифическое заклинание домена"), + advanced_apocryphal_spell_id = table.Column(type: "integer", nullable: true, comment: "Продвинутое апокрифическое заклинание домена") + }, + constraints: table => + { + table.PrimaryKey("pk_domains", x => x.id); + table.ForeignKey( + name: "fk_domains_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_domains_spells_advanced_apocryphal_spell_id", + column: x => x.advanced_apocryphal_spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.SetNull); + table.ForeignKey( + name: "fk_domains_spells_advanced_domain_spell_id", + column: x => x.advanced_domain_spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_domains_spells_apocryphal_spell_id", + column: x => x.apocryphal_spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.SetNull); + table.ForeignKey( + name: "fk_domains_spells_domain_spell_id", + column: x => x.domain_spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "spell_areas", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + spell_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор заклинания"), + details = table.Column(type: "jsonb", maxLength: 255, nullable: true, comment: "Описание области заклинания"), + type = table.Column(type: "spell_area_type", nullable: false, comment: "Тип области заклинания") + }, + constraints: table => + { + table.PrimaryKey("pk_spell_areas", x => x.id); + table.ForeignKey( + name: "fk_spell_areas_spells_spell_id", + column: x => x.spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "spell_damages", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор урона заклинания") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + spell_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор заклинания"), + key = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Уровень заклинания"), + apply_mod = table.Column(type: "boolean", nullable: true, comment: "Применяется модификатор?"), + category = table.Column(type: "spell_damage_category", nullable: true, comment: "Категория урона заклинания"), + formula = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Формула урона заклинания"), + kinds = table.Column(type: "spell_damage_kinds", nullable: false, comment: "Тип урона заклинания"), + materials = table.Column(type: "character varying(255)", maxLength: 255, nullable: true, comment: "Материалы для заклинания"), + type = table.Column(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Тип урона заклинания") + }, + constraints: table => + { + table.PrimaryKey("pk_spell_damages", x => x.id); + table.ForeignKey( + name: "fk_spell_damages_spells_spell_id", + column: x => x.spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "spell_defenses", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + spell_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор заклинания"), + is_passive = table.Column(type: "boolean", nullable: false), + is_basic = table.Column(type: "boolean", nullable: true, comment: "Базовый спасборосок?"), + statistic = table.Column(type: "character varying(255)", maxLength: 255, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_spell_defenses", x => x.id); + table.ForeignKey( + name: "fk_spell_defenses_spells_spell_id", + column: x => x.spell_id, + principalTable: "spells", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "entity_trait", + columns: table => new + { + entities_id = table.Column(type: "integer", nullable: false), + traits_id = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_entity_trait", x => new { x.entities_id, x.traits_id }); + table.ForeignKey( + name: "fk_entity_trait_entities_entities_id", + column: x => x.entities_id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_entity_trait_traits_traits_id", + column: x => x.traits_id, + principalTable: "traits", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "subclasses", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор"), + group_id = table.Column(type: "integer", nullable: false, comment: "Группа подклассов"), + additional = table.Column(type: "jsonb", nullable: false, comment: "Дополнительная информация"), + extra = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_subclasses", x => x.id); + table.ForeignKey( + name: "fk_subclasses_entities_id", + column: x => x.id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_subclasses_subclass_groups_group_id", + column: x => x.group_id, + principalTable: "subclass_groups", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "archetype_feats", + columns: table => new + { + archetype_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор архетипа"), + feat_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор черты") + }, + constraints: table => + { + table.PrimaryKey("pk_archetype_feats", x => new { x.archetype_id, x.feat_id }); + table.ForeignKey( + name: "fk_archetype_feats_archetypes_archetype_id", + column: x => x.archetype_id, + principalTable: "archetypes", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_archetype_feats_feats_feat_id", + column: x => x.feat_id, + principalTable: "feats", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "deity_domains", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + deity_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор божества"), + is_primary = table.Column(type: "boolean", nullable: false, comment: "Флаг основного домена"), + domain_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор домена"), + value = table.Column(type: "character varying(255)", maxLength: 255, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_deity_domains", x => x.id); + table.ForeignKey( + name: "fk_deity_domains_deities_deity_id", + column: x => x.deity_id, + principalTable: "deities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_deity_domains_domains_domain_id", + column: x => x.domain_id, + principalTable: "domains", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "subclass_provided_entities", + columns: table => new + { + subclass_id = table.Column(type: "integer", nullable: false), + entity_id = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_subclass_provided_entities", x => new { x.subclass_id, x.entity_id }); + table.ForeignKey( + name: "fk_subclass_provided_entities_entities_entity_id", + column: x => x.entity_id, + principalTable: "entities", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_subclass_provided_entities_subclasses_subclass_id", + column: x => x.subclass_id, + principalTable: "subclasses", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "subclass_trainings", + columns: table => new + { + id = table.Column(type: "integer", nullable: false, comment: "Идентификатор связи") + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + subclass_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор подкласса"), + training_id = table.Column(type: "integer", nullable: false, comment: "Идентификатор тренировки"), + rank = table.Column(type: "training_rank", nullable: false, comment: "Ранг тренировки") + }, + constraints: table => + { + table.PrimaryKey("pk_subclass_trainings", x => x.id); + table.ForeignKey( + name: "fk_subclass_trainings_subclasses_subclass_id", + column: x => x.subclass_id, + principalTable: "subclasses", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "fk_subclass_trainings_trainings_training_id", + column: x => x.training_id, + principalTable: "trainings", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "ix_ancestry_boosts_ancestry_id", + table: "ancestry_boosts", + column: "ancestry_id"); + + migrationBuilder.CreateIndex( + name: "ix_ancestry_items_item_id", + table: "ancestry_items", + column: "item_id"); + + migrationBuilder.CreateIndex( + name: "ix_ancestry_languages_language_id", + table: "ancestry_languages", + column: "language_id"); + + migrationBuilder.CreateIndex( + name: "ix_archetype_feats_feat_id", + table: "archetype_feats", + column: "feat_id"); + + migrationBuilder.CreateIndex( + name: "ix_archetypes_dedication_feat_id", + table: "archetypes", + column: "dedication_feat_id", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_background_boosts_background_id", + table: "background_boosts", + column: "background_id"); + + migrationBuilder.CreateIndex( + name: "ix_background_items_entity_id", + table: "background_items", + column: "entity_id"); + + migrationBuilder.CreateIndex( + name: "ix_background_skills_background_id", + table: "background_skills", + column: "background_id"); + + migrationBuilder.CreateIndex( + name: "ix_background_skills_training_id", + table: "background_skills", + column: "training_id"); + + migrationBuilder.CreateIndex( + name: "ix_class_key_abilities_class_id", + table: "class_key_abilities", + column: "class_id"); + + migrationBuilder.CreateIndex( + name: "ix_class_progressions_class_id", + table: "class_progressions", + column: "class_id"); + + migrationBuilder.CreateIndex( + name: "ix_class_progressions_entity_id", + table: "class_progressions", + column: "entity_id"); + + migrationBuilder.CreateIndex( + name: "ix_class_trainings_class_id", + table: "class_trainings", + column: "class_id"); + + migrationBuilder.CreateIndex( + name: "ix_class_trainings_training_id", + table: "class_trainings", + column: "training_id"); + + migrationBuilder.CreateIndex( + name: "ix_deity_attributes_deity_id", + table: "deity_attributes", + column: "deity_id"); + + migrationBuilder.CreateIndex( + name: "ix_deity_domains_deity_id", + table: "deity_domains", + column: "deity_id"); + + migrationBuilder.CreateIndex( + name: "ix_deity_domains_domain_id", + table: "deity_domains", + column: "domain_id"); + + migrationBuilder.CreateIndex( + name: "ix_deity_spells_deity_id", + table: "deity_spells", + column: "deity_id"); + + migrationBuilder.CreateIndex( + name: "ix_deity_spells_spell_id", + table: "deity_spells", + column: "spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_deity_training_skills_id", + table: "deity_training", + column: "skills_id"); + + migrationBuilder.CreateIndex( + name: "ix_deity_weapons_deity_id", + table: "deity_weapons", + column: "deity_id"); + + migrationBuilder.CreateIndex( + name: "ix_domains_advanced_apocryphal_spell_id", + table: "domains", + column: "advanced_apocryphal_spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_domains_advanced_domain_spell_id", + table: "domains", + column: "advanced_domain_spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_domains_apocryphal_spell_id", + table: "domains", + column: "apocryphal_spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_domains_domain_spell_id", + table: "domains", + column: "domain_spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_entity_aliases_entity_id", + table: "entity_aliases", + column: "entity_id"); + + migrationBuilder.CreateIndex( + name: "ix_entity_externals_target_id", + table: "entity_externals", + column: "target_id"); + + migrationBuilder.CreateIndex( + name: "ix_entity_keyword_keywords_id", + table: "entity_keyword", + column: "keywords_id"); + + migrationBuilder.CreateIndex( + name: "ix_entity_sources_entity_id", + table: "entity_sources", + column: "entity_id"); + + migrationBuilder.CreateIndex( + name: "ix_entity_sources_source_id", + table: "entity_sources", + column: "source_id"); + + migrationBuilder.CreateIndex( + name: "ix_entity_trait_traits_id", + table: "entity_trait", + column: "traits_id"); + + migrationBuilder.CreateIndex( + name: "ix_feat_prerequisites_feat_id", + table: "feat_prerequisites", + column: "feat_id"); + + migrationBuilder.CreateIndex( + name: "ix_heritages_ancestry_id", + table: "heritages", + column: "ancestry_id"); + + migrationBuilder.CreateIndex( + name: "ix_keyword_aliases_keyword_id", + table: "keyword_aliases", + column: "keyword_id"); + + migrationBuilder.CreateIndex( + name: "ix_languages_entity_id", + table: "languages", + column: "entity_id"); + + migrationBuilder.CreateIndex( + name: "ix_legacy_remasters_remaster_id", + table: "legacy_remasters", + column: "remaster_id"); + + migrationBuilder.CreateIndex( + name: "ix_ritual_checks_ritual_id", + table: "ritual_checks", + column: "ritual_id"); + + migrationBuilder.CreateIndex( + name: "ix_ritual_checks_training_id", + table: "ritual_checks", + column: "training_id"); + + migrationBuilder.CreateIndex( + name: "ix_rules_parent_id", + table: "rules", + column: "parent_id"); + + migrationBuilder.CreateIndex( + name: "ix_spell_areas_spell_id", + table: "spell_areas", + column: "spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_spell_damages_spell_id", + table: "spell_damages", + column: "spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_spell_defenses_spell_id", + table: "spell_defenses", + column: "spell_id"); + + migrationBuilder.CreateIndex( + name: "ix_subclass_groups_class_id", + table: "subclass_groups", + column: "class_id"); + + migrationBuilder.CreateIndex( + name: "ix_subclass_provided_entities_entity_id", + table: "subclass_provided_entities", + column: "entity_id"); + + migrationBuilder.CreateIndex( + name: "ix_subclass_trainings_subclass_id", + table: "subclass_trainings", + column: "subclass_id"); + + migrationBuilder.CreateIndex( + name: "ix_subclass_trainings_training_id", + table: "subclass_trainings", + column: "training_id"); + + migrationBuilder.CreateIndex( + name: "ix_subclasses_group_id", + table: "subclasses", + column: "group_id"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "actions"); + + migrationBuilder.DropTable( + name: "ancestry_boosts"); + + migrationBuilder.DropTable( + name: "ancestry_items"); + + migrationBuilder.DropTable( + name: "ancestry_languages"); + + migrationBuilder.DropTable( + name: "archetype_feats"); + + migrationBuilder.DropTable( + name: "background_boosts"); + + migrationBuilder.DropTable( + name: "background_items"); + + migrationBuilder.DropTable( + name: "background_skills"); + + migrationBuilder.DropTable( + name: "class_key_abilities"); + + migrationBuilder.DropTable( + name: "class_progressions"); + + migrationBuilder.DropTable( + name: "class_trainings"); + + migrationBuilder.DropTable( + name: "conditions"); + + migrationBuilder.DropTable( + name: "deity_attributes"); + + migrationBuilder.DropTable( + name: "deity_domains"); + + migrationBuilder.DropTable( + name: "deity_spells"); + + migrationBuilder.DropTable( + name: "deity_training"); + + migrationBuilder.DropTable( + name: "deity_weapons"); + + migrationBuilder.DropTable( + name: "entity_aliases"); + + migrationBuilder.DropTable( + name: "entity_externals"); + + migrationBuilder.DropTable( + name: "entity_keyword"); + + migrationBuilder.DropTable( + name: "entity_sources"); + + migrationBuilder.DropTable( + name: "entity_trait"); + + migrationBuilder.DropTable( + name: "feat_prerequisites"); + + migrationBuilder.DropTable( + name: "frequencies"); + + migrationBuilder.DropTable( + name: "heritages"); + + migrationBuilder.DropTable( + name: "keyword_aliases"); + + migrationBuilder.DropTable( + name: "legacy_remasters"); + + migrationBuilder.DropTable( + name: "ritual_areas"); + + migrationBuilder.DropTable( + name: "ritual_checks"); + + migrationBuilder.DropTable( + name: "rules"); + + migrationBuilder.DropTable( + name: "spell_areas"); + + migrationBuilder.DropTable( + name: "spell_damages"); + + migrationBuilder.DropTable( + name: "spell_defenses"); + + migrationBuilder.DropTable( + name: "subclass_provided_entities"); + + migrationBuilder.DropTable( + name: "subclass_trainings"); + + migrationBuilder.DropTable( + name: "languages"); + + migrationBuilder.DropTable( + name: "archetypes"); + + migrationBuilder.DropTable( + name: "backgrounds"); + + migrationBuilder.DropTable( + name: "domains"); + + migrationBuilder.DropTable( + name: "deities"); + + migrationBuilder.DropTable( + name: "external_targets"); + + migrationBuilder.DropTable( + name: "sources"); + + migrationBuilder.DropTable( + name: "traits"); + + migrationBuilder.DropTable( + name: "ancestries"); + + migrationBuilder.DropTable( + name: "keywords"); + + migrationBuilder.DropTable( + name: "rituals"); + + migrationBuilder.DropTable( + name: "subclasses"); + + migrationBuilder.DropTable( + name: "trainings"); + + migrationBuilder.DropTable( + name: "feats"); + + migrationBuilder.DropTable( + name: "spells"); + + migrationBuilder.DropTable( + name: "subclass_groups"); + + migrationBuilder.DropTable( + name: "classes"); + + migrationBuilder.DropTable( + name: "entities"); + } + } +} diff --git a/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs b/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs index be2b4aa..b8e292c 100644 --- a/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs +++ b/Pf2eModel/Migrations/Pf2eDbContextModelSnapshot.cs @@ -26,12 +26,12 @@ namespace Pf2eModel.Migrations NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "attribute_values", new[] { "cha", "con", "dex", "free", "int", "str", "wis" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "class_progression_type", new[] { "ancestry_feat", "attribute_increase", "class_feat", "entity", "general_feat", "skill_feat", "skill_increase" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "condition_group", new[] { "abilities", "attitudes", "death", "detection", "senses", "unknown" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_category", new[] { "covenant", "deity", "pantheon", "philosophy" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_fonts", new[] { "any", "harm", "heal", "none" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_sanctification", new[] { "any", "holy", "unholy" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_type", new[] { "covenant", "deity", "pantheon", "philosophy" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "element_enum", new[] { "air", "earth", "fire", "metal", "universal", "water", "wood" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_rarity", new[] { "common", "rare", "uncommon", "unique" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "domain", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_category", new[] { "ancestry", "ancestry-feature", "archetype", "bonus", "calling", "campaign-feature", "class", "class-feature", "curse", "deityboon", "general", "pfsboon", "skill", "uncategorized" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "locale_type", new[] { "english", "hobby", "other", "russian" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "size_enum", new[] { "huge", "large", "medium", "small", "tiny" }); @@ -41,7 +41,7 @@ namespace Pf2eModel.Migrations NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_kinds", new[] { "any", "damage", "healing" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_tradition", new[] { "all", "arcane", "divine", "elemental", "none", "occult", "primal" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "training_rank", new[] { "expert", "legendary", "master", "mythic", "trained", "untrained" }); - NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "class", "regular", "tradition" }); + NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "alignment", "class", "regular", "tradition" }); NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "vision_enum", new[] { "dark-vision", "low-light-vision", "normal" }); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -893,11 +893,11 @@ namespace Pf2eModel.Migrations .HasColumnOrder(2) .HasComment("Количество очков здоровья"); - b.Property("Spellcasting") - .HasColumnType("boolean") + b.Property("Spellcasting") + .HasColumnType("integer") .HasColumnName("spellcasting") .HasColumnOrder(3) - .HasComment("Заклинатель?"); + .HasComment("Тип заклинательства"); b.Property("Tradition") .HasColumnType("spell_tradition") @@ -1125,30 +1125,72 @@ namespace Pf2eModel.Migrations .HasColumnOrder(1) .HasComment("Идентификатор"); - b.Property("Category") - .HasColumnType("deity_category") + b.Property("Anathema") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("anathema") + .HasColumnOrder(8) + .HasComment("Анафемы божества"); + + b.Property("AreaOfConcern") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("area_of_concern") + .HasColumnOrder(11) + .HasComment("Область покровительства божества"); + + b.Property("Category") + .IsRequired() + .HasColumnType("text") .HasColumnName("category") - .HasColumnOrder(2) - .HasComment("Тип божества"); + .HasColumnOrder(3) + .HasComment("Категория божества"); + + b.Property("Edicts") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("edicts") + .HasColumnOrder(7) + .HasComment("Заветы божества"); b.Property("Fonts") .HasColumnType("deity_fonts") .HasColumnName("fonts") - .HasColumnOrder(3) + .HasColumnOrder(4) .HasComment("Тип божественной силы"); + b.Property("ReligiousSymbol") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("religious_symbol") + .HasColumnOrder(9) + .HasComment("Религиозный символ божества"); + + b.Property("SacredAnimal") + .IsRequired() + .HasColumnType("jsonb") + .HasColumnName("sacred_animal") + .HasColumnOrder(10) + .HasComment("Священное животное божества"); + b.Property("Sanctification") .HasColumnType("deity_sanctification") .HasColumnName("sanctification") - .HasColumnOrder(4) + .HasColumnOrder(5) .HasComment("Тип освящения"); b.Property("SanctificationMust") .HasColumnType("boolean") .HasColumnName("sanctification_must") - .HasColumnOrder(5) + .HasColumnOrder(6) .HasComment("Обязательное освящение"); + b.Property("Type") + .HasColumnType("deity_type") + .HasColumnName("type") + .HasColumnOrder(2) + .HasComment("Тип божества"); + b.HasKey("Id") .HasName("pk_deities"); @@ -1157,21 +1199,33 @@ namespace Pf2eModel.Migrations modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeityAttribute", b => { - b.Property("DeityId") + b.Property("Id") + .ValueGeneratedOnAdd() .HasColumnType("integer") - .HasColumnName("deity_id") + .HasColumnName("id") .HasColumnOrder(1) - .HasComment("Идентификатор божества"); + .HasComment("Идентификатор"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Attribute") .HasColumnType("attribute_values") .HasColumnName("attribute") - .HasColumnOrder(2) + .HasColumnOrder(3) .HasComment("Атрибут божества"); - b.HasKey("DeityId", "Attribute") + b.Property("DeityId") + .HasColumnType("integer") + .HasColumnName("deity_id") + .HasColumnOrder(2) + .HasComment("Идентификатор божества"); + + b.HasKey("Id") .HasName("pk_deity_attributes"); + b.HasIndex("DeityId") + .HasDatabaseName("ix_deity_attributes_deity_id"); + b.ToTable("deity_attributes", (string)null); }); @@ -1192,6 +1246,12 @@ namespace Pf2eModel.Migrations .HasColumnOrder(2) .HasComment("Идентификатор божества"); + b.Property("DomainId") + .HasColumnType("integer") + .HasColumnName("domain_id") + .HasColumnOrder(4) + .HasComment("Идентификатор домена"); + b.Property("IsPrimary") .HasColumnType("boolean") .HasColumnName("is_primary") @@ -1203,7 +1263,7 @@ namespace Pf2eModel.Migrations .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("value") - .HasColumnOrder(4); + .HasColumnOrder(5); b.HasKey("Id") .HasName("pk_deity_domains"); @@ -1211,6 +1271,9 @@ namespace Pf2eModel.Migrations b.HasIndex("DeityId") .HasDatabaseName("ix_deity_domains_deity_id"); + b.HasIndex("DomainId") + .HasDatabaseName("ix_deity_domains_domain_id"); + b.ToTable("deity_domains", (string)null); }); @@ -1289,6 +1352,56 @@ namespace Pf2eModel.Migrations b.ToTable("deity_weapons", (string)null); }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.Property("Id") + .HasColumnType("integer") + .HasColumnName("id") + .HasColumnOrder(1) + .HasComment("Идентификатор"); + + b.Property("AdvancedApocryphalSpellId") + .HasColumnType("integer") + .HasColumnName("advanced_apocryphal_spell_id") + .HasColumnOrder(5) + .HasComment("Продвинутое апокрифическое заклинание домена"); + + b.Property("AdvancedDomainSpellId") + .HasColumnType("integer") + .HasColumnName("advanced_domain_spell_id") + .HasColumnOrder(3) + .HasComment("Продвинутое заклинание домена"); + + b.Property("ApocryphalSpellId") + .HasColumnType("integer") + .HasColumnName("apocryphal_spell_id") + .HasColumnOrder(4) + .HasComment("Апокрифическое заклинание домена"); + + b.Property("DomainSpellId") + .HasColumnType("integer") + .HasColumnName("domain_spell_id") + .HasColumnOrder(2) + .HasComment("Заклинание домена"); + + b.HasKey("Id") + .HasName("pk_domains"); + + b.HasIndex("AdvancedApocryphalSpellId") + .HasDatabaseName("ix_domains_advanced_apocryphal_spell_id"); + + b.HasIndex("AdvancedDomainSpellId") + .HasDatabaseName("ix_domains_advanced_domain_spell_id"); + + b.HasIndex("ApocryphalSpellId") + .HasDatabaseName("ix_domains_apocryphal_spell_id"); + + b.HasIndex("DomainSpellId") + .HasDatabaseName("ix_domains_domain_spell_id"); + + b.ToTable("domains", (string)null); + }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => { b.Property("Id") @@ -2403,7 +2516,16 @@ namespace Pf2eModel.Migrations .IsRequired() .HasConstraintName("fk_deity_domains_deities_deity_id"); + b.HasOne("Pf2eModel.Model.Structure.Domain", "Domain") + .WithMany("DeityDomains") + .HasForeignKey("DomainId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_deity_domains_domains_domain_id"); + b.Navigation("Deity"); + + b.Navigation("Domain"); }); modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeitySpell", b => @@ -2439,6 +2561,52 @@ namespace Pf2eModel.Migrations b.Navigation("Deity"); }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.HasOne("Pf2eModel.Model.Structure.Spell", "AdvancedApocryphalSpell") + .WithMany() + .HasForeignKey("AdvancedApocryphalSpellId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_domains_spells_advanced_apocryphal_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "AdvancedDomainSpell") + .WithMany() + .HasForeignKey("AdvancedDomainSpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_spells_advanced_domain_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "ApocryphalSpell") + .WithMany() + .HasForeignKey("ApocryphalSpellId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_domains_spells_apocryphal_spell_id"); + + b.HasOne("Pf2eModel.Model.Structure.Spell", "DomainSpell") + .WithMany() + .HasForeignKey("DomainSpellId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_spells_domain_spell_id"); + + b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") + .WithOne() + .HasForeignKey("Pf2eModel.Model.Structure.Domain", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_domains_entities_id"); + + b.Navigation("AdvancedApocryphalSpell"); + + b.Navigation("AdvancedDomainSpell"); + + b.Navigation("ApocryphalSpell"); + + b.Navigation("DomainSpell"); + + b.Navigation("Entity"); + }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => { b.HasOne("Pf2eModel.Model.Base.Entity", "Entity") @@ -2729,6 +2897,11 @@ namespace Pf2eModel.Migrations b.Navigation("DeityWeapons"); }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Domain", b => + { + b.Navigation("DeityDomains"); + }); + modelBuilder.Entity("Pf2eModel.Model.Structure.Feat", b => { b.Navigation("FeatPrerequisites"); diff --git a/Pf2eModel/Model/Enum/DeityCategory.cs b/Pf2eModel/Model/Enum/DeityType.cs similarity index 95% rename from Pf2eModel/Model/Enum/DeityCategory.cs rename to Pf2eModel/Model/Enum/DeityType.cs index 995d56a..487c781 100644 --- a/Pf2eModel/Model/Enum/DeityCategory.cs +++ b/Pf2eModel/Model/Enum/DeityType.cs @@ -5,7 +5,7 @@ namespace Pf2eModel.Model.Enum; /// /// Тип божества. /// -public enum DeityCategory +public enum DeityType { /// /// Божество. diff --git a/Pf2eModel/Model/Enum/EntityType.cs b/Pf2eModel/Model/Enum/EntityType.cs index b3aa3d5..bb72622 100644 --- a/Pf2eModel/Model/Enum/EntityType.cs +++ b/Pf2eModel/Model/Enum/EntityType.cs @@ -79,6 +79,12 @@ public enum EntityType [PgName("condition")] Condition, + /// + /// Домен божества. + /// + [PgName("domain")] + Domain, + /// /// Божество. /// diff --git a/Pf2eModel/Model/Enum/SpellcastingType.cs b/Pf2eModel/Model/Enum/SpellcastingType.cs new file mode 100644 index 0000000..6355762 --- /dev/null +++ b/Pf2eModel/Model/Enum/SpellcastingType.cs @@ -0,0 +1,27 @@ +using NpgsqlTypes; + +namespace Pf2eModel.Model.Enum; + +/// +/// Перечисление типа применения заклинаний. +/// +public enum SpellcastingType +{ + /// + /// Не применяет заклинания. + /// + [PgName("none")] + None, + + /// + /// Заготавливаемое заклинательство. + /// + [PgName("prepared")] + Prepared, + + /// + /// Спонтанное заклинательство. + /// + [PgName("spontaneous")] + Spontaneous, +} diff --git a/Pf2eModel/Model/Enum/TraitType.cs b/Pf2eModel/Model/Enum/TraitType.cs index 379ec1f..00f87d5 100644 --- a/Pf2eModel/Model/Enum/TraitType.cs +++ b/Pf2eModel/Model/Enum/TraitType.cs @@ -13,6 +13,12 @@ public enum TraitType [PgName("regular")] Regular, + /// + /// Мировоззрение. + /// + [PgName("alignment")] + Alignment, + /// /// Признак класса. /// diff --git a/Pf2eModel/Model/Structure/Class.cs b/Pf2eModel/Model/Structure/Class.cs index 766b1b9..8307f47 100644 --- a/Pf2eModel/Model/Structure/Class.cs +++ b/Pf2eModel/Model/Structure/Class.cs @@ -31,11 +31,11 @@ public class Class : IEntity public int Hp { get; set; } /// - /// Флаг, указывающий на то, что класс является заклинательным. + /// Указание на тип заклинательства. /// [Column(Order = 3)] - [Comment("Заклинатель?")] - public bool Spellcasting { get; set; } + [Comment("Тип заклинательства")] + public SpellcastingType Spellcasting { get; set; } = SpellcastingType.None; /// /// Традиция заклинаний класса. diff --git a/Pf2eModel/Model/Structure/Deity.cs b/Pf2eModel/Model/Structure/Deity.cs index 0f34c08..7774a7d 100644 --- a/Pf2eModel/Model/Structure/Deity.cs +++ b/Pf2eModel/Model/Structure/Deity.cs @@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema; using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Common; +using Pf2eModel.Model.Common.I18n; using Pf2eModel.Model.Enum; using Pf2eModel.Model.Structure.DeityRelation; @@ -29,31 +30,73 @@ public class Deity : IEntity /// [Column(Order = 2)] [Comment("Тип божества")] - public DeityCategory Category { get; set; } + public DeityType Type { get; set; } + + /// + /// Категория божества. + /// + [Column(Order = 3)] + [Comment("Категория божества")] + public string Category { get; set; } = null!; /// /// Тип божественный силы. /// - [Column(Order = 3)] + [Column(Order = 4)] [Comment("Тип божественной силы")] public DeityFonts Fonts { get; set; } /// /// Тип освящения. /// - [Column(Order = 4)] + [Column(Order = 5)] [Comment("Тип освящения")] public DeitySanctification Sanctification { get; set; } /// /// Обязательное освящение. /// - [Column(Order = 5)] + [Column(Order = 6)] [Comment("Обязательное освящение")] public bool SanctificationMust { get; set; } /// - /// Аттрибуты божества. + /// Заветы божества. + /// + [Column(Order = 7)] + [Comment("Заветы божества")] + public LocaleString Edicts { get; set; } = []; + + /// + /// Анафемы божества. + /// + [Column(Order = 8)] + [Comment("Анафемы божества")] + public LocaleString Anathema { get; set; } = []; + + /// + /// Религиозный символ божества. + /// + [Column(Order = 9)] + [Comment("Религиозный символ божества")] + public LocaleString ReligiousSymbol { get; set; } = []; + + /// + /// Священное животное божества. + /// + [Column(Order = 10)] + [Comment("Священное животное божества")] + public LocaleString SacredAnimal { get; set; } = []; + + /// + /// Область покровительства божества. + /// + [Column(Order = 11)] + [Comment("Область покровительства божества")] + public LocaleString AreaOfConcern { get; set; } = []; + + /// + /// Атрибуты божества. /// public ICollection DeityAttributes { get; set; } = new List(); diff --git a/Pf2eModel/Model/Structure/DeityRelation/DeityAttribute.cs b/Pf2eModel/Model/Structure/DeityRelation/DeityAttribute.cs index 776e702..12515b5 100644 --- a/Pf2eModel/Model/Structure/DeityRelation/DeityAttribute.cs +++ b/Pf2eModel/Model/Structure/DeityRelation/DeityAttribute.cs @@ -1,4 +1,5 @@ -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Enum; @@ -7,20 +8,28 @@ namespace Pf2eModel.Model.Structure.DeityRelation; /// /// Элемент отношения божества и атрибута. /// -[PrimaryKey(nameof(DeityId), nameof(Attribute))] public class DeityAttribute { + /// + /// Идентификатор. + /// + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column(Order = 1)] + [Comment("Идентификатор")] + public int Id { get; set; } + /// /// Идентификатор божества. /// - [Column(Order = 1)] + [Column(Order = 2)] [Comment("Идентификатор божества")] public int DeityId { get; set; } /// /// Атрибут божества. /// - [Column(Order = 2)] + [Column(Order = 3)] [Comment("Атрибут божества")] public AttributeValues Attribute { get; set; } diff --git a/Pf2eModel/Model/Structure/DeityRelation/DeityDomain.cs b/Pf2eModel/Model/Structure/DeityRelation/DeityDomain.cs index 6d693d1..c6d29a6 100644 --- a/Pf2eModel/Model/Structure/DeityRelation/DeityDomain.cs +++ b/Pf2eModel/Model/Structure/DeityRelation/DeityDomain.cs @@ -1,6 +1,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Microsoft.EntityFrameworkCore; +using Pf2eModel.Model.Structure; namespace Pf2eModel.Model.Structure.DeityRelation; @@ -25,6 +26,13 @@ public class DeityDomain [Comment("Идентификатор божества")] public int DeityId { get; set; } + /// + /// Идентификатор домена. + /// + [Column(Order = 4)] + [Comment("Идентификатор домена")] + public int DomainId { get; set; } + /// /// Флаг, указывающий, является ли домен основным для божества. /// @@ -35,7 +43,7 @@ public class DeityDomain /// /// Значение домена божества, например, "Свет", "Тьма" и т.д. /// - [Column(Order = 4)] + [Column(Order = 5)] [MaxLength(Pf2eDbContext.NameLength)] public string Value { get; set; } = null!; @@ -43,4 +51,9 @@ public class DeityDomain /// Божество, к которому относится домен. /// public virtual Deity Deity { get; set; } = null!; + + /// + /// Домен, связанный с божеством. + /// + public virtual Domain Domain { get; set; } = null!; } diff --git a/Pf2eModel/Model/Structure/Domain.cs b/Pf2eModel/Model/Structure/Domain.cs new file mode 100644 index 0000000..6a98924 --- /dev/null +++ b/Pf2eModel/Model/Structure/Domain.cs @@ -0,0 +1,78 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; +using Pf2eModel.Model.Base; +using Pf2eModel.Model.Enum; +using Pf2eModel.Model.Structure.DeityRelation; + +namespace Pf2eModel.Model.Structure; + +/// +/// Домен. +/// +[EntityOfType(EntityType.Domain)] +public class Domain : IEntity +{ + /// + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.None)] + [Column(Order = 1)] + [Comment("Идентификатор")] + public int Id { get; set; } + + /// + public Entity Entity { get; set; } = null!; + + /// + /// Идентификатор заклинания домена. + /// + [Column(Order = 2)] + [Comment("Заклинание домена")] + public int DomainSpellId { get; set; } + + /// + /// Идентификатор продвинутого заклинания домена. + /// + [Column(Order = 3)] + [Comment("Продвинутое заклинание домена")] + public int AdvancedDomainSpellId { get; set; } + + /// + /// Идентификатор апокрифического заклинания домена. + /// + [Column(Order = 4)] + [Comment("Апокрифическое заклинание домена")] + public int? ApocryphalSpellId { get; set; } + + /// + /// Идентификатор продвинутого апокрифического заклинания домена. + /// + [Column(Order = 5)] + [Comment("Продвинутое апокрифическое заклинание домена")] + public int? AdvancedApocryphalSpellId { get; set; } + + /// + /// Заклинание домена. + /// + public virtual Spell DomainSpell { get; set; } = null!; + + /// + /// Продвинутое заклинание домена. + /// + public virtual Spell AdvancedDomainSpell { get; set; } = null!; + + /// + /// Апокрифическое заклинание домена. + /// + public virtual Spell? ApocryphalSpell { get; set; } + + /// + /// Продвинутое апокрифическое заклинание домена. + /// + public virtual Spell? AdvancedApocryphalSpell { get; set; } + + /// + /// Связи с божествами, которые используют этот домен. + /// + public virtual ICollection DeityDomains { get; set; } = new List(); +} diff --git a/Pf2eModel/Pf2eDbContext.cs b/Pf2eModel/Pf2eDbContext.cs index 4d314e8..e816d5e 100644 --- a/Pf2eModel/Pf2eDbContext.cs +++ b/Pf2eModel/Pf2eDbContext.cs @@ -89,6 +89,8 @@ public partial class Pf2eDbContext : DbContext public virtual DbSet DeityWeapons { get; set; } + public virtual DbSet Domains { get; set; } + public virtual DbSet Entities { get; set; } public virtual DbSet EntityAliases { get; set; } @@ -161,7 +163,7 @@ public partial class Pf2eDbContext : DbContext .MapEnum() .MapEnum() .MapEnum() - .MapEnum() + .MapEnum() .MapEnum() .MapEnum() .MapEnum() diff --git a/Pf2eModel/Pf2eDbContextModel.cs b/Pf2eModel/Pf2eDbContextModel.cs index f203006..904d549 100644 --- a/Pf2eModel/Pf2eDbContextModel.cs +++ b/Pf2eModel/Pf2eDbContextModel.cs @@ -393,11 +393,53 @@ public partial class Pf2eDbContext BindEntity(entity); }); + // Domain + modelBuilder.Entity(entity => + { + BindEntity(entity); + + entity + .HasOne(d => d.DomainSpell) + .WithMany() + .HasForeignKey(d => d.DomainSpellId) + .OnDelete(DeleteBehavior.Cascade); + + entity + .HasOne(d => d.AdvancedDomainSpell) + .WithMany() + .HasForeignKey(d => d.AdvancedDomainSpellId) + .OnDelete(DeleteBehavior.Cascade); + + entity + .HasOne(d => d.ApocryphalSpell) + .WithMany() + .HasForeignKey(d => d.ApocryphalSpellId) + .OnDelete(DeleteBehavior.SetNull); + + entity + .HasOne(d => d.AdvancedApocryphalSpell) + .WithMany() + .HasForeignKey(d => d.AdvancedApocryphalSpellId) + .OnDelete(DeleteBehavior.SetNull); + + entity + .HasMany(d => d.DeityDomains) + .WithOne(dd => dd.Domain) + .HasForeignKey(dd => dd.DomainId) + .OnDelete(DeleteBehavior.Cascade); + }); + // Deity modelBuilder.Entity(entity => { BindEntity(entity); + BindLocaleString(entity, d => d.Anathema); + BindLocaleString(entity, d => d.Edicts); + BindLocaleString(entity, d => d.ReligiousSymbol); + BindLocaleString(entity, d => d.SacredAnimal); + BindLocaleString(entity, d => d.AreaOfConcern); + entity .HasMany(e => e.DeityAttributes) .WithOne(e => e.Deity)