Skip to content

Commit 2387dc9

Browse files
committed
committed migrations
1 parent c9af71f commit 2387dc9

11 files changed

Lines changed: 1018 additions & 0 deletions

Comicvine.Database/Migrations/20230422112523_Initial.Designer.cs

Lines changed: 98 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
}

Comicvine.Database/Migrations/20230426200040_minor change in thread schema.Designer.cs

Lines changed: 98 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Microsoft.EntityFrameworkCore.Migrations;
2+
3+
#nullable disable
4+
5+
namespace Comicvine.Database.Migrations
6+
{
7+
/// <inheritdoc />
8+
public partial class minorchangeinthreadschema : Migration
9+
{
10+
/// <inheritdoc />
11+
protected override void Up(MigrationBuilder migrationBuilder)
12+
{
13+
migrationBuilder.RenameColumn(
14+
name: "comments",
15+
table: "threads",
16+
newName: "posts");
17+
}
18+
19+
/// <inheritdoc />
20+
protected override void Down(MigrationBuilder migrationBuilder)
21+
{
22+
migrationBuilder.RenameColumn(
23+
name: "posts",
24+
table: "threads",
25+
newName: "comments");
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)