create table shop_IPCategory (
   StartIP              int                  not null default 0,
   EndIP                int                  null default 0,
   country              varchar(200)         null default '',
   IPLocal              varchar(200)         null default '',
   City                 varchar(60)          null default '',
   constraint PK_SHOP_IPCATEGORY primary key nonclustered (StartIP)
)
 go 
create table shop_Links (
   GUIDCode             numeric              identity,
   imgURL               dm_linkUrl           null default '',
   linkText             varchar(20)          null default '',
   linkURL              dm_linkUrl           null default '',
   isImg                dm_Bool              null default 0,
   isRecommend          dm_Bool              null default 0,
   expireDate           dm_date              null default getdate(),
   orderIndex           int                  null default 0,
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_LINKS primary key nonclustered (GUIDCode)
)
 go 
create table shop_SmsQueue (
   GUIDCode             numeric              identity,
   smsTitle             varchar(100)         null default '',
   smsContent           varchar(200)         null default '',
   receiptorMobi        dm_mobi              null,
   memberID             dm_memberID          null default '',
   creator              dm_memberID          null default '',
   createDate           dm_date              null default getdate(),
   emailStatus          int                  null default 1,
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_SMSQUEUE primary key nonclustered (GUIDCode)
)
 go 
create table shop_account (
   GUIDCode             numeric              identity,
   memberID             dm_memberID          not null default '',
   occurTime            dm_date              null default getdate(),
   recharge             money                null default 0,
   consume              money                null default 0,
   balance              money                null default 0,
   orderID              dm_orderID           null default '',
   handler              dm_memberID          null default '',
   remark               dm_remark            null default '',
   constraint PK_SHOP_ACCOUNT primary key nonclustered (GUIDCode)
)
 go 
create table shop_addressBook (
   GUIDCode             numeric              identity,
   memberID             dm_memberID          null default '',
   country              varchar(100)         null default '',
   province             dm_province          null default '',
   city                 dm_city              null default '',
   receiptorAdd         dm_address           null default '',
   receiptor            varchar(100)         null default '',
   receiptorTell        varchar(100)         null default '',
   receiptorMobi        varchar(100)         null default '',
   receiptorZip         varchar(20)          null default '',
   Email                dm_email             null default '',
   isDefault            dm_Bool              null default 1,
   priBuilding          varchar(100)         null,
   invoiceTitle         varchar(200)         null default '',
   constraint PK_SHOP_ADDRESSBOOK primary key nonclustered (GUIDCode)
)
 go 
create table shop_admin (
   adminID              dm_memberID          not null default '',
   roleID               dm_roleID            not null default '',
   adminPwd             dm_pwd               not null default '',
   adminStatus          dm_Bool              null default 1,
   creator              dm_memberID          null default '',
   createDate           dm_date              null default getdate(),
   creatorIP            dm_ip                null default '',
   IPLocation           dm_ipLocation        null default '',
   isSystem             dm_Bool              null default 0,
   adminName            varchar(50)          null default '',
   lastLoginDate        dm_date              null default getdate(),
   recentLoginDate      dm_date              null default getdate(),
   remark               dm_remark            null default '',
   constraint PK_SHOP_ADMIN primary key nonclustered (adminID)
)
 go 
create table shop_adminLog (
   GUIDCode             numeric              identity,
   adminID              dm_memberID          null default '',
   singInIp             dm_ip                not null default '',
   ipLocation           dm_ipLocation        not null default '',
   logContent           text                 null default '',
   logDate              dm_date              null default getdate(),
   constraint PK_SHOP_ADMINLOG primary key nonclustered (GUIDCode)
)
 go 
create table shop_adminMenu (
   menuID               dm_menuID            not null,
   menuName             dm_menuName          not null default '',
   parentID             dm_menuID            not null default '',
   className            varchar(50)          null default '',
   webName              dm_linkUrl           null default '',
   orderIndex           dm_orderIndex        null default 0,
   constraint PK_SHOP_ADMINMENU primary key nonclustered (menuID)
)
 go 
create table shop_adminRole (
   roleID               dm_roleID            not null default '',
   roleName             varchar(10)          not null default '',
   createDate           dm_date              null default getdate(),
   creator              dm_memberID          null default '',
   isSystem             dm_Bool              null default 0,
   remark               dm_remark            null default '',
   constraint PK_SHOP_ADMINROLE primary key nonclustered (roleID)
)
 go 
create table shop_blogCate (
   cateID               dm_articleType       not null default '',
   parentID             varchar(6)           null default '',
   cateName             varchar(40)          null default '',
   isTrash              dm_Bool              null default 0,
   orderIndex           dm_orderIndex        null default 0,
   constraint PK_SHOP_BLOGCATE primary key nonclustered (cateID)
)
 go 
create table shop_blogInTag (
   GUIDCode             numeric              identity,
   blogID               varchar(10)          null default '',
   tagID                dm_tagID             null default '',
   constraint PK_SHOP_BLOGINTAG primary key nonclustered (GUIDCode)
)
 go 
create table shop_blogTag (
   tagID                dm_tagID             not null default '',
   tagName              varchar(40)          null default '',
   constraint PK_SHOP_BLOGTAG primary key nonclustered (tagID)
)
 go 
create table shop_blogs (
   blogID               varchar(10)          not null default '',
   cateID               dm_articleType       null default '',
   tagID                dm_tagID             null default '',
   webTitle             varchar(200)         null default '',
   webKeyWord           varchar(200)         null default '',
   webDescript          varchar(300)         null default '',
   blogTitle            varchar(100)         null default '',
   blogBrief            varchar(300)         null default '',
   blogContent          text                 null default '',
   postDate             datetime             null default getdate(),
   adminID              dm_memberID          null default '',
   orderIndex           dm_orderIndex        null default 0,
   isTrash              dm_Bool              null default 0,
   viewTimes            int                  null default 0,
   sourceFrom           varchar(50)          null default '',
   constraint PK_SHOP_BLOGS primary key nonclustered (blogID)
)
 go 
