IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_programtype]') AND type = 'U')
CREATE TABLE [dbo].[mps_programtype]
(
    [pt_id] int NOT NULL IDENTITY(1, 1),
    [pt_cmpid] int NULL DEFAULT((0)),
    [pt_caption] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [pt_program] int NULL DEFAULT((1)),
    [pt_fid] int NULL DEFAULT((0)),
    [pt_system] int NULL DEFAULT((2)),
    [pt_filename] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [pt_createtime] datetime NULL DEFAULT(getdate()),
    [pt_updatetime] datetime NULL DEFAULT(getdate()),
    [pt_note] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [pt_createtable] int NULL DEFAULT((1)),
    [pt_querytime] int NULL DEFAULT((0)),
    [pt_icon] varchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [pt_share] int NULL DEFAULT((1)),
    [pt_changed] int NULL,
    [pt_database] varchar(50) COLLATE Chinese_PRC_CI_AS NULL,
    [pt_hidemenu] int NULL DEFAULT((1)),
    [pt_hidemenu_mobile] int NULL DEFAULT((1)),
    [pt_merge] int NULL DEFAULT((1)),
    [pt_category] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [pt_subcategory] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [pt_widget] int NULL DEFAULT((1)),
    [pt_icon0] varchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [pt_templatename] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    CONSTRAINT [PK_MPS_PROGRAMTYPE] PRIMARY KEY ([pt_id] ASC)
)