ユーザー権限管理モジュール【表構造及びSQL文】

27392 ワード

tb_user:ユーザーアカウント情報テーブル
列名
データ型
空の許可
説明
UserName
nvarchar(128)
N
ユーザID
Password
nvarchar(128)
N
ログイン名、ユーザーEmail
Email
nvarchar(100)
Y
パスワード
Question
nvarchar(100)
Y
パスワードをリセットする問題
Answer
nvarchar(100)
Y
パスワードの答えをリセット
RoleID
int
N
ロール#ロール#
UserGroup
int
N
ユーザーグループ
CreateTime
datetime
N
アカウント作成時間
LastLoginTime
datetime
Y
前回ログインした時刻
Status
int
N
ユーザーステータス
IsOnline
bit
N
オンライン
IsLimit
bit
N
権限に制限されているかどうか、0は制限されています
 
 
 
 
/*20120611 BY FMX   */
USE [SH_Cloud]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE  [dbo].[tb_User](
	[UserID]        [int] IDENTITY(1,1) NOT NULL,
	[UserName]      [nvarchar](128) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Password]      [nvarchar](128) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Email]         [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[Question]      [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[Answer]        [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
	[RoleID]        [int] NOT NULL CONSTRAINT [DF_Users_RoleID]  DEFAULT ((0)),
	[UserGroup]     [int] NOT NULL CONSTRAINT [DF_Users_UserGroup]  DEFAULT ((0)),
	[CreateTime]    [datetime] NOT NULL,
	[LastLoginTime] [datetime] NULL,
	[Status]        [int] NOT NULL CONSTRAINT [DF_Users_Status]  DEFAULT ((1)),
	[IsOnline]      [bit] NOT NULL CONSTRAINT [DF_Users_IsOnline]  DEFAULT ((0)),
	[IsLimit]       [bit] NOT NULL CONSTRAINT [DF_Users_IsLimit]  DEFAULT ((0)),
 CONSTRAINT [PK_User_ID] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User', @level2type=N'COLUMN', @level2name=N'UserID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'   ,  Email' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User', @level2type=N'COLUMN', @level2name=N'UserName'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User', @level2type=N'COLUMN', @level2name=N'Password'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'       ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User', @level2type=N'COLUMN', @level2name=N'Question'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'       ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User', @level2type=N'COLUMN', @level2name=N'Answer'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User', @level2type=N'COLUMN', @level2name=N'RoleID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'   ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User', @level2type=N'COLUMN', @level2name=N'UserGroup'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'      ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User', @level2type=N'COLUMN', @level2name=N'CreateTime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'        ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User', @level2type=N'COLUMN', @level2name=N'LastLoginTime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User', @level2type=N'COLUMN', @level2name=N'Status'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User', @level2type=N'COLUMN', @level2name=N'IsOnline'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'       ,0    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User', @level2type=N'COLUMN', @level2name=N'IsLimit'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'       ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_User'

tb_Role:ロール情報テーブル
列名
データ型
空の許可
説明
RoleID
int
N
ロールID
RoleGroupID
int
N
パケットID
RoleName
nvarchar(30)
N
ロール名
RoleDescription
nvarchar(50)
Y
説明
RoleOrder
int
N
ツールバーの
 
 
 
 
/*20120611 BY FMX */
USE [SH_Cloud]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tb_Role](
	[RoleID]            [int] IDENTITY(1,1) NOT NULL,
	[RoleGroupID]       [int] NOT NULL,
	[RoleName]          [nvarchar](30) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[RoleDescription]   [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[RoleOrder]         [int] NOT NULL CONSTRAINT [DF_tb_Role_RoleOrder]  DEFAULT ((0)),
 CONSTRAINT [PK_tb_Role_1] PRIMARY KEY CLUSTERED 
(
	[RoleID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Role', @level2type=N'COLUMN', @level2name=N'RoleID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Role', @level2type=N'COLUMN', @level2name=N'RoleGroupID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Role', @level2type=N'COLUMN', @level2name=N'RoleName'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Role', @level2type=N'COLUMN', @level2name=N'RoleDescription'

tb_Action:権限情報テーブル
列名
データ型
空の許可
説明
ActionID
int
N
権限ID
ActionName
nvarchar(30)
N
権限名
ActionTag
nvarchar(50)
N
権限ID
ActionDescription
nvarchar(50)
Y
説明
ActionOrder
int
N
ツールバーの
/*20120611 BY FMX     */
USE [SH_Cloud]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tb_Action](
	[ActionID]          [int] IDENTITY(1,1) NOT NULL,
	[ActionName]        [nvarchar](30) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ActionTag]         [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[ActionDescription] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[ActionOrder]       [int] NOT NULL CONSTRAINT [DF_ActionDir_ActionOrder]  DEFAULT ((0)),
 CONSTRAINT [PK_tb_Action_1] PRIMARY KEY CLUSTERED 
(
	[ActionID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Action', @level2type=N'COLUMN', @level2name=N'ActionID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Action', @level2type=N'COLUMN', @level2name=N'ActionName'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Action', @level2type=N'COLUMN', @level2name=N'ActionTag'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Action', @level2type=N'COLUMN', @level2name=N'ActionDescription'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Action', @level2type=N'COLUMN', @level2name=N'ActionOrder'

tb_Group:パケット情報テーブル
列名
データ型
空の許可
説明
GroupID
int
N
パケットID
GroupName
nvarchar(30)
N
グループ名
GroupOrder
int
N
ツールバーの
GroupDescription
nvarchar(50)
Y
説明
GroupType
int
N
グループタイプユーザーグループ0、ロールグループ1
/*20120611 BY FMX    */
USE [SH_Cloud]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tb_Group](
	[GroupID]          [int] IDENTITY(1,1) NOT NULL,
	[GroupName]        [nvarchar](30) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[GroupOrder]       [int] NOT NULL CONSTRAINT [DF_RGP_UserGroup_UserGroupOrder]  DEFAULT ((0)),
	[GroupDescription] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[GroupType]        [int] NOT NULL CONSTRAINT [DF_tb_Group_GroupType]  DEFAULT ((0)),
 CONSTRAINT [PK_tb_Group] PRIMARY KEY CLUSTERED 
(
	[GroupID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Group', @level2type=N'COLUMN', @level2name=N'GroupID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'   ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Group', @level2type=N'COLUMN', @level2name=N'GroupName'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Group', @level2type=N'COLUMN', @level2name=N'GroupOrder'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Group', @level2type=N'COLUMN', @level2name=N'GroupDescription'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'        0,   1' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Group', @level2type=N'COLUMN', @level2name=N'GroupType'

tb_UserRole:ユーザーロール情報テーブル
列名
データ型
空の許可
説明
UR_ID
int
N
ユーザロールID
UserID
int
N
ユーザID
RoleID
int
N
ロールID
/*20120611 BY FMX       */
USE [SH_Cloud]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tb_UserRole](
	[UR_ID]  [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[RoleID] [int] NOT NULL,
 CONSTRAINT [PK_tb_UserRole] PRIMARY KEY CLUSTERED 
(
	[UR_ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

 
tb_UserGroup:ユーザーグループ情報テーブル
列名
データ型
空の許可
説明
UG_ID
int
N
ユーザグループID
UG_Name
nvarchar(30)
N
ユーザーグループ名
UG_Order
int
N
ユーザーグループのソート
UG_Description
nvarchar(50)
N
ユーザグループの説明
UG_Depth
int
N
ユーザーグループの深さ
UG_SuperiorID
int
N
ユーザーグループの親
UG_Count
int
N
ユーザーグループの下位数
/*20120611 BY FMX        */
USE [SH_Cloud]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tb_UserGroup](
	[UG_ID]          [int] IDENTITY(1,1) NOT NULL,
	[UG_Name]        [nvarchar](30) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[UG_Order]       [int] NOT NULL,
	[UG_Description] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[UG_Depth]       [int] NOT NULL CONSTRAINT [DF_tb_UserGroup_UG_Depth]  DEFAULT ((0)),
	[UG_SuperiorID]  [int] NOT NULL CONSTRAINT [DF_tb_UserGroup_UG_SuperiorID]  DEFAULT ((0)),
	[UG_Count]       [int] NOT NULL CONSTRAINT [DF_tb_UserGroup_UG_Count]  DEFAULT ((0)),
 CONSTRAINT [PK_tb_UserGroup] PRIMARY KEY CLUSTERED 
(
	[UG_ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'   ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_UserGroup', @level2type=N'COLUMN', @level2name=N'UG_ID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'      ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_UserGroup', @level2type=N'COLUMN', @level2name=N'UG_Name'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'      ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_UserGroup', @level2type=N'COLUMN', @level2name=N'UG_Order'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'      ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_UserGroup', @level2type=N'COLUMN', @level2name=N'UG_Description'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'      ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_UserGroup', @level2type=N'COLUMN', @level2name=N'UG_Depth'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'      ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_UserGroup', @level2type=N'COLUMN', @level2name=N'UG_SuperiorID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'       ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_UserGroup', @level2type=N'COLUMN', @level2name=N'UG_Count'

tb_MenuType:メニュータイプ情報テーブル
列名
データ型
空の許可
説明
MenuTypeID
int
N
メニュー分類ID
MenuTypeName
nvarchar(30)
N
メニュータイプ名
MenuTypeOrder
int
N
ツールバーの
MenuTypeDescription
nvarchar(50)
Y
説明
MenuTypeDepth
int
N
深さ
MenuTypeSuperiorID
int
N
上位ID
MenuTypeCount
int
N
次数
/*20120611 BY FMX      */
USE [SH_Cloud]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tb_MenuType](
	[MenuTypeID]          [int] IDENTITY(1,1) NOT NULL,
	[MenuTypeName]        [nvarchar](30) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MenuTypeOrder]       [int] NOT NULL CONSTRAINT [DF_ModuleGroup_ModuleGroupOrder]  DEFAULT ((0)),
	[MenuTypeDescription] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[MenuTypeDepth]       [int] NOT NULL CONSTRAINT [DF_tb_MenuType_MenuTypeDepth]  DEFAULT ((0)),
	[MenuTypeSuperiorID]  [int] NOT NULL CONSTRAINT [DF_tb_MenuType_MenuTypeSuperiorID]  DEFAULT ((0)),
	[MenuTypeCount]       [int] NOT NULL CONSTRAINT [DF_tb_MenuType_MenuTypeCount]  DEFAULT ((0)),
 CONSTRAINT [PK_tb_MenuType_1] PRIMARY KEY CLUSTERED 
(
	[MenuTypeID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_MenuType', @level2type=N'COLUMN', @level2name=N'MenuTypeID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'      ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_MenuType', @level2type=N'COLUMN', @level2name=N'MenuTypeName'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_MenuType', @level2type=N'COLUMN', @level2name=N'MenuTypeOrder'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_MenuType', @level2type=N'COLUMN', @level2name=N'MenuTypeDescription'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_MenuType', @level2type=N'COLUMN', @level2name=N'MenuTypeDepth'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_MenuType', @level2type=N'COLUMN', @level2name=N'MenuTypeSuperiorID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_MenuType', @level2type=N'COLUMN', @level2name=N'MenuTypeCount'

tb_Menu:メニュー情報テーブル
列名
データ型
空の許可
説明
MenuID
int
N
メニューID
MenuTypeID
int
N
メニューの種類
MenuName
nvarchar(30)
N
メニュー名
MenuTag
nvarchar(50)
N
メニューID
MenuURL
nvarchar(500)
Y
メニューアドレス
MenuDisabled
bit
N
無効化
MenuOrder
int
N
ツールバーの
MenuDescription
nvarchar(50)
Y
説明
IsMenu
bit
N
ナビゲーションメニューに表示するかどうか
/*20120611 BY FMX     */
USE [SH_Cloud]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tb_Menu](
	[MenuID]          [int] IDENTITY(1,1) NOT NULL,
	[MenuTypeID]      [int] NOT NULL,
	[MenuName]        [nvarchar](30) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MenuTag]         [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[MenuURL]         [nvarchar](500) COLLATE Chinese_PRC_CI_AS NULL,
	[MenuDisabled]    [bit] NOT NULL CONSTRAINT [DF_tb_Menu_MenuDisabled]  DEFAULT ((1)),
	[MenuOrder]       [int] NOT NULL CONSTRAINT [DF_tb_Menu_MenuOrder]  DEFAULT ((0)),
	[MenuDescription] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
	[IsMenu]          [bit] NOT NULL CONSTRAINT [DF_tb_Menu_IsMenu]  DEFAULT ((1)),
 CONSTRAINT [PK_tb_Menu] PRIMARY KEY CLUSTERED 
(
	[MenuID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Menu', @level2type=N'COLUMN', @level2name=N'MenuID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Menu', @level2type=N'COLUMN', @level2name=N'MenuTypeID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Menu', @level2type=N'COLUMN', @level2name=N'MenuName'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Menu', @level2type=N'COLUMN', @level2name=N'MenuTag'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Menu', @level2type=N'COLUMN', @level2name=N'MenuURL'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Menu', @level2type=N'COLUMN', @level2name=N'MenuDisabled'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Menu', @level2type=N'COLUMN', @level2name=N'MenuOrder'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Menu', @level2type=N'COLUMN', @level2name=N'MenuDescription'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'          ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_Menu', @level2type=N'COLUMN', @level2name=N'IsMenu'

tb_MenuAction:メニュー権限情報テーブル
列名
データ型
空の許可
説明
ID
int
N
メニュー権限ID
MenuID
int
N
メニューID
ActionTag
nvarchar(50)
N
権限ID
/*20120611 BY FMX      */
USE [SH_Cloud]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tb_MenuAction](
	[ID]        [int] IDENTITY(1,1) NOT NULL,
	[MenuID]    [int] NOT NULL,
	[ActionTag] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
 CONSTRAINT [PK_tb_MenuAction] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_MenuAction', @level2type=N'COLUMN', @level2name=N'ID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_MenuAction', @level2type=N'COLUMN', @level2name=N'MenuID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_MenuAction', @level2type=N'COLUMN', @level2name=N'ActionTag'

tb_RoleAction:ロール権限情報テーブル
列名
データ型
空の許可
説明
ID
int
N
番号付け
UserID
int
N
ユーザID
RoleID
int
N
ロールID
GroupID
int
N
パケットID
MenuID
int
N
メニューID
ActionTag
nvarchar(50)
N
権限ID
Flag
bit
N
1は許可、0は禁止しない
/*20120611 BY FMX       */
USE [SH_Cloud]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tb_RoleAction](
	[ID]         [int] IDENTITY(1,1) NOT NULL,
	[UserID]     [int] NOT NULL CONSTRAINT [DF_tb_RoleAction_UserID]  DEFAULT ((0)),
	[RoleID]     [int] NOT NULL CONSTRAINT [DF_tb_RoleAction_RoleID]  DEFAULT ((0)),
	[GroupID]    [int] NOT NULL CONSTRAINT [DF_tb_RoleAction_GroupID]  DEFAULT ((0)),
	[MenuID]     [int] NOT NULL,
	[ActionTag]  [nvarchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
	[Flag]       [bit] NOT NULL CONSTRAINT [DF_tb_RoleAction_Flag]  DEFAULT ((1)),
 CONSTRAINT [PK_tb_RoleAction] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_RoleAction', @level2type=N'COLUMN', @level2name=N'ID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_RoleAction', @level2type=N'COLUMN', @level2name=N'UserID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_RoleAction', @level2type=N'COLUMN', @level2name=N'RoleID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_RoleAction', @level2type=N'COLUMN', @level2name=N'GroupID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'  ID' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_RoleAction', @level2type=N'COLUMN', @level2name=N'MenuID'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_RoleAction', @level2type=N'COLUMN', @level2name=N'ActionTag'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1   ,0    ' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'tb_RoleAction', @level2type=N'COLUMN', @level2name=N'Flag'