IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_flowworkstatus_history]') AND type = 'U')
CREATE TABLE [dbo].[mps_flowworkstatus_history]
(
    [ws_id] int NOT NULL,
    [ws_swrkid] int NULL DEFAULT((0)),
    [ws_twrkid] int NULL DEFAULT((0)),
    [ws_caption] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_condition] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_pickvalues] nvarchar(1000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_status] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_status_f] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_status_ff] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_status_r] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_key] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_key_f] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_key_ff] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_key_r] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_sql] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_prevwrkids] varchar(1000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_fjbstatus] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_bizrelation] nvarchar(4000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_accsource] int NULL DEFAULT((0)),
    [ws_acctype] varchar(10) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_accdate] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_accobjtype] varchar(10) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_accobj] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_accfid] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_accmethod] int NULL DEFAULT((0)),
    [ws_accvalue] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_accsuspend] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_accsql] nvarchar(1000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_tosubflow] int NULL DEFAULT((1)),
    [ws_bizid] int NULL DEFAULT((0)),
    [ws_title] nvarchar(300) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ws_date] datetime NULL DEFAULT(getdate()),
    CONSTRAINT [PK_MPS_FLOWWORKSTATUS_HISTORY] PRIMARY KEY ([ws_id] ASC)
)