20220326104916_UploadedResourcesLog.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
  4. #nullable disable
  5. namespace Content.Server.Database.Migrations.Postgres
  6. {
  7. public partial class UploadedResourcesLog : Migration
  8. {
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.CreateTable(
  12. name: "uploaded_resource_log",
  13. columns: table => new
  14. {
  15. uploaded_resource_log_id = table.Column<int>(type: "integer", nullable: false)
  16. .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
  17. date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
  18. user_id = table.Column<Guid>(type: "uuid", nullable: false),
  19. path = table.Column<string>(type: "text", nullable: false),
  20. data = table.Column<byte[]>(type: "bytea", nullable: false)
  21. },
  22. constraints: table =>
  23. {
  24. table.PrimaryKey("PK_uploaded_resource_log", x => x.uploaded_resource_log_id);
  25. });
  26. }
  27. protected override void Down(MigrationBuilder migrationBuilder)
  28. {
  29. migrationBuilder.DropTable(
  30. name: "uploaded_resource_log");
  31. }
  32. }
  33. }