-- 业务时间变更记录表
CREATE TABLE [man_order_time_change_log] (
  [id] bigint NOT NULL IDENTITY(1,1),
  [order_id] bigint NOT NULL,
  [order_no] varchar(255) NOT NULL,
  [order_type] int NOT NULL,
  [old_order_time] varchar(255) NOT NULL,
  [new_order_time] varchar(255) NOT NULL,
  [memo] varchar(500) DEFAULT NULL,
  [create_by] bigint DEFAULT NULL,
  [create_time] datetime DEFAULT NULL,
  PRIMARY KEY ([id])
);

CREATE INDEX [idx_order_id] ON [man_order_time_change_log] ([order_id]);
CREATE INDEX [idx_order_no] ON [man_order_time_change_log] ([order_no]);
CREATE INDEX [idx_create_time] ON [man_order_time_change_log] ([create_time]);

EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'业务时间变更记录表', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'man_order_time_change_log';
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'ID', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'man_order_time_change_log', @level2type = N'COLUMN', @level2name = N'id';
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'订单ID', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'man_order_time_change_log', @level2type = N'COLUMN', @level2name = N'order_id';
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'单据编号', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'man_order_time_change_log', @level2type = N'COLUMN', @level2name = N'order_no';
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'订单类型 1:入库 2:出库', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'man_order_time_change_log', @level2type = N'COLUMN', @level2name = N'order_type';
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'原业务时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'man_order_time_change_log', @level2type = N'COLUMN', @level2name = N'old_order_time';
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'新业务时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'man_order_time_change_log', @level2type = N'COLUMN', @level2name = N'new_order_time';
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'备注', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'man_order_time_change_log', @level2type = N'COLUMN', @level2name = N'memo';
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'创建人', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'man_order_time_change_log', @level2type = N'COLUMN', @level2name = N'create_by';
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'创建时间', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'man_order_time_change_log', @level2type = N'COLUMN', @level2name = N'create_time';

