if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[psz_admin]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[psz_admin]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[psz_article]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[psz_article]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[psz_order]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[psz_order]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[psz_user]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[psz_user]
GO

CREATE TABLE [dbo].[psz_admin] (
	[aid] [int] NOT NULL ,
	[adminid] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[password] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[remark] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[logintime] [int] NULL ,
	[logindate] [smalldatetime] NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[psz_article] (
	[aid] [int] NOT NULL ,
	[title] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[atime] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[rank] [int] NULL ,
	[content] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[keyword] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[mydescription] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[mytype] [text] COLLATE Chinese_PRC_CI_AS NULL ,
	[hits] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[psz_order] (
	[tid] [int] NOT NULL ,
	[alipay_no] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[trade_username] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[subject] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[mail_fee] [int] NULL ,
	[total_fee] [int] NULL ,
	[alipay_total_fee] [int] NULL ,
	[color] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[body] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[alipay_email] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[trade_status] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[alipay_trade_date] [smalldatetime] NULL ,
	[trade_date] [smalldatetime] NULL ,
	[next_mail_date] [smalldatetime] NULL ,
	[last_mail_date] [smalldatetime] NULL ,
	[mail_date] [smalldatetime] NULL ,
	[have_mail_times] [int] NULL ,
	[mail_month] [int] NULL ,
	[mail_number] [int] NULL ,
	[total_number] [int] NULL ,
	[total_mail] [int] NULL ,
	[gustbook] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[isforone] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
	[username] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[useremail] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[userphone] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[userzip] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[usercity] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[useraddress] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
	[express] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[psz_user] (
	[uid] [int] NOT NULL ,
	[userID] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[password] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[username] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[useremail] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[userphone] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[userzip] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[usercity] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[useraddress] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
	[usergustbook] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
	[reg_date] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[login_times] [int] NULL ,
	[login_date] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
	[marker] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

