using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace TransmissionRssManager.Migrations { /// public partial class AddUIFeatures : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "Category", table: "Torrents", type: "text", nullable: true); migrationBuilder.AddColumn( name: "DownloadSpeed", table: "Torrents", type: "double precision", nullable: false, defaultValue: 0.0); migrationBuilder.AddColumn( name: "DownloadedEver", table: "Torrents", type: "bigint", nullable: false, defaultValue: 0L); migrationBuilder.AddColumn( name: "HasMetadata", table: "Torrents", type: "boolean", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "PeersConnected", table: "Torrents", type: "integer", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "TransmissionInstance", table: "Torrents", type: "text", nullable: true); migrationBuilder.AddColumn( name: "UploadSpeed", table: "Torrents", type: "double precision", nullable: false, defaultValue: 0.0); migrationBuilder.AddColumn( name: "UploadedEver", table: "Torrents", type: "bigint", nullable: false, defaultValue: 0L); migrationBuilder.AddColumn( name: "DefaultCategory", table: "RssFeeds", type: "text", nullable: true); migrationBuilder.AddColumn( name: "ErrorCount", table: "RssFeeds", type: "integer", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "MaxHistoryItems", table: "RssFeeds", type: "integer", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "Schedule", table: "RssFeeds", type: "text", nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "TransmissionInstanceId", table: "RssFeeds", type: "text", nullable: true); migrationBuilder.CreateTable( name: "SystemLogs", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Timestamp = table.Column(type: "timestamp with time zone", nullable: false), Level = table.Column(type: "text", nullable: false), Message = table.Column(type: "text", nullable: false), Context = table.Column(type: "text", nullable: true), Properties = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_SystemLogs", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "SystemLogs"); migrationBuilder.DropColumn( name: "Category", table: "Torrents"); migrationBuilder.DropColumn( name: "DownloadSpeed", table: "Torrents"); migrationBuilder.DropColumn( name: "DownloadedEver", table: "Torrents"); migrationBuilder.DropColumn( name: "HasMetadata", table: "Torrents"); migrationBuilder.DropColumn( name: "PeersConnected", table: "Torrents"); migrationBuilder.DropColumn( name: "TransmissionInstance", table: "Torrents"); migrationBuilder.DropColumn( name: "UploadSpeed", table: "Torrents"); migrationBuilder.DropColumn( name: "UploadedEver", table: "Torrents"); migrationBuilder.DropColumn( name: "DefaultCategory", table: "RssFeeds"); migrationBuilder.DropColumn( name: "ErrorCount", table: "RssFeeds"); migrationBuilder.DropColumn( name: "MaxHistoryItems", table: "RssFeeds"); migrationBuilder.DropColumn( name: "Schedule", table: "RssFeeds"); migrationBuilder.DropColumn( name: "TransmissionInstanceId", table: "RssFeeds"); } } }