create table shop_brand (
   brandID              varchar(10)          not null default '',
   brandName            varchar(50)          null default '',
   brandAlias           varchar(100)         null default '',
   brandImg             dm_imgUrl            null default '',
   brandImg2            dm_imgUrl            null default '',
   brandWebsite         varchar(200)         null default '',
   isRecommend          dm_Bool              null default 0,
   brandDetails         text                 null default '',
   orderIndex           dm_orderIndex        null default 0,
   isDisplay            dm_Bool              null default 1,
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_BRAND primary key nonclustered (brandID)
)
 go 
create table shop_cartProducts (
   GUIDCode             numeric              identity,
   memberID             dm_memberID          null default '',
   cartID               varchar(20)          null default '',
   productID            dm_goodID            null default '',
   productName          dm_productName       null default '',
   productSize          varchar(60)          null default '',
   productColor         varchar(60)          null default '',
   buyPrice             dm_sum               null default 0,
   buyQty               dm_quantity          null default 1,
   addDate              dm_date              null default getdate(),
   constraint PK_SHOP_CARTPRODUCTS primary key nonclustered (GUIDCode)
)
 go 
create table shop_comment (
   GUIDCode             numeric              identity,
   productID            varchar(15)          not null,
   memberID             dm_memberID          null default '',
   commentSubject       varchar(100)         null default '',
   commentRank          int                  null default 0,
   content              varchar(500)         null default '',
   postDate             datetime             null default getdate(),
   isChecked            bit                  null default 0,
   weighing             int                  null default 0,
   contact              varchar(100)         null default '',
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_COMMENT primary key nonclustered (GUIDCode)
)
 go 
create table shop_currencyList (
   currencyID           varchar(3)           not null default '',
   currencyName         varchar(20)          null default '',
   currencySymbol       varchar(10)          null default '',
   constraint PK_SHOP_CURRENCYLIST primary key nonclustered (currencyID)
)
 go 
create table shop_customPage (
   pageID               varchar(20)          not null default '',
   pageName             varchar(20)          null default '',
   pageKind             int                  null default 0,
   webTitle             varchar(200)         null default '',
   webKeyWord           varchar(200)         null default '',
   webDescript          varchar(300)         null default '',
   pageContent          text                 null default '',
   isSample             dm_Bool              null default 0,
   constraint PK_SHOP_CUSTOMPAGE primary key nonclustered (pageID)
)
 go 
create table shop_deliveryCompany (
   expressID            dm_expressID         not null default '',
   expressName          varchar(50)          null default '',
   expressWebsite       varchar(100)         null default '',
   orderIndex           int                  null default 0,
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_DELIVERYCOMPANY primary key nonclustered (expressID)
)
 go 
create table shop_deliveryFee (
   GUIDCode             numeric              identity,
   deliveryID           dm_deliverID         null default '',
   subItem              int                  null default 1,
   province             dm_province          null default '',
   city                 dm_city              null default '',
   baseWeight           int                  null default 0,
   baseFee              money                null default 0,
   relWeight            int                  null default 0,
   relFee               money                null default 0,
   insureRate           int                  null default 0,
   minInsureFee         money                null default 0,
   isCOD                dm_Bool              null default 0,
   isDefaultFee         dm_Bool              null default 0,
   isAllSame            dm_Bool              null default 0,
   constraint PK_SHOP_DELIVERYFEE primary key nonclustered (GUIDCode)
)
 go 
create table shop_deliveryManager (
   deliveryID           dm_deliverID         not null default '',
   deliveryName         varchar(50)          null default '',
   expressID            dm_expressID         null default '',
   deliveryBrief        text                 null default '',
   isDefault            dm_Bool              null default 0,
   isTrash              dm_Bool              null default 0,
   isCOD                dm_Bool              null default 0,
   constraint PK_SHOP_DELIVERYMANAGER primary key nonclustered (deliveryID)
)
 go 
create table shop_emailQueue (
   GUIDCode             numeric              identity,
   emailTitle           varchar(100)         null default '',
   emailContent         text                 null default '',
   emailReceiptor       varchar(100)         null default '',
   memberID             dm_memberID          null default '',
   creator              dm_memberID          null default '',
   createDate           dm_date              null default getdate(),
   emailStatus          int                  null default 1,
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_EMAILQUEUE primary key nonclustered (GUIDCode)
)
 go 
create table shop_emailTemplate (
   emailTemplateName    char(10)             not null default '',
   emailTitle           varchar(100)         null default '',
   emailContent         text                 null default '',
   constraint PK_SHOP_EMAILTEMPLATE primary key nonclustered (emailTemplateName)
)
 go 
create table shop_errorNullPage (
   GUIDCode             numeric              identity,
   noAccessMsg          text                 null default '',
   fileNotFoundMsg      text                 null default '',
   NullMessage          text                 null default '',
   generalErrMsg        text                 null default '',
   constraint PK_SHOP_ERRORNULLPAGE primary key nonclustered (GUIDCode)
)
 go 
create table shop_expressBill (
   expressBillID        int                  not null default 0,
   expressBillName      varchar(30)          null,
   cssStyle             varchar(150)         null default '',
   exprexxBgImg         dm_imgUrl            null default '',
   isEnable             dm_Bool              null default 1,
   constraint PK_SHOP_EXPRESSBILL primary key nonclustered (expressBillID)
)
 go 
