diff --git a/Newsbot.Collector.Database/Migrations/20230619043102_MigrationFromGoose.Designer.cs b/Newsbot.Collector.Database/Migrations/20230619043102_MigrationFromGoose.Designer.cs new file mode 100644 index 0000000..b31a819 --- /dev/null +++ b/Newsbot.Collector.Database/Migrations/20230619043102_MigrationFromGoose.Designer.cs @@ -0,0 +1,223 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Newsbot.Collector.Database; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Newsbot.Collector.Database.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20230619043102_MigrationFromGoose")] + partial class MigrationFromGoose + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Newsbot.Collector.Domain.Entities.ArticlesEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuthorImage") + .HasColumnType("text"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("text"); + + b.Property("CodeIsCommit") + .HasColumnType("boolean"); + + b.Property("CodeIsRelease") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone"); + + b.Property("SourceId") + .HasColumnType("uuid"); + + b.Property("Tags") + .IsRequired() + .HasColumnType("text"); + + b.Property("Thumbnail") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .HasColumnType("text"); + + b.Property("Video") + .IsRequired() + .HasColumnType("text"); + + b.Property("VideoHeight") + .HasColumnType("integer"); + + b.Property("VideoWidth") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Articles"); + }); + + modelBuilder.Entity("Newsbot.Collector.Domain.Entities.DiscordQueueEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ArticleId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.ToTable("DiscordQueue"); + }); + + modelBuilder.Entity("Newsbot.Collector.Domain.Entities.DiscordWebhookEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Channel") + .IsRequired() + .HasColumnType("text"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Server") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("DiscordWebhooks"); + }); + + modelBuilder.Entity("Newsbot.Collector.Domain.Entities.IconEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("FileName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Site") + .IsRequired() + .HasColumnType("text"); + + b.Property("SourceId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.ToTable("Icons"); + }); + + modelBuilder.Entity("Newsbot.Collector.Domain.Entities.SourceEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Deleted") + .HasColumnType("boolean"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Site") + .IsRequired() + .HasColumnType("text"); + + b.Property("Source") + .IsRequired() + .HasColumnType("text"); + + b.Property("Tags") + .IsRequired() + .HasColumnType("text"); + + b.Property("Type") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.Property("YoutubeId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Sources"); + }); + + modelBuilder.Entity("Newsbot.Collector.Domain.Entities.SubscriptionEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CodeAllowCommits") + .HasColumnType("boolean"); + + b.Property("CodeAllowReleases") + .HasColumnType("boolean"); + + b.Property("DiscordWebHookId") + .HasColumnType("uuid"); + + b.Property("SourceId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.ToTable("Subscriptions"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Newsbot.Collector.Database/Migrations/20230619043102_MigrationFromGoose.cs b/Newsbot.Collector.Database/Migrations/20230619043102_MigrationFromGoose.cs new file mode 100644 index 0000000..122daeb --- /dev/null +++ b/Newsbot.Collector.Database/Migrations/20230619043102_MigrationFromGoose.cs @@ -0,0 +1,140 @@ +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"); + } + } +} diff --git a/Newsbot.Collector.Database/Migrations/DatabaseContextModelSnapshot.cs b/Newsbot.Collector.Database/Migrations/DatabaseContextModelSnapshot.cs new file mode 100644 index 0000000..a2c6ecb --- /dev/null +++ b/Newsbot.Collector.Database/Migrations/DatabaseContextModelSnapshot.cs @@ -0,0 +1,220 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Newsbot.Collector.Database; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Newsbot.Collector.Database.Migrations +{ + [DbContext(typeof(DatabaseContext))] + partial class DatabaseContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Newsbot.Collector.Domain.Entities.ArticlesEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuthorImage") + .HasColumnType("text"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("text"); + + b.Property("CodeIsCommit") + .HasColumnType("boolean"); + + b.Property("CodeIsRelease") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("PubDate") + .HasColumnType("timestamp with time zone"); + + b.Property("SourceId") + .HasColumnType("uuid"); + + b.Property("Tags") + .IsRequired() + .HasColumnType("text"); + + b.Property("Thumbnail") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .HasColumnType("text"); + + b.Property("Video") + .IsRequired() + .HasColumnType("text"); + + b.Property("VideoHeight") + .HasColumnType("integer"); + + b.Property("VideoWidth") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Articles"); + }); + + modelBuilder.Entity("Newsbot.Collector.Domain.Entities.DiscordQueueEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ArticleId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.ToTable("DiscordQueue"); + }); + + modelBuilder.Entity("Newsbot.Collector.Domain.Entities.DiscordWebhookEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Channel") + .IsRequired() + .HasColumnType("text"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Server") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("DiscordWebhooks"); + }); + + modelBuilder.Entity("Newsbot.Collector.Domain.Entities.IconEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("FileName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Site") + .IsRequired() + .HasColumnType("text"); + + b.Property("SourceId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.ToTable("Icons"); + }); + + modelBuilder.Entity("Newsbot.Collector.Domain.Entities.SourceEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Deleted") + .HasColumnType("boolean"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Site") + .IsRequired() + .HasColumnType("text"); + + b.Property("Source") + .IsRequired() + .HasColumnType("text"); + + b.Property("Tags") + .IsRequired() + .HasColumnType("text"); + + b.Property("Type") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.Property("Value") + .IsRequired() + .HasColumnType("text"); + + b.Property("YoutubeId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Sources"); + }); + + modelBuilder.Entity("Newsbot.Collector.Domain.Entities.SubscriptionEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CodeAllowCommits") + .HasColumnType("boolean"); + + b.Property("CodeAllowReleases") + .HasColumnType("boolean"); + + b.Property("DiscordWebHookId") + .HasColumnType("uuid"); + + b.Property("SourceId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.ToTable("Subscriptions"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Newsbot.Collector.Database/Migrations/20220522083756_init.sql b/Newsbot.Collector.Database/OldMigrations/20220522083756_init.sql similarity index 100% rename from Newsbot.Collector.Database/Migrations/20220522083756_init.sql rename to Newsbot.Collector.Database/OldMigrations/20220522083756_init.sql diff --git a/Newsbot.Collector.Database/Migrations/20220529082459_seed.sql b/Newsbot.Collector.Database/OldMigrations/20220529082459_seed.sql similarity index 100% rename from Newsbot.Collector.Database/Migrations/20220529082459_seed.sql rename to Newsbot.Collector.Database/OldMigrations/20220529082459_seed.sql diff --git a/Newsbot.Collector.Database/Migrations/20220619085634_subscriptions.sql b/Newsbot.Collector.Database/OldMigrations/20220619085634_subscriptions.sql similarity index 100% rename from Newsbot.Collector.Database/Migrations/20220619085634_subscriptions.sql rename to Newsbot.Collector.Database/OldMigrations/20220619085634_subscriptions.sql diff --git a/Newsbot.Collector.Database/Migrations/20221207213427_source_delete.sql b/Newsbot.Collector.Database/OldMigrations/20221207213427_source_delete.sql similarity index 100% rename from Newsbot.Collector.Database/Migrations/20221207213427_source_delete.sql rename to Newsbot.Collector.Database/OldMigrations/20221207213427_source_delete.sql diff --git a/Newsbot.Collector.Database/Migrations/20230316185340_sources_youtube_id.sql b/Newsbot.Collector.Database/OldMigrations/20230316185340_sources_youtube_id.sql similarity index 100% rename from Newsbot.Collector.Database/Migrations/20230316185340_sources_youtube_id.sql rename to Newsbot.Collector.Database/OldMigrations/20230316185340_sources_youtube_id.sql diff --git a/Newsbot.Collector.Database/Migrations/20230326223545_icon_sourceid.sql b/Newsbot.Collector.Database/OldMigrations/20230326223545_icon_sourceid.sql similarity index 100% rename from Newsbot.Collector.Database/Migrations/20230326223545_icon_sourceid.sql rename to Newsbot.Collector.Database/OldMigrations/20230326223545_icon_sourceid.sql diff --git a/Newsbot.Collector.Database/Migrations/20230411071020_article_code_columns.sql b/Newsbot.Collector.Database/OldMigrations/20230411071020_article_code_columns.sql similarity index 100% rename from Newsbot.Collector.Database/Migrations/20230411071020_article_code_columns.sql rename to Newsbot.Collector.Database/OldMigrations/20230411071020_article_code_columns.sql diff --git a/Newsbot.Collector.Database/Migrations/20230413203006_subscription_code_options.sql b/Newsbot.Collector.Database/OldMigrations/20230413203006_subscription_code_options.sql similarity index 100% rename from Newsbot.Collector.Database/Migrations/20230413203006_subscription_code_options.sql rename to Newsbot.Collector.Database/OldMigrations/20230413203006_subscription_code_options.sql diff --git a/Newsbot.Collector.Database/Migrations/20230413212643_icon_sourceid.sql b/Newsbot.Collector.Database/OldMigrations/20230413212643_icon_sourceid.sql similarity index 100% rename from Newsbot.Collector.Database/Migrations/20230413212643_icon_sourceid.sql rename to Newsbot.Collector.Database/OldMigrations/20230413212643_icon_sourceid.sql