-- =============================================
-- 測試系統
-- 2018-4-12
-- =============================================
USE master
GO
-- Drop the database if it already exists
IF EXISTS (
SELECT name
FROM sys.databases
WHERE name = N'TestSys'
)
DROP DATABASE TestSys
GO
CREATE DATABASE TestSys
GO
use TestSys
go
-- 資源表
create table Src
(
Id int primary key identity(10001,1), --編號【ID,PK】
Name varchar(200), --系統名稱
Intro text, --系統介紹
Content1 text, --測試內容
Content2 text, --原型內容
)
-- 帳戶表
create table Account
(
Id int primary key identity(10001,1), --編號【ID,PK】
Name varchar(200) unique, --用戶名【UQ】
Pwd varchar(200), --密碼
IsDisabled bit --是否禁用
)
-- 帳戶資源表(權限表)
create table AccountSrc
(
Id int primary key identity(10001,1), --編號【ID,PK】
AccountId int, --帳戶Id
SrcId int, --資源Id
)