summaryrefslogtreecommitdiff
path: root/modules/user/user.schema
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user/user.schema')
-rw-r--r--modules/user/user.schema85
1 files changed, 85 insertions, 0 deletions
diff --git a/modules/user/user.schema b/modules/user/user.schema
new file mode 100644
index 000000000..032778f10
--- /dev/null
+++ b/modules/user/user.schema
@@ -0,0 +1,85 @@
+<?php
+// $Id$
+
+function user_schema() {
+ $schema['access'] = array(
+ 'fields' => array(
+ 'aid' => array('type' => 'serial', 'not null' => TRUE),
+ 'mask' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
+ 'type' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
+ 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny')
+ ),
+ 'primary key' => array('aid'),
+ );
+
+ $schema['authmap'] = array(
+ 'fields' => array(
+ 'aid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
+ 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'authname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''),
+ 'module' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '')
+ ),
+ 'unique keys' => array('authname' => array('authname')),
+ 'primary key' => array('aid'),
+ );
+
+ $schema['permission'] = array(
+ 'fields' => array(
+ 'pid' => array('type' => 'serial', 'not null' => TRUE),
+ 'rid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+ 'perm' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big'),
+ 'tid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
+ ),
+ 'primary key' => array('pid'),
+ 'indexes' => array('rid' => array('rid')),
+ );
+
+ $schema['role'] = array(
+ 'fields' => array(
+ 'rid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
+ 'name' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => '')
+ ),
+ 'unique keys' => array('name' => array('name')),
+ 'primary key' => array('rid'),
+ );
+
+ $schema['users'] = array(
+ 'fields' => array(
+ 'uid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
+ 'name' => array('type' => 'varchar', 'length' => 60, 'not null' => TRUE, 'default' => ''),
+ 'pass' => array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''),
+ 'mail' => array('type' => 'varchar', 'length' => 64, 'not null' => FALSE, 'default' => ''),
+ 'mode' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
+ 'sort' => array('type' => 'int', 'not null' => FALSE, 'default' => 0, 'size' => 'tiny'),
+ 'threshold' => array('type' => 'int', 'not null' => FALSE, 'default' => 0, 'size' => 'tiny'),
+ 'theme' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
+ 'signature' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
+ 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'access' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'login' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
+ 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
+ 'timezone' => array('type' => 'varchar', 'length' => 8, 'not null' => FALSE),
+ 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''),
+ 'picture' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
+ 'init' => array('type' => 'varchar', 'length' => 64, 'not null' => FALSE, 'default' => ''),
+ 'data' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big')
+ ),
+ 'indexes' => array(
+ 'access' => array('access'),
+ 'created' => array('created')
+ ),
+ 'unique keys' => array('name' => array('name')),
+ 'primary key' => array('uid'),
+ );
+
+ $schema['users_roles'] = array(
+ 'fields' => array(
+ 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+ 'rid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0)
+ ),
+ 'primary key' => array('uid', 'rid'),
+ );
+
+ return $schema;
+}
+