202508060501392_addOutSourcingMissStore.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. namespace ShwasherSys.Migrations
  2. {
  3. using System;
  4. using System.Data.Entity.Migrations;
  5. public partial class addOutSourcingMissStore : DbMigration
  6. {
  7. public override void Up()
  8. {
  9. CreateTable(
  10. "dbo.OutSourcingMissStore",
  11. c => new
  12. {
  13. Id = c.Int(nullable: false, identity: true),
  14. ProductionOrderNo = c.String(nullable: false, maxLength: 11),
  15. PlannedQuantity = c.Decimal(nullable: false, precision: 18, scale: 2),
  16. ActualQuantity = c.Decimal(nullable: false, precision: 18, scale: 2),
  17. MissQuantity = c.Decimal(nullable: false, precision: 18, scale: 2),
  18. LastModificationTime = c.DateTime(),
  19. LastModifierUserId = c.Long(),
  20. CreationTime = c.DateTime(nullable: false),
  21. CreatorUserId = c.Long(),
  22. })
  23. .PrimaryKey(t => t.Id)
  24. .ForeignKey("dbo.Sys_Users", t => t.CreatorUserId)
  25. .ForeignKey("dbo.Sys_Users", t => t.LastModifierUserId)
  26. .Index(t => t.LastModifierUserId)
  27. .Index(t => t.CreatorUserId);
  28. }
  29. public override void Down()
  30. {
  31. DropForeignKey("dbo.OutSourcingMissStore", "LastModifierUserId", "dbo.Sys_Users");
  32. DropForeignKey("dbo.OutSourcingMissStore", "CreatorUserId", "dbo.Sys_Users");
  33. DropIndex("dbo.OutSourcingMissStore", new[] { "CreatorUserId" });
  34. DropIndex("dbo.OutSourcingMissStore", new[] { "LastModifierUserId" });
  35. DropTable("dbo.OutSourcingMissStore");
  36. }
  37. }
  38. }