Database migration, repository, controller and service
This commit is contained in:
1 parent
07e4e6b381
commit
4fb8768807
17 files changed
+368
-44
No files matched your search
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PaperlessAI.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Init : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterDatabase()
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PaperlessDocuments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
DocumentId = table.Column<long>(type: "bigint", nullable: false),
|
||||
DocumentState = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false),
|
||||
ModifiedAt = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PaperlessDocuments", x => x.Id);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.Annotation("Relational:Collation", "utf8mb4_uca1400_ai_ci");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PaperlessDocuments_DocumentId",
|
||||
table: "PaperlessDocuments",
|
||||
column: "DocumentId",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PaperlessDocuments");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user