|
| 1 | +using System; |
| 2 | +using Comicvine.Core; |
| 3 | +using Microsoft.EntityFrameworkCore.Migrations; |
| 4 | +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; |
| 5 | + |
| 6 | +#nullable disable |
| 7 | + |
| 8 | +namespace Comicvine.Database.Migrations |
| 9 | +{ |
| 10 | + /// <inheritdoc /> |
| 11 | + public partial class Initial : Migration |
| 12 | + { |
| 13 | + /// <inheritdoc /> |
| 14 | + protected override void Up(MigrationBuilder migrationBuilder) |
| 15 | + { |
| 16 | + migrationBuilder.CreateTable( |
| 17 | + name: "threads", |
| 18 | + columns: table => new |
| 19 | + { |
| 20 | + id = table.Column<int>(type: "integer", nullable: false) |
| 21 | + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), |
| 22 | + thread = table.Column<Parsers.Link>(type: "jsonb", nullable: true), |
| 23 | + board = table.Column<Parsers.Link>(type: "jsonb", nullable: true), |
| 24 | + is_pinned = table.Column<bool>(type: "boolean", nullable: false), |
| 25 | + is_locked = table.Column<bool>(type: "boolean", nullable: false), |
| 26 | + is_deleted = table.Column<bool>(type: "boolean", nullable: false), |
| 27 | + type = table.Column<int>(type: "integer", nullable: false), |
| 28 | + last_post_no = table.Column<int>(type: "integer", nullable: false), |
| 29 | + last_post_page = table.Column<int>(type: "integer", nullable: false), |
| 30 | + created = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
| 31 | + total_posts = table.Column<int>(type: "integer", nullable: false), |
| 32 | + total_view = table.Column<int>(type: "integer", nullable: false), |
| 33 | + creator = table.Column<Parsers.Link>(type: "jsonb", nullable: true), |
| 34 | + comments = table.Column<int[]>(type: "integer[]", nullable: true) |
| 35 | + }, |
| 36 | + constraints: table => |
| 37 | + { |
| 38 | + table.PrimaryKey("pk_threads", x => x.id); |
| 39 | + }); |
| 40 | + } |
| 41 | + |
| 42 | + /// <inheritdoc /> |
| 43 | + protected override void Down(MigrationBuilder migrationBuilder) |
| 44 | + { |
| 45 | + migrationBuilder.DropTable( |
| 46 | + name: "threads"); |
| 47 | + } |
| 48 | + } |
| 49 | +} |
0 commit comments