当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
2 Star 8 Fork 4

imnote/noap-news
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
db.sql 16.57 KB
一键复制 编辑 原始数据 按行查看 历史
lwx 提交于 2017-10-21 09:59 . first commit
USE [master]
GO
/****** Object: Database [noap] Script Date: 2017/1/3 12:09:52 ******/
CREATE DATABASE [noap]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'noap', FILENAME = N'D:\ASP\Noap.com\db\noap.mdf' , SIZE = 5120KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'noap_log', FILENAME = N'D:\ASP\Noap.com\db\noap_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [noap] SET COMPATIBILITY_LEVEL = 120
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [noap].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [noap] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [noap] SET ANSI_NULLS OFF
GO
ALTER DATABASE [noap] SET ANSI_PADDING OFF
GO
ALTER DATABASE [noap] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [noap] SET ARITHABORT OFF
GO
ALTER DATABASE [noap] SET AUTO_CLOSE ON
GO
ALTER DATABASE [noap] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [noap] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [noap] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [noap] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [noap] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [noap] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [noap] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [noap] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [noap] SET DISABLE_BROKER
GO
ALTER DATABASE [noap] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [noap] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [noap] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [noap] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [noap] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [noap] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [noap] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [noap] SET RECOVERY SIMPLE
GO
ALTER DATABASE [noap] SET MULTI_USER
GO
ALTER DATABASE [noap] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [noap] SET DB_CHAINING OFF
GO
ALTER DATABASE [noap] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )
GO
ALTER DATABASE [noap] SET TARGET_RECOVERY_TIME = 0 SECONDS
GO
ALTER DATABASE [noap] SET DELAYED_DURABILITY = DISABLED
GO
USE [noap]
GO
/****** Object: Table [dbo].[ask] Script Date: 2017/1/3 12:09:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ask](
[id] [int] IDENTITY(1,1) NOT NULL,
[skills] [varchar](255) NOT NULL,
[contents] [varchar](255) NOT NULL,
[created_at] AS (getdate()),
[user_id] [int] NOT NULL,
CONSTRAINT [PK_ask] 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]
GO
/****** Object: Table [dbo].[blacklist] Script Date: 2017/1/3 12:09:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[blacklist](
[user_id] [int] NOT NULL
) ON [PRIMARY]
GO
/****** Object: Table [dbo].[columns] Script Date: 2017/1/3 12:09:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[columns](
[id] [int] IDENTITY(1,1) NOT NULL,
[column_name] [varchar](255) NOT NULL,
[description] [varchar](255) NOT NULL,
[created_at] AS (getdate()),
CONSTRAINT [PK_columns] 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]
GO
/****** Object: Table [dbo].[comments] Script Date: 2017/1/3 12:09:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[comments](
[id] [int] IDENTITY(1,1) NOT NULL,
[name] [varchar](255) NOT NULL,
[comments] [varchar](500) NOT NULL,
[user_id] [int] NOT NULL,
[news_id] [int] NOT NULL,
[user_img] [varchar](255) NOT NULL,
[created_at] [datetime] NULL,
CONSTRAINT [PK_comments] 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]
GO
/****** Object: Table [dbo].[drafts] Script Date: 2017/1/3 12:09:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[drafts](
[id] [int] IDENTITY(1,1) NOT NULL,
[column_name] [varchar](255) NOT NULL,
[title] [varchar](255) NOT NULL,
[contents] [text] NOT NULL,
[writer] [varchar](255) NOT NULL,
[source] [varchar](255) NULL,
[user_id] [int] NOT NULL,
[created_at] [datetime] NOT NULL,
[updated_at] AS (getdate()),
CONSTRAINT [PK_drafts] 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]
GO
/****** Object: Table [dbo].[news] Script Date: 2017/1/3 12:09:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[news](
[id] [int] IDENTITY(1,1) NOT NULL,
[column_name] [varchar](255) NOT NULL,
[title] [varchar](255) NOT NULL,
[contents] [text] NOT NULL,
[writer] [varchar](255) NOT NULL,
[source] [varchar](255) NULL,
[user_id] [int] NOT NULL,
[created_at] [datetime] NOT NULL,
[updated_at] AS (getdate()),
CONSTRAINT [PK_news] 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]
GO
/****** Object: Table [dbo].[role_user] Script Date: 2017/1/3 12:09:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[role_user](
[user_id] [int] NOT NULL,
[role_id] [int] NOT NULL,
CONSTRAINT [PK_role_id] PRIMARY KEY CLUSTERED
(
[user_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]
GO
/****** Object: Table [dbo].[roles] Script Date: 2017/1/3 12:09:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[roles](
[id] [int] IDENTITY(1,1) NOT NULL,
[name] [varchar](255) NOT NULL,
[display_name] [varchar](255) NOT NULL,
[description] [varchar](255) NOT NULL,
[created_at] AS (getdate()),
CONSTRAINT [PK_roles] 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]
GO
/****** Object: Table [dbo].[users] Script Date: 2017/1/3 12:09:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[users](
[id] [int] IDENTITY(1,1) NOT NULL,
[name] [varchar](255) NOT NULL,
[email] [varchar](255) NOT NULL,
[password] [varchar](60) NOT NULL,
[sex] [varchar](2) NULL,
[photo] [varchar](255) NULL,
[education] [varchar](255) NULL,
[location] [varchar](255) NULL,
[notes] [varchar](255) NULL,
[created_at] [datetime] NULL,
[birth] [varchar](10) NULL,
CONSTRAINT [PK_user] 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]
GO
ALTER TABLE [dbo].[role_user] ADD CONSTRAINT [DF_role_id_role_id] DEFAULT ((3)) FOR [role_id]
GO
ALTER TABLE [dbo].[ask] WITH CHECK ADD CONSTRAINT [FK_ask_user] FOREIGN KEY([user_id])
REFERENCES [dbo].[users] ([id])
GO
ALTER TABLE [dbo].[ask] CHECK CONSTRAINT [FK_ask_user]
GO
ALTER TABLE [dbo].[blacklist] WITH CHECK ADD CONSTRAINT [FK_blacklist_users] FOREIGN KEY([user_id])
REFERENCES [dbo].[users] ([id])
GO
ALTER TABLE [dbo].[blacklist] CHECK CONSTRAINT [FK_blacklist_users]
GO
ALTER TABLE [dbo].[comments] WITH CHECK ADD CONSTRAINT [FK_news_comments] FOREIGN KEY([news_id])
REFERENCES [dbo].[news] ([id])
GO
ALTER TABLE [dbo].[comments] CHECK CONSTRAINT [FK_news_comments]
GO
ALTER TABLE [dbo].[role_user] WITH CHECK ADD CONSTRAINT [FK_role_id] FOREIGN KEY([role_id])
REFERENCES [dbo].[roles] ([id])
GO
ALTER TABLE [dbo].[role_user] CHECK CONSTRAINT [FK_role_id]
GO
ALTER TABLE [dbo].[role_user] WITH CHECK ADD CONSTRAINT [FK_user_id] FOREIGN KEY([user_id])
REFERENCES [dbo].[users] ([id])
GO
ALTER TABLE [dbo].[role_user] CHECK CONSTRAINT [FK_user_id]
GO
USE [master]
GO
ALTER DATABASE [noap] SET READ_WRITE
GO
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/imnote/noap-news.git
[email protected]:imnote/noap-news.git
imnote
noap-news
noap-news
master

搜索帮助