Newsbot.Collector/Newsbot.Collector.Database/Migrations/20230619043102_MigrationFro...

141 lines
6.1 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.Extensions.Configuration;
#nullable disable
namespace Newsbot.Collector.Database.Migrations
{
/// <inheritdoc />
public partial class MigrationFromGoose : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Articles",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
SourceId = table.Column<Guid>(type: "uuid", nullable: false),
Tags = table.Column<string>(type: "text", nullable: false),
Title = table.Column<string>(type: "text", nullable: false),
Url = table.Column<string>(type: "text", nullable: true),
PubDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
Video = table.Column<string>(type: "text", nullable: false),
VideoHeight = table.Column<int>(type: "integer", nullable: false),
VideoWidth = table.Column<int>(type: "integer", nullable: false),
Thumbnail = table.Column<string>(type: "text", nullable: false),
Description = table.Column<string>(type: "text", nullable: false),
AuthorName = table.Column<string>(type: "text", nullable: false),
AuthorImage = table.Column<string>(type: "text", nullable: true),
CodeIsRelease = table.Column<bool>(type: "boolean", nullable: false),
CodeIsCommit = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Articles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "DiscordQueue",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
ArticleId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DiscordQueue", x => x.Id);
});
migrationBuilder.CreateTable(
name: "DiscordWebhooks",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Url = table.Column<string>(type: "text", nullable: false),
Server = table.Column<string>(type: "text", nullable: false),
Channel = table.Column<string>(type: "text", nullable: false),
Enabled = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DiscordWebhooks", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Icons",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
FileName = table.Column<string>(type: "text", nullable: false),
Site = table.Column<string>(type: "text", nullable: false),
SourceId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Icons", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Sources",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Site = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Source = table.Column<string>(type: "text", nullable: false),
Type = table.Column<string>(type: "text", nullable: false),
Value = table.Column<string>(type: "text", nullable: false),
Enabled = table.Column<bool>(type: "boolean", nullable: false),
Url = table.Column<string>(type: "text", nullable: false),
Tags = table.Column<string>(type: "text", nullable: false),
Deleted = table.Column<bool>(type: "boolean", nullable: false),
YoutubeId = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Sources", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Subscriptions",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CodeAllowReleases = table.Column<bool>(type: "boolean", nullable: false),
CodeAllowCommits = table.Column<bool>(type: "boolean", nullable: false),
SourceId = table.Column<Guid>(type: "uuid", nullable: false),
DiscordWebHookId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Subscriptions", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Articles");
migrationBuilder.DropTable(
name: "DiscordQueue");
migrationBuilder.DropTable(
name: "DiscordWebhooks");
migrationBuilder.DropTable(
name: "Icons");
migrationBuilder.DropTable(
name: "Sources");
migrationBuilder.DropTable(
name: "Subscriptions");
}
}
}