create table shop_expressBillPosition (
   GUIDCode             numeric              identity,
   expressBillID        int                  null default 0,
   expressContName      varchar(30)          null default '',
   isReceipt            dm_Bool              null,
   orderFieldName       varchar(30)          null default '',
   pointCoord           varchar(150)         null default '',
   isShow               dm_Bool              null default 1,
   CusDefaultValue      varchar(50)          null default '',
   isCustom             dm_Bool              null default 0,
   isBold               dm_Bool              null default 0,
   fontSize             int                  null default 14,
   constraint PK_SHOP_EXPRESSBILLPOSITION primary key nonclustered (GUIDCode)
)
 go 
create table shop_favorite (
   GUIDCode             numeric              identity,
   memberID             dm_memberID          null default '',
   productID            varchar(15)          null default '',
   addDate              dm_date              null default getdate(),
   orderExpire          dm_date              null default getdate(),
   constraint PK_SHOP_FAVORITE primary key nonclustered (GUIDCode)
)
 go 
create table shop_flash (
   GUIDCode             numeric              identity,
   templateName         dm_templateName      null default '',
   flashID              varchar(3)           null default '',
   flashText            varchar(50)          null default '',
   imgURL               dm_linkUrl           null default '',
   linkURL              dm_linkUrl           null default '',
   orderIndex           dm_orderIndex        null default 0,
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_FLASH primary key nonclustered (GUIDCode)
)
 go 
create table shop_grabReg (
   regName              varchar(100)         not null default '',
   productIDReg         text                 null default '',
   productNameReg       text                 null default '',
   quotePriceReg        text                 null default '',
   priceReg             text                 null default '',
   imgReg               text                 null default '',
   descriptReg          text                 null default '',
   descImgReg           text                 null default '',
   isDefault            dm_Bool              null default 0,
   webCharset           varchar(20)          null default '',
   constraint PK_SHOP_GRABREG primary key nonclustered (regName)
)
 go 
create table shop_guestBook (
   GUIDCode             numeric              identity,
   memberID             dm_memberID          null default '',
   bookSubject          varchar(50)          null default '',
   bookContent          varchar(1000)        null default '',
   contact              varchar(100)         null default '',
   parentID             numeric              null default 0,
   bookTime             dm_date              null default getdate(),
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_GUESTBOOK primary key nonclustered (GUIDCode)
)
 go 
create table shop_helperArticle (
   helperID             varchar(6)           not null default '',
   helperTitle          varchar(30)          null default '',
   parentID             varchar(6)           null default '',
   linkURL              dm_linkUrl           null default '',
   helperContent        text                 null default '',
   isVisible            dm_Bool              null default 1,
   orderIndex           dm_orderIndex        null default 0,
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_HELPERARTICLE primary key nonclustered (helperID)
)
 go 
create table shop_hotWord (
   GUIDCode             numeric              identity,
   searchKey            varchar(50)          null default '',
   orderIndex           dm_orderIndex        null default 0,
   constraint PK_SHOP_HOTWORD primary key nonclustered (GUIDCode)
)
 go 
create table shop_listShow (
   GUIDCode             numeric              identity,
   tableName            varchar(20)          null default '',
   adminID              dm_memberID          null default '',
   fieldName            varchar(30)          null default '',
   itemTitle            varchar(30)          null default '',
   isShow               dm_Bool              null default 1,
   isOption             dm_Bool              null default 1,
   orderIndex           dm_orderIndex        null default 0,
   constraint PK_SHOP_LISTSHOW primary key nonclustered (GUIDCode)
)
 go 
create table shop_manufacturer (
   manuID               dm_providerID        not null default '',
   manuName             dm_providerName      null default '',
   manuAddress          dm_address           null default '',
   manuWebsite          varchar(100)         null default '',
   manuContactor        dm_name              null default '',
   Email                dm_email             null default '',
   QQ                   varchar(20)          null default '',
   manuTell             dm_tel               null default '',
   manuMobi             dm_mobi              null default '',
   manuBrief            text                 null default '',
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_MANUFACTURER primary key nonclustered (manuID)
)
 go 
create table shop_member (
   memberID             dm_memberID          not null default '',
   memberPwd            dm_pwd               not null,
   memberEmail          dm_email             not null,
   memberStatus         int                  null default 0,
   levelID              varchar(5)           null default '',
   registerIP           dm_ip                null default '',
   registerIPLocation   dm_ipLocation        null default '',
   registerDate         dm_date              null default getdate(),
   activationCode       varchar(172)         null default '',
   isNew                dm_Bool              null default 1,
   isTrash              dm_Bool              null default 0,
   isWholesalers        dm_Bool              null default 0,
   lastLoginDate        dm_date              null default getdate(),
   memberPhoto          dm_imgUrl            null default '',
   expireDate           dm_date              null default getdate(),
   constraint PK_SHOP_MEMBER primary key nonclustered (memberID)
)
 go 
create table shop_memberInfo (
   memberID             dm_memberID          not null default '',
   realName             dm_name              null default '',
   sex                  varchar(4)           null default '',
   birthday             dm_txDate            null default '',
   realAdd              dm_address           null default '',
   realZip              dm_zip               null default '',
   realTel              dm_tel               null default '',
   mobilCode            dm_mobi              null default '',
   QQ                   varchar(20)          null default '',
   ww                   varchar(50)          null default '',
   skype                varchar(50)          null default '',
   answer               varchar(50)          null default '',
   answerKey            varchar(50)          null default '',
   constraint PK_SHOP_MEMBERINFO primary key nonclustered (memberID)
)
 go 
