374 lines
18 KiB
C#
374 lines
18 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace FictionArchive.Service.SchedulerService.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Initial : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.EnsureSchema(
|
|
name: "quartz");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "qrtz_calendars",
|
|
schema: "quartz",
|
|
columns: table => new
|
|
{
|
|
sched_name = table.Column<string>(type: "text", nullable: false),
|
|
calendar_name = table.Column<string>(type: "text", nullable: false),
|
|
calendar = table.Column<byte[]>(type: "bytea", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_qrtz_calendars", x => new { x.sched_name, x.calendar_name });
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "qrtz_fired_triggers",
|
|
schema: "quartz",
|
|
columns: table => new
|
|
{
|
|
sched_name = table.Column<string>(type: "text", nullable: false),
|
|
entry_id = table.Column<string>(type: "text", nullable: false),
|
|
trigger_name = table.Column<string>(type: "text", nullable: false),
|
|
trigger_group = table.Column<string>(type: "text", nullable: false),
|
|
instance_name = table.Column<string>(type: "text", nullable: false),
|
|
fired_time = table.Column<long>(type: "bigint", nullable: false),
|
|
sched_time = table.Column<long>(type: "bigint", nullable: false),
|
|
priority = table.Column<int>(type: "integer", nullable: false),
|
|
state = table.Column<string>(type: "text", nullable: false),
|
|
job_name = table.Column<string>(type: "text", nullable: true),
|
|
job_group = table.Column<string>(type: "text", nullable: true),
|
|
is_nonconcurrent = table.Column<bool>(type: "bool", nullable: false),
|
|
requests_recovery = table.Column<bool>(type: "bool", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_qrtz_fired_triggers", x => new { x.sched_name, x.entry_id });
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "qrtz_job_details",
|
|
schema: "quartz",
|
|
columns: table => new
|
|
{
|
|
sched_name = table.Column<string>(type: "text", nullable: false),
|
|
job_name = table.Column<string>(type: "text", nullable: false),
|
|
job_group = table.Column<string>(type: "text", nullable: false),
|
|
description = table.Column<string>(type: "text", nullable: true),
|
|
job_class_name = table.Column<string>(type: "text", nullable: false),
|
|
is_durable = table.Column<bool>(type: "bool", nullable: false),
|
|
is_nonconcurrent = table.Column<bool>(type: "bool", nullable: false),
|
|
is_update_data = table.Column<bool>(type: "bool", nullable: false),
|
|
requests_recovery = table.Column<bool>(type: "bool", nullable: false),
|
|
job_data = table.Column<byte[]>(type: "bytea", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_qrtz_job_details", x => new { x.sched_name, x.job_name, x.job_group });
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "qrtz_locks",
|
|
schema: "quartz",
|
|
columns: table => new
|
|
{
|
|
sched_name = table.Column<string>(type: "text", nullable: false),
|
|
lock_name = table.Column<string>(type: "text", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_qrtz_locks", x => new { x.sched_name, x.lock_name });
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "qrtz_paused_trigger_grps",
|
|
schema: "quartz",
|
|
columns: table => new
|
|
{
|
|
sched_name = table.Column<string>(type: "text", nullable: false),
|
|
trigger_group = table.Column<string>(type: "text", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_qrtz_paused_trigger_grps", x => new { x.sched_name, x.trigger_group });
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "qrtz_scheduler_state",
|
|
schema: "quartz",
|
|
columns: table => new
|
|
{
|
|
sched_name = table.Column<string>(type: "text", nullable: false),
|
|
instance_name = table.Column<string>(type: "text", nullable: false),
|
|
last_checkin_time = table.Column<long>(type: "bigint", nullable: false),
|
|
checkin_interval = table.Column<long>(type: "bigint", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_qrtz_scheduler_state", x => new { x.sched_name, x.instance_name });
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "qrtz_triggers",
|
|
schema: "quartz",
|
|
columns: table => new
|
|
{
|
|
sched_name = table.Column<string>(type: "text", nullable: false),
|
|
trigger_name = table.Column<string>(type: "text", nullable: false),
|
|
trigger_group = table.Column<string>(type: "text", nullable: false),
|
|
job_name = table.Column<string>(type: "text", nullable: false),
|
|
job_group = table.Column<string>(type: "text", nullable: false),
|
|
description = table.Column<string>(type: "text", nullable: true),
|
|
next_fire_time = table.Column<long>(type: "bigint", nullable: true),
|
|
prev_fire_time = table.Column<long>(type: "bigint", nullable: true),
|
|
priority = table.Column<int>(type: "integer", nullable: true),
|
|
trigger_state = table.Column<string>(type: "text", nullable: false),
|
|
trigger_type = table.Column<string>(type: "text", nullable: false),
|
|
start_time = table.Column<long>(type: "bigint", nullable: false),
|
|
end_time = table.Column<long>(type: "bigint", nullable: true),
|
|
calendar_name = table.Column<string>(type: "text", nullable: true),
|
|
misfire_instr = table.Column<short>(type: "smallint", nullable: true),
|
|
job_data = table.Column<byte[]>(type: "bytea", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_qrtz_triggers", x => new { x.sched_name, x.trigger_name, x.trigger_group });
|
|
table.ForeignKey(
|
|
name: "FK_qrtz_triggers_qrtz_job_details_sched_name_job_name_job_group",
|
|
columns: x => new { x.sched_name, x.job_name, x.job_group },
|
|
principalSchema: "quartz",
|
|
principalTable: "qrtz_job_details",
|
|
principalColumns: new[] { "sched_name", "job_name", "job_group" },
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "qrtz_blob_triggers",
|
|
schema: "quartz",
|
|
columns: table => new
|
|
{
|
|
sched_name = table.Column<string>(type: "text", nullable: false),
|
|
trigger_name = table.Column<string>(type: "text", nullable: false),
|
|
trigger_group = table.Column<string>(type: "text", nullable: false),
|
|
blob_data = table.Column<byte[]>(type: "bytea", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_qrtz_blob_triggers", x => new { x.sched_name, x.trigger_name, x.trigger_group });
|
|
table.ForeignKey(
|
|
name: "FK_qrtz_blob_triggers_qrtz_triggers_sched_name_trigger_name_tr~",
|
|
columns: x => new { x.sched_name, x.trigger_name, x.trigger_group },
|
|
principalSchema: "quartz",
|
|
principalTable: "qrtz_triggers",
|
|
principalColumns: new[] { "sched_name", "trigger_name", "trigger_group" },
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "qrtz_cron_triggers",
|
|
schema: "quartz",
|
|
columns: table => new
|
|
{
|
|
sched_name = table.Column<string>(type: "text", nullable: false),
|
|
trigger_name = table.Column<string>(type: "text", nullable: false),
|
|
trigger_group = table.Column<string>(type: "text", nullable: false),
|
|
cron_expression = table.Column<string>(type: "text", nullable: false),
|
|
time_zone_id = table.Column<string>(type: "text", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_qrtz_cron_triggers", x => new { x.sched_name, x.trigger_name, x.trigger_group });
|
|
table.ForeignKey(
|
|
name: "FK_qrtz_cron_triggers_qrtz_triggers_sched_name_trigger_name_tr~",
|
|
columns: x => new { x.sched_name, x.trigger_name, x.trigger_group },
|
|
principalSchema: "quartz",
|
|
principalTable: "qrtz_triggers",
|
|
principalColumns: new[] { "sched_name", "trigger_name", "trigger_group" },
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "qrtz_simple_triggers",
|
|
schema: "quartz",
|
|
columns: table => new
|
|
{
|
|
sched_name = table.Column<string>(type: "text", nullable: false),
|
|
trigger_name = table.Column<string>(type: "text", nullable: false),
|
|
trigger_group = table.Column<string>(type: "text", nullable: false),
|
|
repeat_count = table.Column<long>(type: "bigint", nullable: false),
|
|
repeat_interval = table.Column<long>(type: "bigint", nullable: false),
|
|
times_triggered = table.Column<long>(type: "bigint", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_qrtz_simple_triggers", x => new { x.sched_name, x.trigger_name, x.trigger_group });
|
|
table.ForeignKey(
|
|
name: "FK_qrtz_simple_triggers_qrtz_triggers_sched_name_trigger_name_~",
|
|
columns: x => new { x.sched_name, x.trigger_name, x.trigger_group },
|
|
principalSchema: "quartz",
|
|
principalTable: "qrtz_triggers",
|
|
principalColumns: new[] { "sched_name", "trigger_name", "trigger_group" },
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "qrtz_simprop_triggers",
|
|
schema: "quartz",
|
|
columns: table => new
|
|
{
|
|
sched_name = table.Column<string>(type: "text", nullable: false),
|
|
trigger_name = table.Column<string>(type: "text", nullable: false),
|
|
trigger_group = table.Column<string>(type: "text", nullable: false),
|
|
str_prop_1 = table.Column<string>(type: "text", nullable: true),
|
|
str_prop_2 = table.Column<string>(type: "text", nullable: true),
|
|
str_prop_3 = table.Column<string>(type: "text", nullable: true),
|
|
int_prop_1 = table.Column<int>(type: "integer", nullable: true),
|
|
int_prop_2 = table.Column<int>(type: "integer", nullable: true),
|
|
long_prop_1 = table.Column<long>(type: "bigint", nullable: true),
|
|
long_prop_2 = table.Column<long>(type: "bigint", nullable: true),
|
|
dec_prop_1 = table.Column<decimal>(type: "numeric", nullable: true),
|
|
dec_prop_2 = table.Column<decimal>(type: "numeric", nullable: true),
|
|
bool_prop_1 = table.Column<bool>(type: "bool", nullable: true),
|
|
bool_prop_2 = table.Column<bool>(type: "bool", nullable: true),
|
|
time_zone_id = table.Column<string>(type: "text", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_qrtz_simprop_triggers", x => new { x.sched_name, x.trigger_name, x.trigger_group });
|
|
table.ForeignKey(
|
|
name: "FK_qrtz_simprop_triggers_qrtz_triggers_sched_name_trigger_name~",
|
|
columns: x => new { x.sched_name, x.trigger_name, x.trigger_group },
|
|
principalSchema: "quartz",
|
|
principalTable: "qrtz_triggers",
|
|
principalColumns: new[] { "sched_name", "trigger_name", "trigger_group" },
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_qrtz_ft_job_group",
|
|
schema: "quartz",
|
|
table: "qrtz_fired_triggers",
|
|
column: "job_group");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_qrtz_ft_job_name",
|
|
schema: "quartz",
|
|
table: "qrtz_fired_triggers",
|
|
column: "job_name");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_qrtz_ft_job_req_recovery",
|
|
schema: "quartz",
|
|
table: "qrtz_fired_triggers",
|
|
column: "requests_recovery");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_qrtz_ft_trig_group",
|
|
schema: "quartz",
|
|
table: "qrtz_fired_triggers",
|
|
column: "trigger_group");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_qrtz_ft_trig_inst_name",
|
|
schema: "quartz",
|
|
table: "qrtz_fired_triggers",
|
|
column: "instance_name");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_qrtz_ft_trig_name",
|
|
schema: "quartz",
|
|
table: "qrtz_fired_triggers",
|
|
column: "trigger_name");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_qrtz_ft_trig_nm_gp",
|
|
schema: "quartz",
|
|
table: "qrtz_fired_triggers",
|
|
columns: new[] { "sched_name", "trigger_name", "trigger_group" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_qrtz_j_req_recovery",
|
|
schema: "quartz",
|
|
table: "qrtz_job_details",
|
|
column: "requests_recovery");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_qrtz_t_next_fire_time",
|
|
schema: "quartz",
|
|
table: "qrtz_triggers",
|
|
column: "next_fire_time");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_qrtz_t_nft_st",
|
|
schema: "quartz",
|
|
table: "qrtz_triggers",
|
|
columns: new[] { "next_fire_time", "trigger_state" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_qrtz_t_state",
|
|
schema: "quartz",
|
|
table: "qrtz_triggers",
|
|
column: "trigger_state");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_qrtz_triggers_sched_name_job_name_job_group",
|
|
schema: "quartz",
|
|
table: "qrtz_triggers",
|
|
columns: new[] { "sched_name", "job_name", "job_group" });
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "qrtz_blob_triggers",
|
|
schema: "quartz");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "qrtz_calendars",
|
|
schema: "quartz");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "qrtz_cron_triggers",
|
|
schema: "quartz");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "qrtz_fired_triggers",
|
|
schema: "quartz");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "qrtz_locks",
|
|
schema: "quartz");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "qrtz_paused_trigger_grps",
|
|
schema: "quartz");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "qrtz_scheduler_state",
|
|
schema: "quartz");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "qrtz_simple_triggers",
|
|
schema: "quartz");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "qrtz_simprop_triggers",
|
|
schema: "quartz");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "qrtz_triggers",
|
|
schema: "quartz");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "qrtz_job_details",
|
|
schema: "quartz");
|
|
}
|
|
}
|
|
}
|