diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-09-02 11:10:03 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2023-09-02 11:10:03 +1000 |
| commit | 693357f3e35e4141f17c55e182e89f05ae8d0ecb (patch) | |
| tree | 624badcf11b20fa77a773ecf480191a6d225ab49 /Migrations/20230831162159_MediaOcr.cs | |
| parent | cf26fe6d6883a8603303ff39969b068b7902858a (diff) | |
| parent | 11f8eac60abfd52d59e84ba7b3c1c1c042c03941 (diff) | |
Merge branch 'dev' of gitlab.com:plasmicplexus/HyperBooru-Server into dev
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"); + } + } +} |