create table shop_memberIntegral (
   GUIDCode             numeric              identity,
   memberID             dm_memberID          null default '',
   bookDate             dm_date              null default getdate(),
   increase             int                  null default 0,
   changed              int                  null default 0,
   balance              int                  null default 0,
   remark               dm_remark            null default '',
   constraint PK_SHOP_MEMBERINTEGRAL primary key nonclustered (GUIDCode)
)
 go 
create table shop_memberLevel (
   levelID              varchar(5)           not null default '',
   levelName            varchar(20)          null default '',
   requiredIntegral     int                  null default 0,
   discountRate         int                  null default 100,
   isDefault            dm_Bool              null default 0,
   levelKind            varchar(20)          null default '',
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_MEMBERLEVEL primary key nonclustered (levelID)
)
 go 
create table shop_onlineServer (
   serverID             varchar(50)          not null default '',
   cServerCode          text                 null default '',
   orderIndex           dm_orderIndex        null default 0,
   isDisplay            dm_Bool              null default 1,
   constraint PK_SHOP_ONLINESERVER primary key nonclustered (serverID)
)
 go 
create table shop_onlineTemplate (
   tmpID                int                  not null default 0,
   tmpName              varchar(20)          null default '',
   cssContent           text                 null default '',
   tmpContent           text                 null default '',
   replaceTmp           varchar(500)         null default '',
   isUse                dm_Bool              null,
   constraint PK_SHOP_ONLINETEMPLATE primary key nonclustered (tmpID)
)
 go 
create table shop_oosBook (
   GUIDCode             numeric              identity,
   productID            dm_goodID            null default '',
   Email                dm_email             null default '',
   bookDate             dm_date              null default getdate(),
   noticeDate           dm_txDate            null default '',
   isSent               dm_Bool              null default 0,
   isTrash              dm_Bool              null default 0,
   memberID             dm_memberID          null default '',
   constraint PK_SHOP_OOSBOOK primary key nonclustered (GUIDCode)
)
 go 
create table shop_order (
   orderID              dm_orderID           not null default '',
   paymentID            dm_paymentID         null default '',
   deliveryID           dm_deliverID         null default '',
   memberID             dm_memberID          null default '',
   receiptor            varchar(100)         null default '',
   country              varchar(200)         null default '',
   province             dm_province          null default '',
   city                 dm_city              null default '',
   receiptorAdd         dm_address           null default '',
   receiptorTell        varchar(100)         null default '',
   receiptorMobi        varchar(100)         null default '',
   receiptorZip         varchar(20)          null default '',
   Email                dm_email             null default '',
   invoiceTitle         varchar(200)         null default '',
   invoiceContent       varchar(200)         null default '',
   carriageSum          dm_sum               null default 0,
   productsSum          dm_sum               null default 0,
   adjustSum            dm_sum               null default 0,
   taxSum               dm_sum               null default 0,
   insuranceFee         dm_sum               null default 0,
   handlingCharge       dm_sum               null default 0,
   voucherID            dm_voucherID         null default '',
   couponSum            dm_sum               null default 0,
   appointDate          varchar(50)          null default '',
   priBuilding          varchar(100)         null,
   orderIP              dm_ip                null default '',
   orderIPLocation      dm_ipLocation        null default '',
   isNew                dm_Bool              null default 1,
   orderStatus          int                  null default 0,
   payStatus            int                  null default 0,
   shippingStatus       int                  null default 0,
   orderDate            dm_date              null default getdate(),
   isTrash              dm_Bool              null default 0,
   orderTags            text                 null default '',
   notePad              text                 null default '',
   remark               dm_remark            null default '',
   constraint PK_SHOP_ORDER primary key nonclustered (orderID)
)
 go 
create table shop_orderLog (
   GUIDCode             numeric              identity,
   orderID              dm_orderID           null default '',
   logDate              dm_date              null default getdate(),
   logContent           text                 null default '',
   handler              dm_memberID          null default '',
   constraint PK_SHOP_ORDERLOG primary key nonclustered (GUIDCode)
)
 go 
create table shop_orderNote (
   GUIDCode             numeric              identity,
   orderID              dm_orderID           null default '',
   noteTitle            varchar(100)         null default '',
   noteDate             dm_date              null default getdate(),
   noteContent          text                 null default '',
   adminID              dm_memberID          null default '',
   constraint PK_SHOP_ORDERNOTE primary key nonclustered (GUIDCode)
)
 go 
create table shop_orderProducts (
   GUIDCode             numeric              identity,
   orderID              dm_orderID           null default '',
   productID            dm_goodID            null,
   buyPrice             dm_sum               null default 0,
   buyQty               dm_quantity          null default 1,
   sentQty              dm_quantity          null default 0,
   returnQty            dm_quantity          null default 0,
   productSize          varchar(60)          null default '',
   productColor         varchar(60)          null default '',
   constraint PK_SHOP_ORDERPRODUCTS primary key nonclustered (GUIDCode)
)
 go 
create table shop_orderTag (
   GUIDCode             numeric              identity,
   tagName              varchar(40)          null default '',
   constraint PK_SHOP_ORDERTAG primary key nonclustered (GUIDCode)
)
 go 
create table shop_payLog (
   GUIDCode             numeric              identity,
   payDate              dm_date              null default getdate(),
   receiptSum           dm_sum               null default 0,
   refundSum            dm_sum               null default 0,
   remark               dm_remark            null default '',
   constraint PK_SHOP_PAYLOG primary key nonclustered (GUIDCode)
)
 go 
