summaryrefslogtreecommitdiff
path: root/framework/web/auth/schema-mysql.sql
diff options
context:
space:
mode:
Diffstat (limited to 'framework/web/auth/schema-mysql.sql')
-rw-r--r--framework/web/auth/schema-mysql.sql42
1 files changed, 42 insertions, 0 deletions
diff --git a/framework/web/auth/schema-mysql.sql b/framework/web/auth/schema-mysql.sql
new file mode 100644
index 0000000..8ed5556
--- /dev/null
+++ b/framework/web/auth/schema-mysql.sql
@@ -0,0 +1,42 @@
+/**
+ * Database schema required by CDbAuthManager.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @link http://www.yiiframework.com/
+ * @copyright Copyright &copy; 2008 Yii Software LLC
+ * @license http://www.yiiframework.com/license/
+ * @since 1.0
+ */
+
+drop table if exists `AuthAssignment`;
+drop table if exists `AuthItemChild`;
+drop table if exists `AuthItem`;
+
+create table `AuthItem`
+(
+ `name` varchar(64) not null,
+ `type` integer not null,
+ `description` text,
+ `bizrule` text,
+ `data` text,
+ primary key (`name`)
+) engine InnoDB;
+
+create table `AuthItemChild`
+(
+ `parent` varchar(64) not null,
+ `child` varchar(64) not null,
+ primary key (`parent`,`child`),
+ foreign key (`parent`) references `AuthItem` (`name`) on delete cascade on update cascade,
+ foreign key (`child`) references `AuthItem` (`name`) on delete cascade on update cascade
+) engine InnoDB;
+
+create table `AuthAssignment`
+(
+ `itemname` varchar(64) not null,
+ `userid` varchar(64) not null,
+ `bizrule` text,
+ `data` text,
+ primary key (`itemname`,`userid`),
+ foreign key (`itemname`) references `AuthItem` (`name`) on delete cascade on update cascade
+) engine InnoDB;