Files
parr_api/PARR.DAL/Migrations/20230619021829_SchedulerClmnsToJob.cs
Mikhail Kuznetsov 9c19e2fb91 JobStatus init
2023-06-20 12:29:58 +10:00

73 lines
2.5 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PARR.DAL.Migrations
{
/// <inheritdoc />
public partial class SchedulerClmnsToJob : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Schedulers");
migrationBuilder.AddColumn<int>(
name: "Frequency",
table: "Jobs",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "IsEnabled",
table: "Jobs",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<DateTimeOffset>(
name: "StartAt",
table: "Jobs",
type: "timestamp with time zone",
nullable: false,
defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Frequency",
table: "Jobs");
migrationBuilder.DropColumn(
name: "IsEnabled",
table: "Jobs");
migrationBuilder.DropColumn(
name: "StartAt",
table: "Jobs");
migrationBuilder.CreateTable(
name: "Schedulers",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
Frequency = table.Column<int>(type: "integer", nullable: false),
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
Name = table.Column<string>(type: "text", nullable: true),
StartAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Schedulers", x => x.Id);
});
}
}
}