create table shop_payNotify (
   transID              varchar(60)          not null default '',
   orderID              dm_orderID           null default '',
   memberID             dm_memberID          null default '',
   paymentID            dm_paymentID         null default '',
   dealFunction         varchar(100)         null default '',
   isOrder              dm_Bool              null default 0,
   transDate            dm_date              null default getdate(),
   isSuccess            dm_Bool              null default 0,
   constraint PK_SHOP_PAYNOTIFY primary key nonclustered (transID)
)
 go 
create table shop_payment (
   paymentID            dm_paymentID         not null default '',
   paymentName          varchar(50)          null default '',
   payAccount           varchar(100)         null default '',
   parterID             varchar(50)          null default '',
   privateKey           varchar(200)         null default '',
   privateKey2          varchar(200)         null default '',
   payFee               float                null default 0,
   payMode              varchar(300)         null default '',
   payCurrency          varchar(200)         null default '',
   interfaceMode        varchar(300)         null default '',
   bankAccount          varchar(50)          null default '',
   privateKeyFile       varchar(200)         null default '',
   publicKeyiFile       varchar(200)         null default '',
   bankPublicKeyFile    varchar(200)         null default '',
   keyProtectPassword   varchar(200)         null default '',
   payBrief             text                 null default '',
   processInterface     varchar(20)          null default '--',
   isDefault            dm_Bool              null default 0,
   isCusAddress         dm_Bool              null default 0,
   orderIndex           dm_orderIndex        null default 0,
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_PAYMENT primary key nonclustered (paymentID)
)
 go 
create table shop_power (
   powerID              dm_permissionID      not null,
   powerName            varchar(20)          not null default '',
   parentID             dm_permissionID      null default '0',
   menuID               dm_menuID            null,
   relWeb               varchar(30)          null default '',
   orderIndex           dm_orderIndex        null default 0,
   constraint PK_SHOP_POWER primary key nonclustered (powerID)
)
  go  
create table shop_productCate (
   categoryID           dm_categoryID        not null default '',
   categoryName         dm_categoryName      null default '',
   parentID             dm_categoryID        null default '',
   orderIndex           int                  null default 0,
   isDisplay            dm_Bool              null default 1,
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_PRODUCTCATE primary key nonclustered (categoryID)
)
  go  
create table shop_productColor (
   GUIDCode             numeric              identity,
   colorName            varchar(30)          null default '',
   valueName            varchar(30)          null,
   colorValue           varchar(20)          null default '',
   colorImg             dm_imgUrl            null default '',
   isImg                dm_Bool              null default 0,
   orderIndex           dm_orderIndex        null default 0,
   constraint PK_SHOP_PRODUCTCOLOR primary key nonclustered (GUIDCode)
)
  go  
create table shop_productInCategory (
   GUIDCode             numeric              identity,
   productID            dm_goodID            null default '',
   categoryID           dm_categoryID        null default '',
   constraint PK_SHOP_PRODUCTINCATEGORY primary key nonclustered (GUIDCode)
)
  go  
create table shop_productInTag (
   GUIDCode             numeric              identity,
   tagID                dm_tagID             null default '',
   productID            dm_goodID            null default '',
   constraint PK_SHOP_PRODUCTINTAG primary key nonclustered (GUIDCode)
)
  go  
create table shop_productSize (
   GUIDCode             numeric              identity,
   sizeName             varchar(20)          null default '',
   valueName            varchar(30)          null,
   sizeValue            varchar(10)          null default '',
   orderIndex           dm_orderIndex        null default 0,
   constraint PK_SHOP_PRODUCTSIZE primary key nonclustered (GUIDCode)
)
  go  
create table shop_productTag (
   tagID                dm_tagID             not null default '',
   tagName              varchar(40)          null default '',
   constraint PK_SHOP_PRODUCTTAG primary key nonclustered (tagID)
)
  go  
create table shop_products (
   productID            dm_goodID            not null default '',
   categoryID           dm_categoryID        null default '',
   brandID              varchar(10)          null default '',
   manuID               dm_providerID        null default '',
   productName          dm_productName       null default '',
   stockQty             dm_quantity          null default 0,
   lowLimit             dm_quantity          null default 0,
   upperLimit           dm_quantity          null default 0,
   soldQty              dm_quantity          null default 100,
   quotePrice           dm_sum               null default 0,
   salePrice            dm_sum               null default 0,
   wholeSalePrice       dm_sum               null default 0,
   costPrice            dm_sum               null default 0,
   integral             int                  null default 0,
   productSize          varchar(60)          null default '',
   productColor         varchar(200)         null default '',
   productWeight        int                  null default 0,
   productBrief         varchar(1000)        null default '',
   productDetails       text                 null default '',
   isOnSale             dm_Bool              null default 1,
   viewTimes            int                  null default 500,
   webTitle             varchar(200)         null default '',
   webKeyWord           varchar(200)         null default '',
   webDescript          varchar(300)         null default '',
   templateName         varchar(30)          null default '',
   isTemplate           dm_Bool              null default 0,
   orderIndex           int                  null default 0,
   uploadDate           dm_date              null default getdate(),
   miniWholesale        dm_quantity          null default 1,
   maxWholesale         dm_quantity          null default 0,
   isTrash              dm_Bool              null default 0,
   isGift               dm_Bool              null default 0,
   changeIntegral       int                  null default 0,
   htmlID               varchar(10)          null default '',
   constraint PK_SHOP_PRODUCTS primary key nonclustered (productID)
)
  go  
create table shop_productsImg (
   GUIDCode             numeric              identity,
   productID            dm_goodID            null default '',
   imageSmall           dm_imgUrl            null default '',
   imageMiddle          dm_imgUrl            null default '',
   imageBig             dm_imgUrl            null default '',
   rawImg               dm_imgUrl            null default '',
   constraint PK_SHOP_PRODUCTSIMG primary key nonclustered (GUIDCode)
)
  go  
