
CREATE TABLE [dbo].[admins](
	[adminid] [int] IDENTITY(1,1) NOT NULL,
	[adminuser] [nvarchar](50) NULL,
	[adminpass] [nvarchar](50) NULL,
 CONSTRAINT [PK_admins] PRIMARY KEY CLUSTERED 
(
	[adminid] ASC
)
)

CREATE TABLE [dbo].[class](
	[classid] [int] IDENTITY(1,1) NOT NULL,
	[classname] [nvarchar](50) NULL,
	[classkeywords] [nvarchar](500) NULL,
	[classdescription] [nvarchar](1000) NULL,
	[classfather] [int] NULL,
	[classorder] [int] NULL CONSTRAINT [DF_class_classorder]  DEFAULT ((0)),
 CONSTRAINT [PK_class] PRIMARY KEY CLUSTERED 
(
	[classid] ASC
)
)

CREATE TABLE [dbo].[keywords](
	[keywordid] [int] IDENTITY(1,1) NOT NULL,
	[keywordtitle] [nvarchar](50) NULL,
	[keywordurl] [nvarchar](200) NULL,
	[keywordhot] [int] NULL CONSTRAINT [DF_keywords_keywordhot]  DEFAULT ((1)),
	[keywordtime] [datetime] NULL CONSTRAINT [DF_keywords_keywordtime]  DEFAULT (getdate()),
 CONSTRAINT [PK_keywords] PRIMARY KEY CLUSTERED 
(
	[keywordid] ASC
)
)

CREATE TABLE [dbo].[users](
	[userid] [int] IDENTITY(1,1) NOT NULL,
	[username] [nvarchar](50) NULL,
	[userpass] [nvarchar](50) NULL,
	[useremail] [nvarchar](50) NULL,
	[usertel] [nvarchar](50) NULL,
	[userdress] [nvarchar](200) NULL,
	[userpost] [nvarchar](50) NULL,
	[userip] [nvarchar](50) NULL,
	[usertime] [datetime] NULL CONSTRAINT [DF_cn_user_usertime]  DEFAULT (getdate()),
	[emailor] [int] NULL CONSTRAINT [DF_cn_user_useror]  DEFAULT ((0)),
	[sendemailor] [int] NULL CONSTRAINT [DF_cn_user_sendemailor]  DEFAULT ((0)),
	[emailnotice] [int] NULL CONSTRAINT [DF_cn_user_emailnotice]  DEFAULT ((1)),
	[userviptime] [datetime] NULL CONSTRAINT [DF_cn_user_userviptime]  DEFAULT (getdate()),
	[usersiteurl] [nvarchar](100) NULL,
	[userqq] [nvarchar](50) NULL,
	[userwangwang] [nvarchar](50) NULL,
	[useredittime] [datetime] NULL CONSTRAINT [DF_cn_user_useredittime]  DEFAULT (getdate()),
	[userrole] [int] NULL CONSTRAINT [DF_cn_user_userrole]  DEFAULT ((0)),
	[usermoney] [money] NULL CONSTRAINT [DF_cn_user_usermoney]  DEFAULT ((0)),
	[usercountmoney] [money] NULL CONSTRAINT [DF_cn_user_usercountmoney]  DEFAULT ((0)),
	[usertext] [nvarchar](500) NULL,
	[userdel] [int] NULL CONSTRAINT [DF_cn_user_userdel]  DEFAULT ((1)),
 CONSTRAINT [PK_cn_user] PRIMARY KEY CLUSTERED 
(
	[userid] ASC
)
)

CREATE TABLE [dbo].[aliusers](
	[siteid] [int] IDENTITY(1,1) NOT NULL,
	[aliuser] [nvarchar](50) NULL,
	[alisiteid] [nvarchar](50) NULL,
	[aliadzoneid] [nvarchar](50) NULL,
	[sitename] [nvarchar](50) NULL,
	[siteurl] [nvarchar](50) NULL,
	[sitepostpic] [nvarchar](100) NULL,
	[sitesqlip] [nvarchar](50) NULL,
	[sitesqltcp] [nvarchar](50) NULL,
	[sitesqldata] [nvarchar](50) NULL,
	[sitesqluser] [nvarchar](50) NULL,
	[sitesqlpass] [nvarchar](50) NULL,
	[sitetype] [nvarchar](50) NULL,
 CONSTRAINT [PK_aliusers] PRIMARY KEY CLUSTERED 
(
	[siteid] ASC
)
)

CREATE TABLE [dbo].[products](
	[productid] [int] IDENTITY(1,1) NOT NULL,
	[itemid] [bigint] NULL,
	[sellerid] [bigint] NULL,
	[productname] [nvarchar](200) NOT NULL,
	[productkeywords] [nvarchar](500) NULL,
	[productdescription] [nvarchar](1000) NULL,
	[productsum] [int] NULL,
	[classid] [int] NULL,
	[shopurl] [nvarchar](2000) NULL,
	[producturl] [nvarchar](2000) NULL,
	[productpicurl] [nvarchar](1000) NULL,
	[shophot] [int] NULL CONSTRAINT [DF_products_shophot]  DEFAULT ((0)),
	[producthot] [int] NULL CONSTRAINT [DF_products_producthot]  DEFAULT ((0)),
	[productprice] [money] NULL CONSTRAINT [DF_products_productprice]  DEFAULT ((0)),
	[producttext] [ntext] NULL,
	[productpic] [nvarchar](100) NULL,
	[producttime] [datetime] NULL CONSTRAINT [DF_products_producttime]  DEFAULT (getdate()),
	[producttop] [int] NULL CONSTRAINT [DF_products_producttop]  DEFAULT ((0)),
 CONSTRAINT [PK_products] PRIMARY KEY CLUSTERED 
(
	[productid] ASC
)
)