docs: #292 db migration and some other changes and fixes

This commit is contained in:
Hamid Reza Mohammadi 2022-03-09 20:19:44 +03:30
parent e4d628c467
commit ac0372bb4f
10 changed files with 4105 additions and 16 deletions

View File

@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "5.0.5",
"version": "6.0.3",
"commands": [
"dotnet-ef"
]

View File

@ -15,6 +15,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

View File

@ -8,14 +8,14 @@
},
"AllowedHosts": "*",
"GoogleAnalyticsCode": "",
"APIRoot": "https://api.ganjoor.net",
"GlobalAPIRoot": "https://api.ganjoor.net",
"APIRoot": "http://localhost:3439",
"GlobalAPIRoot": "http://localhost:3439",
"SiteUrl": "http://localhost:33081",
"MockSpotify": "False",
"Spotify": {
"client_id": "",
"client_secret": "",
"Salt": ""
"Salt": ""
},
"AggressiveCacheEnabled": "False",
"ReadOnlyMode": "False",

View File

@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "6.0.0",
"version": "6.0.3",
"commands": [
"dotnet-ef"
]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,142 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RMuseum.Migrations
{
public partial class MultipleNewFields : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Language",
table: "GanjoorVerses",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Language",
table: "GanjoorPoems",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "MixedModeOrder",
table: "GanjoorPoems",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "Published",
table: "GanjoorPoems",
type: "bit",
nullable: false,
defaultValue: true);
migrationBuilder.AddColumn<bool>(
name: "NoIndex",
table: "GanjoorPages",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "RedirectFromFullUrl",
table: "GanjoorPages",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "CatType",
table: "GanjoorCategories",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "GanjoorCategories",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "DescriptionHtml",
table: "GanjoorCategories",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "MixedModeOrder",
table: "GanjoorCategories",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "Published",
table: "GanjoorCategories",
type: "bit",
nullable: false,
defaultValue: true);
migrationBuilder.AddColumn<int>(
name: "TableOfContentsStyle",
table: "GanjoorCategories",
type: "int",
nullable: false,
defaultValue: 0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Language",
table: "GanjoorVerses");
migrationBuilder.DropColumn(
name: "Language",
table: "GanjoorPoems");
migrationBuilder.DropColumn(
name: "MixedModeOrder",
table: "GanjoorPoems");
migrationBuilder.DropColumn(
name: "Published",
table: "GanjoorPoems");
migrationBuilder.DropColumn(
name: "NoIndex",
table: "GanjoorPages");
migrationBuilder.DropColumn(
name: "RedirectFromFullUrl",
table: "GanjoorPages");
migrationBuilder.DropColumn(
name: "CatType",
table: "GanjoorCategories");
migrationBuilder.DropColumn(
name: "Description",
table: "GanjoorCategories");
migrationBuilder.DropColumn(
name: "DescriptionHtml",
table: "GanjoorCategories");
migrationBuilder.DropColumn(
name: "MixedModeOrder",
table: "GanjoorCategories");
migrationBuilder.DropColumn(
name: "Published",
table: "GanjoorCategories");
migrationBuilder.DropColumn(
name: "TableOfContentsStyle",
table: "GanjoorCategories");
}
}
}

View File

@ -17,7 +17,7 @@ namespace RMuseum.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.1")
.HasAnnotation("ProductVersion", "6.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
@ -567,15 +567,33 @@ namespace RMuseum.Migrations
b.Property<int>("Id")
.HasColumnType("int");
b.Property<int>("CatType")
.HasColumnType("int");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<string>("DescriptionHtml")
.HasColumnType("nvarchar(max)");
b.Property<string>("FullUrl")
.HasColumnType("nvarchar(450)");
b.Property<int>("MixedModeOrder")
.HasColumnType("int");
b.Property<int?>("ParentId")
.HasColumnType("int");
b.Property<int>("PoetId")
.HasColumnType("int");
b.Property<bool>("Published")
.HasColumnType("bit");
b.Property<int>("TableOfContentsStyle")
.HasColumnType("int");
b.Property<string>("Title")
.HasColumnType("nvarchar(max)");
@ -915,6 +933,9 @@ namespace RMuseum.Migrations
b.Property<string>("HtmlText")
.HasColumnType("nvarchar(max)");
b.Property<bool>("NoIndex")
.HasColumnType("bit");
b.Property<int>("PageOrder")
.HasColumnType("int");
@ -933,6 +954,9 @@ namespace RMuseum.Migrations
b.Property<bool>("Published")
.HasColumnType("bit");
b.Property<string>("RedirectFromFullUrl")
.HasColumnType("nvarchar(max)");
b.Property<int?>("SecondPoetId")
.HasColumnType("int");
@ -1035,6 +1059,12 @@ namespace RMuseum.Migrations
b.Property<string>("HtmlText")
.HasColumnType("nvarchar(max)");
b.Property<string>("Language")
.HasColumnType("nvarchar(max)");
b.Property<int>("MixedModeOrder")
.HasColumnType("int");
b.Property<string>("OldTag")
.HasColumnType("nvarchar(max)");
@ -1044,6 +1074,9 @@ namespace RMuseum.Migrations
b.Property<string>("PlainText")
.HasColumnType("nvarchar(max)");
b.Property<bool>("Published")
.HasColumnType("bit");
b.Property<string>("RhymeLetters")
.HasColumnType("nvarchar(max)");
@ -1425,6 +1458,9 @@ namespace RMuseum.Migrations
b.Property<int?>("CoupletIndex")
.HasColumnType("int");
b.Property<string>("Language")
.HasColumnType("nvarchar(max)");
b.Property<int>("PoemId")
.HasColumnType("int");

View File

@ -1,5 +1,4 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace RMuseum.Models.Ganjoor
@ -78,7 +77,6 @@ namespace RMuseum.Models.Ganjoor
/// <summary>
/// published
/// </summary>
[DefaultValue(true)]
public bool Published { get; set; }
}
}

View File

@ -1,5 +1,4 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace RMuseum.Models.Ganjoor
@ -103,7 +102,6 @@ namespace RMuseum.Models.Ganjoor
/// <summary>
/// published
/// </summary>
[DefaultValue(true)]
public bool Published { get; set; }
/// <summary>

View File

@ -14,15 +14,15 @@
<ItemGroup>
<PackageReference Include="DNTPersianUtils.Core" Version="5.4.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.2">
<PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NAudio" Version="2.0.1" />
<PackageReference Include="RSecurityBackend" Version="1.0.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.3.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="7.0.2" />
<PackageReference Include="System.IO.Compression.ZipFile" Version="4.3.0" />
</ItemGroup>