create database agebook;
--先复制创建数据库在运行以下代码
use agebook;
--留言表
CREATE TABLE [dbo].[A_Message](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[Title] [varchar](50) NULL,
	[Contents] [ntext] NULL,
	[M_user] [varchar](50) NULL,
	[M_Ip] [varchar](50) NULL,
	[Rey_Contents] [text] NULL,
	[AddTime] [datetime] NULL,
	[ReyTime] [datetime] NULL,
 CONSTRAINT [PK_Message] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

--后台管理表
CREATE TABLE [dbo].[A_Admin](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](50) NULL,
	[Password] [varchar](50) NULL,
	[Loginip] [varchar](50) NULL,
 CONSTRAINT [PK_A_Admin] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

---后台用户登录日志表
CREATE TABLE [dbo].[A_System_login_log](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[CreateDate] [datetime] NULL,
	[LoginName] [varchar](50) NULL,
	[Status] [varchar](50) NULL,
	[IPAddress] [varchar](50) NULL,
	[IPAddressName] [varchar](200) NULL,
 CONSTRAINT [PK_Odd_ System_login_log] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

---创建前台幻图片表
CREATE TABLE [dbo].[A_Magiclantern](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[MagicName] [ntext] NULL,
	[MagicUrl] [ntext] NULL,
	[MagicImage] [varchar](200) NULL,
	[AddTime] [ntext] NULL,
 CONSTRAINT [PK_Magiclantern] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
