From f554d3ec2ebfa847dc2be5fe59d9116ea44cc9f4 Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Fri, 10 May 2013 21:41:07 +0400 Subject: [PATCH] RBAC sql files --- yii/rbac/schema-mssql.sql | 43 +++++++++++++++++++++++++++++++++++++++++++ yii/rbac/schema-mysql.sql | 43 +++++++++++++++++++++++++++++++++++++++++++ yii/rbac/schema-oci.sql | 43 +++++++++++++++++++++++++++++++++++++++++++ yii/rbac/schema-pgsql.sql | 43 +++++++++++++++++++++++++++++++++++++++++++ yii/rbac/schema-sqlite.sql | 43 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 215 insertions(+) create mode 100644 yii/rbac/schema-mssql.sql create mode 100644 yii/rbac/schema-mysql.sql create mode 100644 yii/rbac/schema-oci.sql create mode 100644 yii/rbac/schema-pgsql.sql create mode 100644 yii/rbac/schema-sqlite.sql diff --git a/yii/rbac/schema-mssql.sql b/yii/rbac/schema-mssql.sql new file mode 100644 index 0000000..f02b261 --- /dev/null +++ b/yii/rbac/schema-mssql.sql @@ -0,0 +1,43 @@ +/** + * Database schema required by \yii\rbac\DbManager. + * + * @author Qiang Xue + * @author Alexander Kochetov + * @link http://www.yiiframework.com/ + * @copyright 2008 Yii Software LLC + * @license http://www.yiiframework.com/license/ + * @since 2.0 + */ + +drop table if exists [tbl_auth_assignment]; +drop table if exists [tbl_auth_item_child]; +drop table if exists [tbl_auth_item]; + +create table [tbl_auth_item] +( + [name] varchar(64) not null, + [type] integer not null, + [description] text, + [bizrule] text, + [data] text, + primary key ([name]) +); + +create table [tbl_auth_item_child] +( + [parent] varchar(64) not null, + [child] varchar(64) not null, + primary key ([parent],[child]), + foreign key ([parent]) references [tbl_auth_item] ([name]) on delete cascade on update cascade, + foreign key ([child]) references [tbl_auth_item] ([name]) on delete cascade on update cascade +); + +create table [tbl_auth_assignment] +( + [item_name] varchar(64) not null, + [user_id] varchar(64) not null, + [bizrule] text, + [data] text, + primary key ([item_name],[user_id]), + foreign key ([item_name]) references [tbl_auth_item] ([name]) on delete cascade on update cascade +); diff --git a/yii/rbac/schema-mysql.sql b/yii/rbac/schema-mysql.sql new file mode 100644 index 0000000..687a436 --- /dev/null +++ b/yii/rbac/schema-mysql.sql @@ -0,0 +1,43 @@ +/** + * Database schema required by \yii\rbac\DbManager. + * + * @author Qiang Xue + * @author Alexander Kochetov + * @link http://www.yiiframework.com/ + * @copyright 2008 Yii Software LLC + * @license http://www.yiiframework.com/license/ + * @since 2.0 + */ + +drop table if exists `tbl_auth_assignment`; +drop table if exists `tbl_auth_item_child`; +drop table if exists `tbl_auth_item`; + +create table `tbl_auth_item` +( + `name` varchar(64) not null, + `type` integer not null, + `description` text, + `bizrule` text, + `data` text, + primary key (`name`) +) engine InnoDB; + +create table `tbl_auth_item_child` +( + `parent` varchar(64) not null, + `child` varchar(64) not null, + primary key (`parent`,`child`), + foreign key (`parent`) references `tbl_auth_item` (`name`) on delete cascade on update cascade, + foreign key (`child`) references `tbl_auth_item` (`name`) on delete cascade on update cascade +) engine InnoDB; + +create table `tbl_auth_assignment` +( + `item_name` varchar(64) not null, + `user_id` varchar(64) not null, + `bizrule` text, + `data` text, + primary key (`item_name`,`user_id`), + foreign key (`item_name`) references `tbl_auth_item` (`name`) on delete cascade on update cascade +) engine InnoDB; diff --git a/yii/rbac/schema-oci.sql b/yii/rbac/schema-oci.sql new file mode 100644 index 0000000..623fba2 --- /dev/null +++ b/yii/rbac/schema-oci.sql @@ -0,0 +1,43 @@ +/** + * Database schema required by \yii\rbac\DbManager. + * + * @author Qiang Xue + * @author Alexander Kochetov + * @link http://www.yiiframework.com/ + * @copyright 2008 Yii Software LLC + * @license http://www.yiiframework.com/license/ + * @since 2.0 + */ + +drop table if exists "tbl_auth_assignment"; +drop table if exists "tbl_auth_item_child"; +drop table if exists "tbl_auth_item"; + +create table "tbl_auth_item" +( + "name" varchar(64) not null, + "type" integer not null, + "description" text, + "bizrule" text, + "data" text, + primary key ("name") +); + +create table "tbl_auth_item_child" +( + "parent" varchar(64) not null, + "child" varchar(64) not null, + primary key ("parent","child"), + foreign key ("parent") references "tbl_auth_item" ("name") on delete cascade on update cascade, + foreign key ("child") references "tbl_auth_item" ("name") on delete cascade on update cascade +); + +create table "tbl_auth_assignment" +( + "item_name" varchar(64) not null, + "user_id" varchar(64) not null, + "bizrule" text, + "data" text, + primary key ("item_name","user_id"), + foreign key ("item_name") references "tbl_auth_item" ("name") on delete cascade on update cascade +); diff --git a/yii/rbac/schema-pgsql.sql b/yii/rbac/schema-pgsql.sql new file mode 100644 index 0000000..623fba2 --- /dev/null +++ b/yii/rbac/schema-pgsql.sql @@ -0,0 +1,43 @@ +/** + * Database schema required by \yii\rbac\DbManager. + * + * @author Qiang Xue + * @author Alexander Kochetov + * @link http://www.yiiframework.com/ + * @copyright 2008 Yii Software LLC + * @license http://www.yiiframework.com/license/ + * @since 2.0 + */ + +drop table if exists "tbl_auth_assignment"; +drop table if exists "tbl_auth_item_child"; +drop table if exists "tbl_auth_item"; + +create table "tbl_auth_item" +( + "name" varchar(64) not null, + "type" integer not null, + "description" text, + "bizrule" text, + "data" text, + primary key ("name") +); + +create table "tbl_auth_item_child" +( + "parent" varchar(64) not null, + "child" varchar(64) not null, + primary key ("parent","child"), + foreign key ("parent") references "tbl_auth_item" ("name") on delete cascade on update cascade, + foreign key ("child") references "tbl_auth_item" ("name") on delete cascade on update cascade +); + +create table "tbl_auth_assignment" +( + "item_name" varchar(64) not null, + "user_id" varchar(64) not null, + "bizrule" text, + "data" text, + primary key ("item_name","user_id"), + foreign key ("item_name") references "tbl_auth_item" ("name") on delete cascade on update cascade +); diff --git a/yii/rbac/schema-sqlite.sql b/yii/rbac/schema-sqlite.sql new file mode 100644 index 0000000..32eb363 --- /dev/null +++ b/yii/rbac/schema-sqlite.sql @@ -0,0 +1,43 @@ +/** + * Database schema required by \yii\rbac\DbManager. + * + * @author Qiang Xue + * @author Alexander Kochetov + * @link http://www.yiiframework.com/ + * @copyright 2008 Yii Software LLC + * @license http://www.yiiframework.com/license/ + * @since 2.0 + */ + +drop table if exists 'tbl_auth_assignment'; +drop table if exists 'tbl_auth_item_child'; +drop table if exists 'tbl_auth_item'; + +create table 'tbl_auth_item' +( + "name" varchar(64) not null, + "type" integer not null, + "description" text, + "bizrule" text, + "data" text, + primary key ("name") +); + +create table 'tbl_auth_item_child' +( + "parent" varchar(64) not null, + "child" varchar(64) not null, + primary key ("parent","child"), + foreign key ("parent") references 'tbl_auth_item' ("name") on delete cascade on update cascade, + foreign key ("child") references 'tbl_auth_item' ("name") on delete cascade on update cascade +); + +create table 'tbl_auth_assignment' +( + "item_name" varchar(64) not null, + "user_id" varchar(64) not null, + "bizrule" text, + "data" text, + primary key ("item_name","user_id"), + foreign key ("item_name") references 'tbl_auth_item' ("name") on delete cascade on update cascade +);