Subversion Repositories computer_asset_manager_v2

Rev

Rev 18 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18 Rev 19
Line 11... Line 11...
11
create table _system (
11
create table _system (
12
  _system_id      int unsigned not null auto_increment,
12
  _system_id      int unsigned not null auto_increment,
13
  group_name      varchar(64) NOT NULL COMMENT 'used to group keys together',
13
  group_name      varchar(64) NOT NULL COMMENT 'used to group keys together',
14
  key_name        varchar(64) NOT NULL COMMENT 'key into this value',
14
  key_name        varchar(64) NOT NULL COMMENT 'key into this value',
15
  theValue        text null COMMENT 'the actual value of this entry',
15
  theValue        text null COMMENT 'the actual value of this entry',
16
  added_date      date not null COMMENT 'date record was added',
-
 
17
  removed_date    date default NULL COMMENT 'date record was closed',
-
 
18
  PRIMARY KEY     (_system_id )
16
  PRIMARY KEY     (_system_id )
19
)  COMMENT='Basically a configuration file equivilent to a windows INI ';
17
)  COMMENT='Basically a configuration file equivilent to a windows INI ';
20
 
18
 
21
/* used by the auth class */
19
/* used by the auth class */
22
drop table if exists _user;
20
drop table if exists _user;
23
create table _user (
21
create table _user (
24
   _user_id     int unsigned not null auto_increment,
22
   _user_id     int unsigned not null auto_increment,
25
   username     varchar(32) comment 'user name for logging in',
23
   username     varchar(32) not null comment 'user name for logging in',
26
   name         varchar(64) comment 'common name of user',
24
   name         varchar(64) comment 'common name of user',
27
   email        varchar(64) comment 'email address of user',
25
   email        varchar(64) comment 'email address of user',
28
   notes        text comment 'any notes about user',
26
   notes        text comment 'any notes about user',
29
   pass         varchar(256) comment 'encrypted password of user',
27
   pass         varchar(256) comment 'encrypted password of user',
30
   access       text comment 'sql to determine what records user can view',
28
   access       text comment 'sql to determine what records user can view',
Line 35... Line 33...
35
 
33
 
36
/* used by the menu class */
34
/* used by the menu class */
37
drop table if exists _menu;
35
drop table if exists _menu;
38
create table _menu (
36
create table _menu (
39
   _menu_id        int unsigned not null auto_increment,
37
   _menu_id        int unsigned not null auto_increment,
40
   parent_id      int unsigned null  comment 'If this is a submenu the id of the parent' REFERENCES _menu(_menu_id),
38
   parent_id      int unsigned default null  comment 'If this is a submenu the id of the parent' REFERENCES _menu(_menu_id),
41
   caption        varchar(20) not null comment 'The actual caption displayed',
39
   caption        varchar(20) not null comment 'The actual caption displayed',
42
   url            varchar(120) null comment 'the url of the page/script to call or null if this contains sub-options',
40
   url            varchar(120) default null comment 'the url of the page/script to call or null if this contains sub-options',
43
   primary key    (_menu_id)
41
   primary key    (_menu_id)
44
) comment 'We keep the entire menu structure here so modules can modify it';
42
) comment 'We keep the entire menu structure here so modules can modify it';
45
 
43
 
46
 
44
 
47
/* beginning of the actual tables used by the app, client, site and device */
45
/* beginning of the actual tables used by the app, client, site and device */
Line 79... Line 77...
79
   other device.
77
   other device.
80
*/
78
*/
81
drop table if exists device;
79
drop table if exists device;
82
create table device (
80
create table device (
83
   device_id    int unsigned not null auto_increment,
81
   device_id    int unsigned not null auto_increment,
84
   name        varchar(64) comment 'name of the device or device',
82
   name        varchar(64) not null comment 'name of the device or device',
85
   notes       text comment 'any notes we want to store',
83
   notes       text default null comment 'any notes we want to store',
86
   device_type_id int unsigned not null references device_type( device_type_id ),
84
   device_type_id int unsigned not null references device_type( device_type_id ),
87
   added_date  date not null comment 'Date record added to database',
85
   added_date  date not null comment 'Date record added to database',
88
   removed_date date default null comment 'Date record marked as removed',
86
   removed_date date default null comment 'Date record marked as removed',
89
   primary key (device_id)
87
   primary key (device_id)
90
) comment 'stores information about an individual device or other device';
88
) comment 'stores information about an individual device or other device';