create table shop_receiptBill (
   receiptBillID        dm_billID            not null default '',
   orderID              dm_orderID           null default '',
   receiptAccount       varchar(100)         null default '',
   currencyID           varchar(3)           null default '',
   receiptAmount        dm_sum               null default 0,
   paymentType          varchar(30)          null default '',
   recieptType          varchar(50)          null default '',
   receipter            dm_name              null default '',
   remark               dm_remark            null default '',
   invoiceTitle         varchar(200)         null default '',
   receiptDate          dm_date              null default getdate(),
   handler              dm_memberID          null default '',
   bookDate             dm_date              null default getdate(),
   txID                 varchar(50)          null default '',
   poundage             dm_sum               null default 0,
   exchangeRate         float                null default 0,
   isTrash              dm_Bool              null default 0,
   isComplete           dm_Bool              null default 0,
   constraint PK_SHOP_RECEIPTBILL primary key nonclustered (receiptBillID)
)
  go  
create table shop_refundBill (
   refundBillID         dm_billID            not null default '',
   orderID              dm_orderID           null default '',
   refunder             dm_name              null default '',
   refunderAccount      varchar(100)         null default '',
   currencyID           varchar(3)           null default '',
   refundSum            dm_sum               null default 0,
   paymentType          varchar(30)          null default '',
   refundType           varchar(20)          null default '',
   refundBank           varchar(50)          null default '',
   deductIntegral       int                  null default 0,
   refundDate           dm_date              null default getdate(),
   bookDate             dm_date              null default getdate(),
   remark               dm_remark            null default '',
   handler              dm_memberID          null default '',
   isTrash              dm_Bool              null default 0,
   isComplete           dm_Bool              null default 0,
   constraint PK_SHOP_REFUNDBILL primary key nonclustered (refundBillID)
)
  go  
create table shop_registPage (
   GUIDCode             numeric              identity,
   registItem           varchar(20)          null default '',
   controlName          varchar(20)          null default '',
   isDisplay            dm_Bool              null default 1,
   constraint PK_SHOP_REGISTPAGE primary key nonclustered (GUIDCode)
)
  go  
create table shop_relaCombination (
   GUIDCode             numeric              identity,
   productID            dm_goodID            null default '',
   relaProductID        dm_goodID            null default '',
   orderIndex           dm_orderIndex        null default 0,
   constraint PK_SHOP_RELACOMBINATION primary key nonclustered (GUIDCode)
)
  go  
create table shop_relaFittings (
   GUIDCode             numeric              identity,
   productID            dm_goodID            null default '',
   relaProductID        dm_goodID            null default '',
   orderIndex           dm_orderIndex        null default 0,
   constraint PK_SHOP_RELAFITTINGS primary key nonclustered (GUIDCode)
)
  go  
create table shop_relaProducts (
   GUIDCode             numeric              identity,
   productID            dm_goodID            null default '',
   relaProductID        dm_goodID            null default '',
   orderIndex           dm_orderIndex        null default 0,
   constraint PK_SHOP_RELAPRODUCTS primary key nonclustered (GUIDCode)
)
  go  
create table shop_returnBill (
   reshippingID         dm_billID            not null default '',
   orderID              dm_orderID           null default '',
   deliveryID           dm_deliverID         null default '',
   deliveryBillID       dm_billID            null default '0',
   shippingFee          dm_sum               null default 0,
   insuranceFee         dm_sum               null default 0,
   returner             dm_name              null default '',
   returnAddress        dm_address           null default '',
   returnTel            dm_tel               null default '',
   returnMobi           dm_mobi              null default '',
   returnZip            dm_zip               null default '',
   returnReason         varchar(20)          null default '',
   returnDate           dm_date              null default getdate(),
   bookDate             dm_date              null default getdate(),
   remark               dm_remark            null default '',
   isTrash              dm_Bool              null default 0,
   isComplete           dm_Bool              null default 0,
   constraint PK_SHOP_RETURNBILL primary key nonclustered (reshippingID)
)
  go  
create table shop_returnProduct (
   GUIDCode             numeric              identity,
   reshippingID         dm_billID            null default '',
   productID            dm_goodID            null default '',
   productColor         varchar(60)          null default '',
   productSize          varchar(60)          null default '',
   buyPrice             dm_sum               null default 0,
   returnQty            dm_quantity          null default 0,
   constraint PK_SHOP_RETURNPRODUCT primary key nonclustered (GUIDCode)
)
  go  
create table shop_rolePower (
   GUIDCode             numeric              identity,
   roleID               dm_roleID            null default '',
   powerID              dm_permissionID      null default '',
   isPrivilege          dm_Bool              null default 0,
   constraint PK_SHOP_ROLEPOWER primary key nonclustered (GUIDCode)
)
  go  
create table shop_senderInfo (
   GUIDCode             numeric              identity,
   fromCity             varchar(30)          null default '',
   sender               dm_name              null default '',
   senderAddress        dm_address           null default '',
   senderCountry        varchar(50)          null default '',
   senderProvince       dm_province          null default '',
   senderCity           dm_city              null default '',
   senderTel            dm_tel               null default '',
   senderMobil          dm_mobi              null default '',
   senderZip            dm_zip               null default '',
   companyName          varchar(100)         null,
   isDefault            dm_Bool              null default 0,
   constraint PK_SHOP_SENDERINFO primary key nonclustered (GUIDCode)
)
  go  
