ALTER TABLE System_Parameter ADD AreaCode varchar(6);
ALTER TABLE System_Parameter ADD CreateUser varchar(50);
ALTER TABLE System_Parameter ADD UpdateUser varchar(50);
ALTER TABLE System_Parameter ADD IsValidate varchar(1);
ALTER TABLE System_Parameter ADD CreateTime datetime;
ALTER TABLE System_Parameter ADD UpdateTime datetime;
ALTER TABLE notice ADD CreateUser varchar(50);
ALTER TABLE notice ADD UpdateUser varchar(50);
ALTER TABLE notice ADD IsValidate varchar(1);
ALTER TABLE notice ADD CreateTime datetime;
ALTER TABLE notice ADD UpdateTime datetime;
CREATE TABLE IF NOT EXISTS [T_Area] ([AreaCode] varchar(6) NOT NULL PRIMARY KEY,[AreaName] varchar(50),[PAreaCode] varchar(6) DEFAULT '000000',[AreaShortName] varchar(20) NOT NULL,[CreateUser] varchar(50),[UpdateUser] varchar(50),[IsValidate] char(1) NOT NULL,[CreateTime] datetime NOT NULL,[UpdateTime] datetime NOT NULL);
CREATE TABLE IF NOT EXISTS [T_Group] ([GroupID] varchar(50) NOT NULL PRIMARY KEY, [GroupNum] varchar(50), [GroupName] varchar(50), [GroupType] char(1) DEFAULT '1', [GroupShort] varchar(30), [PGroupID] varchar(50), [AreaCode] char(1), [CreateUser] varchar(50), [UpdateUser] varchar(50), [IsValidate] char(1) NOT NULL, [CreateTime] datetime NOT NULL, [UpdateTime] datetime NOT NULL);
CREATE TABLE IF NOT EXISTS [T_OrgApp] ([OrgID] varchar(50) NOT NULL, [AppID] varchar(50) NOT NULL, [AppVer] varchar(50), [LocalState] varchar(50),CONSTRAINT [sqlite_autoindex_T_OrgApp_1] PRIMARY KEY ([OrgID], [AppID]));
CREATE TABLE IF NOT EXISTS [T_AppInfo] ([AppID] varchar(50) NOT NULL, [AppVer] varchar(50) NOT NULL, [AppName] varchar(50), [AppShowName] varchar(50), [AppIconUrl] varchar(200), [AppPresent] varchar(500), [AppSetupSize] varchar(20), [AppSetupUrl] varchar(200), [AppSetupMD5] varchar(50), [AppVerReleaseDate] varchar(20), [AppInstallPath] varchar(200), [AppDeveloper] varchar(50), [AppIsRelation] varchar(1), [AppRelationApps] varchar(100), [AppIsEnable] varchar(1), [AppCloseProcess] varchar(200), [AppNeedPlatformMinVer] varchar(50), [AppUpdateLog] varchar(500), [AppThumbnails] varchar(200), [ImageBaseUrl] varchar(254), [CreateUser] varchar(50), [UpdateUser] varchar(50), [IsValidate] varchar(1), [CreateTime] datetime, [UpdateTime] datetime, [chargesFlag] varchar(20), [productType] varchar(20), [isUpgrading] varchar(20), [shortcutName] varchar(50), [installationPath] varchar(200), [registryName] varchar(50), [isLocalInstalled] varchar(20), [isDeleteShortcuts] varchar(20), [LocalPath] varchar(256),CONSTRAINT [sqlite_autoindex_T_AppInfo_1] PRIMARY KEY ([AppID], [AppVer]));
CREATE TABLE IF NOT EXISTS [CommonProblem] ([ID] varchar(32) NOT NULL, [AreaCode] varchar(8) NOT NULL, [Title] varchar(256) NOT NULL, [Content] varchar(1000) NOT NULL, [ClickAmount] int NOT NULL, [CreateDate] varchar(20) NOT NULL, [Operators] varchar(20) NOT NULL, [publishDate] varchar(20) NOT NULL);
CREATE TABLE IF NOT EXISTS [Information] ([id] varchar(32) NOT NULL, [areaCode] varchar(10) NOT NULL, [title] varchar(55) NOT NULL, [url] varchar(255) NOT NULL, [columnName] varchar(55) NOT NULL, [label] varchar(55) NOT NULL, [sort] varchar(8) NOT NULL, [clickAmount] varchar(8) NOT NULL, [operatorName] varchar(20) NOT NULL, [updateDate] varchar(20) NOT NULL);
CREATE TABLE IF NOT EXISTS [T_OrgAppAuthorize] ([OrgID] varchar(50) NOT NULL, [AppID] varchar(50) NOT NULL, [IsCanTry] varchar(1), [IsShowPayButton] varchar(1), [PayButtonText] varchar(50), [PayUrl] varchar(254), [IsShowPayHistoryButton] varchar(1), [PayHistoryButtonText] varchar(50), [PayHistoryUrl] varchar(254), [AppAuthorizeText] varchar(254), [IsAdventRemind] varchar(1), [IsStartSoftware] varchar(1), [ProductReminder] varchar(254), [CreateUser] varchar(50), [UpdateUser] varchar(50), [IsValidate] varchar(1), [CreateTime] datetime, [UpdateTime] datetime,CONSTRAINT [sqlite_autoindex_T_OrgAppAuthorize_1] PRIMARY KEY ([OrgID], [AppID]));
CREATE TABLE IF NOT EXISTS [score_rule_config] ([id] varchar(55) NOT NULL, [rule_name] varchar(50) NOT NULL, [user_type] varchar(2) NOT NULL, [score] int NOT NULL, [action] varchar(125) NOT NULL, [descrition] varchar(125), [compute_rule] varchar(4), [create_date] datetime NOT NULL);
insert into T_AppInfo(AppID,AppVer,AppName,AppShowName) values('ZXT_iManager', '1.4.1', 'e企简税', 'e企简税平台');
insert into T_AppInfo(AppID,AppVer,AppName,AppShowName) select clientID,subVersion,subName,productShowName from SubSoftInfo where clientID='ZXT_Update';
insert into T_OrgApp(OrgID,AppID,AppVer,LocalState) values('0','ZXT_iManager', '1.4.1', 'APPSTORE');
insert into T_OrgApp(OrgID,AppID,AppVer,LocalState) select '0',clientID,subVersion,'APPSTORE' from SubSoftInfo where clientID='ZXT_Update';
update SubSoftInfo set subVersion='1.4.1' where clientID='ZXT_iManager';