57 lines
1.6 KiB
C#
57 lines
1.6 KiB
C#
using FluentMigrator;
|
|
|
|
namespace WmsLite.Api.Database.Migrations;
|
|
|
|
[Migration(16, "Outbound pick task operation fields")]
|
|
public class OutboundPickTaskOperationFields0016 : Migration
|
|
{
|
|
public override void Up()
|
|
{
|
|
if (!Schema.Table("outbound_pick_task").Exists())
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!Schema.Table("outbound_pick_task").Column("picker_user_id").Exists())
|
|
{
|
|
Alter.Table("outbound_pick_task")
|
|
.AddColumn("picker_user_id").AsString(128).Nullable();
|
|
}
|
|
|
|
if (!Schema.Table("outbound_pick_task").Column("picked_time").Exists())
|
|
{
|
|
Alter.Table("outbound_pick_task")
|
|
.AddColumn("picked_time").AsDateTime().Nullable();
|
|
}
|
|
|
|
if (!Schema.Table("outbound_pick_task").Column("exception_reason").Exists())
|
|
{
|
|
Alter.Table("outbound_pick_task")
|
|
.AddColumn("exception_reason").AsString(512).Nullable();
|
|
}
|
|
}
|
|
|
|
public override void Down()
|
|
{
|
|
if (!Schema.Table("outbound_pick_task").Exists())
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (Schema.Table("outbound_pick_task").Column("exception_reason").Exists())
|
|
{
|
|
Delete.Column("exception_reason").FromTable("outbound_pick_task");
|
|
}
|
|
|
|
if (Schema.Table("outbound_pick_task").Column("picked_time").Exists())
|
|
{
|
|
Delete.Column("picked_time").FromTable("outbound_pick_task");
|
|
}
|
|
|
|
if (Schema.Table("outbound_pick_task").Column("picker_user_id").Exists())
|
|
{
|
|
Delete.Column("picker_user_id").FromTable("outbound_pick_task");
|
|
}
|
|
}
|
|
}
|