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