create table shop_shippingBill (
   shipppBillID         dm_billID            not null default '',
   receiptor            dm_name              null default '',
   receiptorAdd         dm_address           null default '',
   receiptorEmail       dm_email             null default '',
   receiptorMobi        dm_mobi              null default '',
   receiptorTell        dm_tel               null default '',
   receiptorZip         dm_zip               null default '',
   orderID              dm_orderID           null default '',
   deliveryID           dm_deliverID         null default '',
   shippingFee          dm_sum               null default 0,
   insuranceFee         dm_sum               null default 0,
   deliveryBillID       dm_billID            null default '0',
   shippingDate         dm_date              null default getdate(),
   receiptDate          dm_date              null default getdate(),
   isReceipt            dm_Bool              null default 0,
   bookDate             dm_date              null default getdate(),
   remark               dm_remark            null default '',
   isTrash              dm_Bool              null default 0,
   isComplete           dm_Bool              null default 0,
   constraint PK_SHOP_SHIPPINGBILL primary key nonclustered (shipppBillID)
)
  go  
create table shop_shippingProduct (
   GUIDCode             numeric              identity,
   shipppBillID         dm_billID            null default '',
   productID            dm_goodID            null default '',
   productColor         varchar(60)          null default '',
   productSize          varchar(60)          null default '',
   buyPrice             dm_sum               null default 0,
   shippingQty          float                null default 0,
   constraint PK_SHOP_SHIPPINGPRODUCT primary key nonclustered (GUIDCode)
)
  go  
create table shop_siteBaseInfo (
   GUIDCode             numeric              identity,
   websiteName          varchar(100)         null default '',
   siteURL              varchar(100)         null default '',
   logoURL              dm_imgUrl            null default '',
   currencyName         varchar(10)          null default '',
   currencySymbol       varchar(10)          null default '',
   currencyText         varchar(10)          null default 'CNY',
   shopAddress          dm_address           null,
   shopTel              dm_tel               null,
   shopMobi             dm_mobi              null default '',
   shopZip              dm_zip               null,
   shopEmail            dm_email             null,
   shopICP              varchar(30)          null default '',
   openValidateCode     dm_Bool              null default 1,
   openCoupon           dm_Bool              null default 0,
   openMagnify          dm_Bool              null default 0,
   openDiscount         dm_Bool              null default 0,
   siteFooter           text                 null default '',
   promptAgain          dm_Bool              null default 1,
   constraint PK_SHOP_SITEBASEINFO primary key nonclustered (GUIDCode)
)
  go  
create table shop_siteImageSet (
   GUIDCode             numeric              identity,
   miniatureWidth       int                  null default 0,
   miniatureHeight      int                  null default 0,
   particularWidth      int                  null default 0,
   particularHeight     int                  null default 0,
   albumWidth           int                  null default 0,
   albumHeight          int                  null default 0,
   markText             varchar(50)          null default '',
   markTextPosition     int                  null default 0,
   markTextSize         int                  null default 9,
   markTextColor        varchar(7)           null default '#000000',
   markImg              dm_imgUrl            null default '',
   markImgPosition      int                  null default 0,
   transparence         int                  null default 100,
   watermark            int                  null default 0,
   miniatureDefaultImg  dm_imgUrl            null default '',
   particularDefaultImg dm_imgUrl            null default '',
   albumDefaultImg      dm_imgUrl            null default '',
   magnifier            dm_Bool              null default 1,
   constraint PK_SHOP_SITEIMAGESET primary key nonclustered (GUIDCode)
)
  go  
create table shop_siteMessage (
   GUIDCode             numeric              identity,
   messageSubject       varchar(100)         null default '',
   messageContent       varchar(1000)        null default '',
   sender               dm_memberID          null default '',
   receiver             dm_memberID          null default '',
   postDate             dm_date              null default getdate(),
   messageStatus        int                  null default 1,
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_SITEMESSAGE primary key nonclustered (GUIDCode)
)
  go  
create table shop_siteNotice (
   GUIDCode             numeric              identity,
   noticeTitle          varchar(50)          null default '',
   noticeContent        text                 null default '',
   adminID              dm_memberID          null default '',
   orderIndex           dm_orderIndex        null default 0,
   postDate             datetime             null default getdate(),
   isChecked            bit                  null default 0,
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_SITENOTICE primary key nonclustered (GUIDCode)
)
  go  
create table shop_siteSEO (
   GUIDCode             numeric              identity,
   indexTitle           varchar(1000)        null default '',
   indexKey             varchar(1000)        null default '',
   indexDescript        varchar(1000)        null default '',
   constraint PK_SHOP_SITESEO primary key nonclustered (GUIDCode)
)
  go  
create table shop_siteSubject (
   siteSubjID           varchar(5)           not null default '',
   siteSubjName         varchar(50)          null default '',
   siteSubjURL          dm_linkUrl           null default '',
   siteSelect           varchar(500)         null default '',
   siteWhere            text                 null default '',
   pageTarget           varchar(7)           null default '_self',
   isDisplay            dm_Bool              null default 1,
   isURL                dm_Bool              null default 0,
   siteSubTitle         varchar(1000)        null default '',
   siteSubKey           varchar(1000)        null default '',
   siteSubDescript      varchar(1000)        null default '',
   orderIndex           dm_orderIndex        null default 0,
   isTrash              dm_Bool              null default 0,
   constraint PK_SHOP_SITESUBJECT primary key nonclustered (siteSubjID)
)
  go  
create table shop_siteTemplates (
   templateName         dm_templateName      not null default '',
   templateTitle        varchar(50)          null default '',
   appTheme             varchar(30)          null default '',
   isCurrent            dm_Bool              null default 0,
   constraint PK_SHOP_SITETEMPLATES primary key nonclustered (templateName)
)
  go  
