schema-oci.sql 1.34 KB
Newer Older
Alexander Kochetov committed
1 2 3 4 5 6 7 8 9 10 11
/**
 * Database schema required by \yii\rbac\DbManager.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @author Alexander Kochetov <creocoder@gmail.com>
 * @link http://www.yiiframework.com/
 * @copyright 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 * @since 2.0
 */

12 13 14
drop table if exists "auth_assignment";
drop table if exists "auth_item_child";
drop table if exists "auth_item";
Alexander Kochetov committed
15

16
create table "auth_item"
Alexander Kochetov committed
17 18 19 20
(
   "name"                 varchar(64) not null,
   "type"                 integer not null,
   "description"          text,
Qiang Xue committed
21
   "biz_rule"              text,
Alexander Kochetov committed
22
   "data"                 text,
Qiang Xue committed
23 24
   primary key ("name"),
   key "type" ("type")
Alexander Kochetov committed
25 26
);

27
create table "auth_item_child"
Alexander Kochetov committed
28 29 30 31
(
   "parent"               varchar(64) not null,
   "child"                varchar(64) not null,
   primary key ("parent","child"),
32 33
   foreign key ("parent") references "auth_item" ("name") on delete cascade on update cascade,
   foreign key ("child") references "auth_item" ("name") on delete cascade on update cascade
Alexander Kochetov committed
34 35
);

36
create table "auth_assignment"
Alexander Kochetov committed
37
(
38 39
   "item_name"            varchar(64) not null,
   "user_id"              varchar(64) not null,
Qiang Xue committed
40
   "biz_rule"              text,
Alexander Kochetov committed
41 42
   "data"                 text,
   primary key ("item_name","user_id"),
43
   foreign key ("item_name") references "auth_item" ("name") on delete cascade on update cascade
Alexander Kochetov committed
44
);