yii2 rbac sqlserver版本
GO /****** Object: Table [dbo].[auth_assignment] Script Date: 2020/5/9 15:21:44 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[auth_assignment]( [item_name] [nvarchar](64) NOT NULL, [user_id] [nvarchar](64) NOT NULL, [created_at] [int] NULL, PRIMARY KEY CLUSTERED ( [item_name] ASC, [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].[auth_item] Script Date: 2020/5/9 15:21:44 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[auth_item]( [name] [nvarchar](64) NOT NULL, [type] [smallint] NOT NULL, [description] [nvarchar](max) NULL, [rule_name] [nvarchar](64) NULL, [data] [varbinary](max) NULL, [created_at] [int] NULL, [updated_at] [int] NULL, PRIMARY KEY CLUSTERED ( [name] 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 SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[auth_item_child] Script Date: 2020/5/9 15:21:44 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[auth_item_child]( [parent] [nvarchar](64) NOT NULL, [child] [nvarchar](64) NOT NULL, PRIMARY KEY CLUSTERED ( [parent] ASC, [child] 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].[auth_rule] Script Date: 2020/5/9 15:21:44 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[auth_rule]( [name] [nvarchar](64) NOT NULL, [data] [varbinary](max) NULL, [created_at] [int] NULL, [updated_at] [int] NULL, PRIMARY KEY CLUSTERED ( [name] 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 SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[menu] Script Date: 2020/5/9 15:21:44 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[menu]( [id] [int] NOT NULL, [name] [nvarchar](128) NOT NULL, [parent] [int] NULL, [route] [nvarchar](255) NULL, [order] [int] NULL, [data] [varbinary](max) NULL, 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 SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[auth_assignment] WITH CHECK ADD CONSTRAINT [auth_assignment_ibfk_1] FOREIGN KEY([item_name]) REFERENCES [dbo].[auth_item] ([name]) GO ALTER TABLE [dbo].[auth_assignment] CHECK CONSTRAINT [auth_assignment_ibfk_1] GO ALTER TABLE [dbo].[auth_item] WITH CHECK ADD CONSTRAINT [auth_item_ibfk_1] FOREIGN KEY([rule_name]) REFERENCES [dbo].[auth_rule] ([name]) GO ALTER TABLE [dbo].[auth_item] CHECK CONSTRAINT [auth_item_ibfk_1] GO ALTER TABLE [dbo].[auth_item_child] WITH CHECK ADD CONSTRAINT [auth_item_child_ibfk_1] FOREIGN KEY([parent]) REFERENCES [dbo].[auth_item] ([name]) GO ALTER TABLE [dbo].[auth_item_child] CHECK CONSTRAINT [auth_item_child_ibfk_1] GO ALTER TABLE [dbo].[auth_item_child] WITH CHECK ADD CONSTRAINT [auth_item_child_ibfk_2] FOREIGN KEY([child]) REFERENCES [dbo].[auth_item] ([name]) GO ALTER TABLE [dbo].[auth_item_child] CHECK CONSTRAINT [auth_item_child_ibfk_2] GO ALTER TABLE [dbo].[menu] WITH CHECK ADD CONSTRAINT [menu_ibfk_1] FOREIGN KEY([parent]) REFERENCES [dbo].[menu] ([id]) GO ALTER TABLE [dbo].[menu] CHECK CONSTRAINT [menu_ibfk_1] GO
posted on 2020-05-09 16:46 Mr-Hawaii-Felix 阅读(124) 评论(0) 编辑 收藏 举报