mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Adds editorconfig and refactors to the established rules
This commit is contained in:
1 parent
712a0f2b27
commit
cd44f11d9e
138 files changed
+1799
-1629
No files matched your search
@@ -1,216 +1,206 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using System;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Lumina.DataAccess.Common.Migrations
|
||||
namespace Lumina.DataAccess.Common.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class InitialMigration : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialMigration : Migration
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Books",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Title = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
|
||||
OriginalTitle = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
|
||||
Description = table.Column<string>(type: "TEXT", maxLength: 2000, nullable: true),
|
||||
OriginalReleaseDate = table.Column<DateOnly>(type: "TEXT", nullable: true),
|
||||
OriginalReleaseYear = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
ReReleaseDate = table.Column<DateOnly>(type: "TEXT", nullable: true),
|
||||
ReReleaseYear = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
ReleaseCountry = table.Column<string>(type: "TEXT", nullable: true),
|
||||
ReleaseVersion = table.Column<string>(type: "TEXT", nullable: true),
|
||||
LanguageCode = table.Column<string>(type: "TEXT", nullable: true),
|
||||
LanguageName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
LanguageNativeName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
OriginalLanguageCode = table.Column<string>(type: "TEXT", nullable: true),
|
||||
OriginalLanguageName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
OriginalLanguageNativeName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Publisher = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
PageCount = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
Format = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Edition = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
|
||||
VolumeNumber = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
ASIN = table.Column<string>(type: "TEXT", maxLength: 10, nullable: true),
|
||||
GoodreadsId = table.Column<string>(type: "TEXT", nullable: true),
|
||||
LCCN = table.Column<string>(type: "TEXT", nullable: true),
|
||||
OCLCNumber = table.Column<string>(type: "TEXT", nullable: true),
|
||||
OpenLibraryId = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
|
||||
LibraryThingId = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
|
||||
GoogleBooksId = table.Column<string>(type: "TEXT", maxLength: 12, nullable: true),
|
||||
BarnesAndNobleId = table.Column<string>(type: "TEXT", maxLength: 10, nullable: true),
|
||||
AppleBooksId = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Created = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
Updated = table.Column<DateTime>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Books", x => x.Id);
|
||||
});
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Books",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Title = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
|
||||
OriginalTitle = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
|
||||
Description = table.Column<string>(type: "TEXT", maxLength: 2000, nullable: true),
|
||||
OriginalReleaseDate = table.Column<DateOnly>(type: "TEXT", nullable: true),
|
||||
OriginalReleaseYear = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
ReReleaseDate = table.Column<DateOnly>(type: "TEXT", nullable: true),
|
||||
ReReleaseYear = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
ReleaseCountry = table.Column<string>(type: "TEXT", nullable: true),
|
||||
ReleaseVersion = table.Column<string>(type: "TEXT", nullable: true),
|
||||
LanguageCode = table.Column<string>(type: "TEXT", nullable: true),
|
||||
LanguageName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
LanguageNativeName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
OriginalLanguageCode = table.Column<string>(type: "TEXT", nullable: true),
|
||||
OriginalLanguageName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
OriginalLanguageNativeName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Publisher = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
|
||||
PageCount = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
Format = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Edition = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
|
||||
VolumeNumber = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
ASIN = table.Column<string>(type: "TEXT", maxLength: 10, nullable: true),
|
||||
GoodreadsId = table.Column<string>(type: "TEXT", nullable: true),
|
||||
LCCN = table.Column<string>(type: "TEXT", nullable: true),
|
||||
OCLCNumber = table.Column<string>(type: "TEXT", nullable: true),
|
||||
OpenLibraryId = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
|
||||
LibraryThingId = table.Column<string>(type: "TEXT", maxLength: 50, nullable: true),
|
||||
GoogleBooksId = table.Column<string>(type: "TEXT", maxLength: 12, nullable: true),
|
||||
BarnesAndNobleId = table.Column<string>(type: "TEXT", maxLength: 10, nullable: true),
|
||||
AppleBooksId = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Created = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
Updated = table.Column<DateTime>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table => table.PrimaryKey("PK_Books", x => x.Id));
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Genres",
|
||||
columns: table => new
|
||||
{
|
||||
Name = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Genres", x => x.Name);
|
||||
});
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Genres",
|
||||
columns: table => new
|
||||
{
|
||||
Name = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false)
|
||||
},
|
||||
constraints: table => table.PrimaryKey("PK_Genres", x => x.Name));
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tags",
|
||||
columns: table => new
|
||||
{
|
||||
Name = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tags", x => x.Name);
|
||||
});
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tags",
|
||||
columns: table => new
|
||||
{
|
||||
Name = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false)
|
||||
},
|
||||
constraints: table => table.PrimaryKey("PK_Tags", x => x.Name));
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BookISBNs",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ISBN = table.Column<string>(type: "TEXT", maxLength: 13, nullable: false),
|
||||
Format = table.Column<string>(type: "TEXT", maxLength: 6, nullable: false),
|
||||
BookId = table.Column<Guid>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BookISBNs", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_BookISBNs_Books_BookId",
|
||||
column: x => x.BookId,
|
||||
principalTable: "Books",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BookISBNs",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ISBN = table.Column<string>(type: "TEXT", maxLength: 13, nullable: false),
|
||||
Format = table.Column<string>(type: "TEXT", maxLength: 6, nullable: false),
|
||||
BookId = table.Column<Guid>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BookISBNs", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_BookISBNs_Books_BookId",
|
||||
column: x => x.BookId,
|
||||
principalTable: "Books",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BookRatings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Source = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
|
||||
BookId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Value = table.Column<decimal>(type: "decimal(3,2)", nullable: false),
|
||||
MaxValue = table.Column<decimal>(type: "decimal(3,2)", nullable: false),
|
||||
VoteCount = table.Column<int>(type: "INTEGER", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BookRatings", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_BookRatings_Books_BookId",
|
||||
column: x => x.BookId,
|
||||
principalTable: "Books",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BookRatings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Source = table.Column<string>(type: "TEXT", maxLength: 50, nullable: false),
|
||||
BookId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Value = table.Column<decimal>(type: "decimal(3,2)", nullable: false),
|
||||
MaxValue = table.Column<decimal>(type: "decimal(3,2)", nullable: false),
|
||||
VoteCount = table.Column<int>(type: "INTEGER", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BookRatings", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_BookRatings_Books_BookId",
|
||||
column: x => x.BookId,
|
||||
principalTable: "Books",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BookGenres",
|
||||
columns: table => new
|
||||
{
|
||||
BookId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
GenreId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BookGenres", x => new { x.BookId, x.GenreId });
|
||||
table.ForeignKey(
|
||||
name: "FK_BookGenres_Books_BookId",
|
||||
column: x => x.BookId,
|
||||
principalTable: "Books",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_BookGenres_Genres_GenreId",
|
||||
column: x => x.GenreId,
|
||||
principalTable: "Genres",
|
||||
principalColumn: "Name",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BookGenres",
|
||||
columns: table => new
|
||||
{
|
||||
BookId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
GenreId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BookGenres", x => new { x.BookId, x.GenreId });
|
||||
table.ForeignKey(
|
||||
name: "FK_BookGenres_Books_BookId",
|
||||
column: x => x.BookId,
|
||||
principalTable: "Books",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_BookGenres_Genres_GenreId",
|
||||
column: x => x.GenreId,
|
||||
principalTable: "Genres",
|
||||
principalColumn: "Name",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BookTags",
|
||||
columns: table => new
|
||||
{
|
||||
BookId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
TagId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BookTags", x => new { x.BookId, x.TagId });
|
||||
table.ForeignKey(
|
||||
name: "FK_BookTags_Books_BookId",
|
||||
column: x => x.BookId,
|
||||
principalTable: "Books",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_BookTags_Tags_TagId",
|
||||
column: x => x.TagId,
|
||||
principalTable: "Tags",
|
||||
principalColumn: "Name",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BookTags",
|
||||
columns: table => new
|
||||
{
|
||||
BookId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
TagId = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BookTags", x => new { x.BookId, x.TagId });
|
||||
table.ForeignKey(
|
||||
name: "FK_BookTags_Books_BookId",
|
||||
column: x => x.BookId,
|
||||
principalTable: "Books",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_BookTags_Tags_TagId",
|
||||
column: x => x.TagId,
|
||||
principalTable: "Tags",
|
||||
principalColumn: "Name",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BookGenres_GenreId",
|
||||
table: "BookGenres",
|
||||
column: "GenreId");
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BookGenres_GenreId",
|
||||
table: "BookGenres",
|
||||
column: "GenreId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BookISBNs_BookId",
|
||||
table: "BookISBNs",
|
||||
column: "BookId");
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BookISBNs_BookId",
|
||||
table: "BookISBNs",
|
||||
column: "BookId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BookRatings_BookId",
|
||||
table: "BookRatings",
|
||||
column: "BookId");
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BookRatings_BookId",
|
||||
table: "BookRatings",
|
||||
column: "BookId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BookTags_TagId",
|
||||
table: "BookTags",
|
||||
column: "TagId");
|
||||
}
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BookTags_TagId",
|
||||
table: "BookTags",
|
||||
column: "TagId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "BookGenres");
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "BookGenres");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "BookISBNs");
|
||||
migrationBuilder.DropTable(
|
||||
name: "BookISBNs");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "BookRatings");
|
||||
migrationBuilder.DropTable(
|
||||
name: "BookRatings");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "BookTags");
|
||||
migrationBuilder.DropTable(
|
||||
name: "BookTags");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Genres");
|
||||
migrationBuilder.DropTable(
|
||||
name: "Genres");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Books");
|
||||
migrationBuilder.DropTable(
|
||||
name: "Books");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Tags");
|
||||
}
|
||||
migrationBuilder.DropTable(
|
||||
name: "Tags");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user