diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-09-01 13:03:57 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2023-09-01 13:03:57 +1000 |
| commit | 11f8eac60abfd52d59e84ba7b3c1c1c042c03941 (patch) | |
| tree | 5801c55afd9682f7fd6a0e2480417ee87af9465e /Migrations/20230831162159_MediaOcr.cs | |
| parent | 9d4c33a4cdd1b82db831ca6c71e8fdc2f9f63f58 (diff) | |
Merged OCR functionality
Diffstat (limited to 'Migrations/20230831162159_MediaOcr.cs')
| -rw-r--r-- | Migrations/20230831162159_MediaOcr.cs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Migrations/20230831162159_MediaOcr.cs b/Migrations/20230831162159_MediaOcr.cs new file mode 100644 index 0000000..02f6185 --- /dev/null +++ b/Migrations/20230831162159_MediaOcr.cs @@ -0,0 +1,51 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace HyperBooru.Migrations +{ + /// <inheritdoc /> + public partial class MediaOcr : Migration + { + /// <inheritdoc /> + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "OcrData", + columns: table => new + { + OcrDataId = table.Column<int>(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + MediaId = table.Column<int>(type: "integer", nullable: false), + Text = table.Column<string>(type: "text", nullable: false), + SearchableText = table.Column<string>(type: "text", nullable: false), + Timestamp = table.Column<DateTime>(type: "timestamp with time zone", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_OcrData", x => x.OcrDataId); + table.ForeignKey( + name: "FK_OcrData_Media_MediaId", + column: x => x.MediaId, + principalTable: "Media", + principalColumn: "ObjectId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_OcrData_MediaId", + table: "OcrData", + column: "MediaId", + unique: true); + } + + /// <inheritdoc /> + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "OcrData"); + } + } +} |