create table shop_smsSet (
   GUIDCode             numeric              identity,
   SMSUserID            varchar(30)          null default '',
   SMSPwd               varchar(30)          null default '',
   orderNotify          dm_Bool              null default 0,
   memberNotify         dm_Bool              null default 0,
   messageNotify        dm_Bool              null default 0,
   payNotify            dm_Bool              null default 0,
   managerMobi          varchar(200)         null default '',
   constraint PK_SHOP_SMSSET primary key nonclustered (GUIDCode)
)
  go  
create table shop_smtpSet (
   sendType             varchar(1)           not null default '0',
   yourEmail            varchar(50)          null default '',
   yourName             varchar(50)          null default '',
   smptServer           varchar(50)          null default '',
   smptPort             varchar(10)          null default '',
   smptUser             varchar(30)          null default '',
   smptPwd              varchar(30)          null default '',
   constraint PK_SHOP_SMTPSET primary key nonclustered (sendType)
)
  go  
create table shop_subscribe (
   Email                dm_email             not null default '',
   realName             dm_name              null default '',
   applicateDate        dm_date              null,
   subscribeStatus      int                  null default 1,
   constraint PK_SHOP_SUBSCRIBE primary key nonclustered (Email)
)
  go  
create table shop_voucher (
   voucherID            dm_voucherID         not null default '',
   voucherSum           money                null default 0,
   leastBuySum          dm_sum               null default 0,
   memberID             dm_memberID          null default '',
   creator              dm_memberID          null default '',
   createDate           dm_date              null default getdate(),
   expiredDate          dm_date              null default getdate(),
   IP                   dm_ip                null default '',
   ipLocation           dm_ipLocation        null default '',
   voucherStatus        varchar(20)          null default '0',
   orderID              dm_orderID           null default '',
   isTrash              dm_Bool              null default 0,
   remark               dm_remark            null default '',
   constraint PK_SHOP_VOUCHER primary key nonclustered (voucherID)
)
  go  
create table shop_webLayout (
   GUIDCode             numeric              identity,
   templateName         dm_templateName      null default '',
   webName              varchar(20)          null default '',
   moduleName           varchar(30)          null default '',
   moduleBrief          varchar(30)          null default '',
   modulePosition       varchar(5)           null default '',
   subModulePosition    varchar(50)          null default '',
   moduleTitle          varchar(20)          null default '',
   moduleCSS1           varchar(100)         null default '',
   moduleCSS2           varchar(100)         null default '',
   moduleContent        text                 null default '',
   productTag           varchar(200)         null default '',
   displayCol           int                  null default 5,
   displayCount         int                  null default 10,
   isDisplay            dm_Bool              null default 1,
   orderIndex           dm_orderIndex        null default 0,
   moduleType           int                  null default -1,
   isSystem             dm_Bool              null default 0,
   isPublish            dm_Bool              null default 0,
   editor               varchar(100)         null default '',
   constraint PK_SHOP_WEBLAYOUT primary key nonclustered (GUIDCode)
)
  go  
alter table shop_account
   add constraint FK_SHOP_ACC_MEMBERAND_SHOP_MEM foreign key (memberID)
      references shop_member (memberID)
         on delete cascade
  go  
alter table shop_addressBook
   add constraint FK_SHOP_ADD_MEMBERAND_SHOP_MEM foreign key (memberID)
      references shop_member (memberID)
         on delete cascade
  go  
alter table shop_blogInTag
   add constraint FK_SHOP_BLO_BLOGANDTA_SHOP_BLO foreign key (blogID)
      references shop_blogs (blogID)
         on delete cascade
  go  
alter table shop_memberInfo
   add constraint FK_SHOP_MEM_MEMBERMEM_SHOP_MEM foreign key (memberID)
      references shop_member (memberID)
         on delete cascade
  go  
alter table shop_memberIntegral
   add constraint FK_SHOP_MEM_MEMBERAND_SHOP_MEM foreign key (memberID)
      references shop_member (memberID)
         on delete cascade
  go  
alter table shop_orderProducts
   add constraint FK_SHOP_ORD_ORDERANDO_SHOP_ORD foreign key (orderID)
      references shop_order (orderID)
         on delete cascade
  go  
alter table shop_productInTag
   add constraint FK_SHOP_PRO_PROPROTAG_SHOP_PRO foreign key (productID)
      references shop_products (productID)
         on delete cascade
  go  
alter table shop_productsImg
   add constraint FK_SHOP_PRO_PRODUCTSA_SHOP_PRO foreign key (productID)
      references shop_products (productID)
         on delete cascade
  go  
alter table shop_relaFittings
   add constraint FK_SHOP_REL_PRODUCTSR_SHOP_PRO foreign key (productID)
      references shop_products (productID)
         on delete cascade
  go  
alter table shop_relaProducts
   add constraint FK_SHOP_REL_PRORELPRO_SHOP_PRO foreign key (productID)
      references shop_products (productID)
         on delete cascade
  go  
alter table shop_returnProduct
   add constraint FK_SHOP_RET_RETURNAND_SHOP_RET foreign key (reshippingID)
      references shop_returnBill (reshippingID)
         on delete cascade
  go  
alter table shop_rolePower
   add constraint FK_SHOP_ROL_ROLEANDRO_SHOP_ADM foreign key (roleID)
      references shop_adminRole (roleID)
         on delete cascade
  go  
alter table shop_shippingProduct
   add constraint FK_SHOP_SHI_SHIPPINGA_SHOP_SHI foreign key (shipppBillID)
      references shop_shippingBill (shipppBillID)
         on delete cascade
 go 
alter table shop_voucher
   add constraint FK_SHOP_VOU_MEMBERAND_SHOP_MEM foreign key (memberID)
      references shop_member (memberID)
         on delete cascade