Implement API security baseline (sys_user, JWT, audit fields, transactions, unique constraints) and Web real login with 401 handling. Document setup and development workflows in root, WmsLite.Api, and WmsLite.Web README files. Co-authored-by: Cursor <cursoragent@cursor.com>
57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using FluentMigrator;
|
|
|
|
namespace WmsLite.Api.Database.Migrations;
|
|
|
|
[Migration(8, "Inventory transaction trace: material, container, location snapshot")]
|
|
public class InventoryTransactionTraceColumns0008 : Migration
|
|
{
|
|
public override void Up()
|
|
{
|
|
if (!Schema.Table("inventory_transaction").Exists())
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!Schema.Table("inventory_transaction").Column("material_code").Exists())
|
|
{
|
|
Alter.Table("inventory_transaction")
|
|
.AddColumn("material_code").AsString(64).Nullable();
|
|
}
|
|
|
|
if (!Schema.Table("inventory_transaction").Column("container_code").Exists())
|
|
{
|
|
Alter.Table("inventory_transaction")
|
|
.AddColumn("container_code").AsString(64).Nullable();
|
|
}
|
|
|
|
if (!Schema.Table("inventory_transaction").Column("location_code").Exists())
|
|
{
|
|
Alter.Table("inventory_transaction")
|
|
.AddColumn("location_code").AsString(64).Nullable();
|
|
}
|
|
}
|
|
|
|
public override void Down()
|
|
{
|
|
if (!Schema.Table("inventory_transaction").Exists())
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (Schema.Table("inventory_transaction").Column("location_code").Exists())
|
|
{
|
|
Delete.Column("location_code").FromTable("inventory_transaction");
|
|
}
|
|
|
|
if (Schema.Table("inventory_transaction").Column("container_code").Exists())
|
|
{
|
|
Delete.Column("container_code").FromTable("inventory_transaction");
|
|
}
|
|
|
|
if (Schema.Table("inventory_transaction").Column("material_code").Exists())
|
|
{
|
|
Delete.Column("material_code").FromTable("inventory_transaction");
|
|
}
|
|
}
|
|
}
|