Skip to content

Commit

Permalink
upgrade notice for auth tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
qiang.xue committed Jun 14, 2011
1 parent 97654e2 commit e0a99f4
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 1 deletion.
8 changes: 7 additions & 1 deletion UPGRADE
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ General upgrade intructions

Upgrading from v1.1.7
---------------------
Default behavior for handling before* events via overriding methods of parent class are changed.
- Default behavior for handling before* events via overriding methods of parent class are changed.
Now in order to cancel the execution of the next method, a boolean false value must be returned.
This means, if null or any other non-boolean-false value is returned, the next
will continue to be executed. This change will affect you if you have code like the following:
Expand All @@ -40,6 +40,12 @@ public function beforeControllerAction($controller, $action)

In the above code, the "return 0" statement should be changed to be "return false".

- CDbAuthManager will now quote columns and tables referenced in its SQL code.
If your auth tables were created in a case-insensitive fashion (e.g. on PostgreSQL)
while your DBMS is case-sensitive, this change may cause DB query errors.
To fix this issue, you will have to rename the table names and columns, or re-create
the auth tables by following the SQL code given in framework/web/auth/*.sql.


Upgrading from v1.1.6
---------------------
Expand Down
File renamed without changes.
42 changes: 42 additions & 0 deletions framework/web/auth/schema-mysql.sql
Original file line number Diff line number Diff line change
@@ -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)
);

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
);

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
);
42 changes: 42 additions & 0 deletions framework/web/auth/schema-oci.sql
Original file line number Diff line number Diff line change
@@ -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)
);

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
);

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
);
42 changes: 42 additions & 0 deletions framework/web/auth/schema-pgsql.sql
Original file line number Diff line number Diff line change
@@ -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)
);

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
);

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
);
42 changes: 42 additions & 0 deletions framework/web/auth/schema-sqlite.sql
Original file line number Diff line number Diff line change
@@ -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)
);

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
);

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
);

0 comments on commit e0a99f4

Please sign in to comment.