function user_install() db_sqlapi_install('user') db_query("INSERT INTO {users} (uid,name,mail) VALUES(0,'','');") db_query("INSERT INTO {role} (name) VALUES ('anonymous user');") db_query("INSERT INTO {role} (name) VALUES ('authenticated user');") db_query("INSERT INTO {permission} (rid,perm,tid) VALUES (1,'access content',0);") db_query([[INSERT INTO {permission} (rid,perm,tid) VALUES (2,'access comments, access content, post comments, post comments without approval',0);]]) end function user_schema() return { ['access'] = { ['fields'] = { ['aid'] = {['type'] = 'serial', ['not null'] = true}, ['mask'] = {['type'] = 'varchar', ['length'] = 255, ['not null'] = true, ['default'] = ''}, ['type'] = {['type'] = 'varchar', ['length'] = 255, ['not null'] = true, ['default'] = ''}, ['status'] = {['type'] = 'int', ['not null'] = true, ['default'] = 0, ['size'] = 'tiny'}}, ['primary key'] = {'aid'}}, ['authmap'] = { ['fields'] = { ['aid'] = {['type'] = 'serial', ['unsigned'] = true, ['not null'] = true}, ['uid'] = {['type'] = 'int', ['not null'] = true, ['default'] = 0}, ['authname'] = {['type'] = 'varchar', ['length'] = 128, ['not null'] = true, ['default'] = ''}, ['module'] = {['type'] = 'varchar', ['length'] = 128, ['not null'] = true, ['default'] = ''}}, ['unique keys'] = { ['authname'] = {'authname'}}, ['primary key'] = {'aid'}}, ['permission'] = { ['fields'] = { ['pid'] = {['type'] = 'serial', ['not null'] = true}, ['rid'] = {['type'] = 'int', ['unsigned'] = true, ['not null'] = true, ['default'] = 0}, ['perm'] = {['type'] = 'text', ['not null'] = '', ['size'] = 'medium'}, ['tid'] = {['type'] = 'int', ['unsigned'] = true, ['not null'] = true, ['default'] = 0}}, ['primary key'] = {'pid'}, ['indexes'] = { ['rid'] = {'rid'}}}, ['role'] = { ['fields'] = { ['rid'] = {['type'] = 'serial', ['unsigned'] = true, ['not null'] = true}, ['name'] = {['type'] = 'varchar', ['length'] = 64, ['not null'] = true, ['default'] = ''}}, ['unique keys'] = { ['name'] = {'name'}}, ['primary key'] = {'rid'}}, ['users'] = { ['fields'] = { ['uid'] = {['type'] = 'serial', ['unsigned'] = true, ['not null'] = true}, ['name'] = {['type'] = 'varchar', ['length'] = 60, ['not null'] = true, ['default'] = ''}, ['pass'] = {['type'] = 'varchar', ['length'] = 32, ['not null'] = true, ['default'] = ''}, ['mail'] = {['type'] = 'varchar', ['length'] = 64, ['not null'] = '', ['default'] = ''}, ['mode'] = {['type'] = 'int', ['not null'] = true, ['default'] = 0, ['size'] = 'tiny'}, ['sort'] = {['type'] = 'int', ['not null'] = '', ['default'] = 0, ['size'] = 'tiny'}, ['threshold'] = {['type'] = 'int', ['not null'] = '', ['default'] = 0, ['size'] = 'tiny'}, ['theme'] = {['type'] = 'varchar', ['length'] = 255, ['not null'] = true, ['default'] = ''}, ['signature'] = {['type'] = 'varchar', ['length'] = 255, ['not null'] = true, ['default'] = ''}, ['created'] = {['type'] = 'int', ['not null'] = true, ['default'] = 0}, ['access'] = {['type'] = 'int', ['not null'] = true, ['default'] = 0}, ['login'] = {['type'] = 'int', ['not null'] = true, ['default'] = 0}, ['status'] = {['type'] = 'int', ['not null'] = true, ['default'] = 0, ['size'] = 'tiny'}, ['timezone'] = {['type'] = 'varchar', ['length'] = 8, ['not null'] = ''}, ['language'] = {['type'] = 'varchar', ['length'] = 12, ['not null'] = true, ['default'] = ''}, ['picture'] = {['type'] = 'varchar', ['length'] = 255, ['not null'] = true, ['default'] = ''}, ['init'] = {['type'] = 'varchar', ['length'] = 64, ['not null'] = '', ['default'] = ''}, ['data'] = {['type'] = 'text', ['not null'] = '', ['size'] = 'medium'}}, ['indexes'] = { ['access'] = {'access'}, ['created'] = {'created'}}, ['unique keys'] = { ['name'] = {'name'}}, ['primary key'] = {'uid'}}, ['users_roles'] = { ['fields'] = { ['uid'] = {['type'] = 'int', ['unsigned'] = true, ['not null'] = true, ['default'] = 0}, ['rid'] = {['type'] = 'int', ['unsigned'] = true, ['not null'] = true, ['default'] = 0}}, ['primary key'] = {'uid', 'rid'}}} end