From 494fc9d7d1f08e05e1ee196bd0746900343b51dd Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Mon, 16 Jan 2023 00:13:54 +0100 Subject: feat: Fully implemented text/file api, almost finished autodelete service --- .../20230112230354_InitialCreate.Designer.cs | 2 +- .../20230115182252_DeletionKey.Designer.cs | 122 +++++++++++++++++++++ src/Migrations/20230115182252_DeletionKey.cs | 40 +++++++ src/Migrations/DBModelSnapshot.cs | 10 +- 4 files changed, 172 insertions(+), 2 deletions(-) create mode 100644 src/Migrations/20230115182252_DeletionKey.Designer.cs create mode 100644 src/Migrations/20230115182252_DeletionKey.cs (limited to 'src/Migrations') diff --git a/src/Migrations/20230112230354_InitialCreate.Designer.cs b/src/Migrations/20230112230354_InitialCreate.Designer.cs index b5a06c3..1928f19 100644 --- a/src/Migrations/20230112230354_InitialCreate.Designer.cs +++ b/src/Migrations/20230112230354_InitialCreate.Designer.cs @@ -10,7 +10,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace BlobBin.Migrations { - [DbContext(typeof(DB))] + [DbContext(typeof(Eva))] [Migration("20230112230354_InitialCreate")] partial class InitialCreate { diff --git a/src/Migrations/20230115182252_DeletionKey.Designer.cs b/src/Migrations/20230115182252_DeletionKey.Designer.cs new file mode 100644 index 0000000..baf9730 --- /dev/null +++ b/src/Migrations/20230115182252_DeletionKey.Designer.cs @@ -0,0 +1,122 @@ +// +using System; +using BlobBin; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace BlobBin.Migrations +{ + [DbContext(typeof(Eva))] + [Migration("20230115182252_DeletionKey")] + partial class DeletionKey + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "7.0.2"); + + modelBuilder.Entity("BlobBin.File", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("AutoDeleteAfter") + .HasColumnType("TEXT"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DeletedAt") + .HasColumnType("TEXT"); + + b.Property("DeletionKey") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Length") + .HasColumnType("INTEGER"); + + b.Property("MimeType") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("PasswordHash") + .HasColumnType("TEXT"); + + b.Property("PublicId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Singleton") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Files"); + }); + + modelBuilder.Entity("BlobBin.Paste", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("AutoDeleteAfter") + .HasColumnType("TEXT"); + + b.Property("Content") + .HasColumnType("TEXT"); + + b.Property("CreatedAt") + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("DeletedAt") + .HasColumnType("TEXT"); + + b.Property("DeletionKey") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Length") + .HasColumnType("INTEGER"); + + b.Property("MimeType") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("PasswordHash") + .HasColumnType("TEXT"); + + b.Property("PublicId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Singleton") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Pastes"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Migrations/20230115182252_DeletionKey.cs b/src/Migrations/20230115182252_DeletionKey.cs new file mode 100644 index 0000000..3feba6b --- /dev/null +++ b/src/Migrations/20230115182252_DeletionKey.cs @@ -0,0 +1,40 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BlobBin.Migrations +{ + /// + public partial class DeletionKey : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "DeletionKey", + table: "Pastes", + type: "TEXT", + nullable: false, + defaultValue: ""); + + migrationBuilder.AddColumn( + name: "DeletionKey", + table: "Files", + type: "TEXT", + nullable: false, + defaultValue: ""); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "DeletionKey", + table: "Pastes"); + + migrationBuilder.DropColumn( + name: "DeletionKey", + table: "Files"); + } + } +} diff --git a/src/Migrations/DBModelSnapshot.cs b/src/Migrations/DBModelSnapshot.cs index 8c9fb26..e63af59 100644 --- a/src/Migrations/DBModelSnapshot.cs +++ b/src/Migrations/DBModelSnapshot.cs @@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace BlobBin.Migrations { - [DbContext(typeof(DB))] + [DbContext(typeof(Eva))] partial class DBModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) @@ -36,6 +36,10 @@ namespace BlobBin.Migrations b.Property("DeletedAt") .HasColumnType("TEXT"); + b.Property("DeletionKey") + .IsRequired() + .HasColumnType("TEXT"); + b.Property("Length") .HasColumnType("INTEGER"); @@ -82,6 +86,10 @@ namespace BlobBin.Migrations b.Property("DeletedAt") .HasColumnType("TEXT"); + b.Property("DeletionKey") + .IsRequired() + .HasColumnType("TEXT"); + b.Property("Length") .HasColumnType("INTEGER"); -- cgit v1.3