# --------------------------------------------------------
#
# Simple version 0.4.0
#

# --------------------------------------------------------
#
# Table structure for table 'dmuser';
#

CREATE TABLE dmuser
(
  id SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT,
  username VARCHAR(25) NOT NULL,
  password VARCHAR(50) NOT NULL,
  fullname VARCHAR(80) NOT NULL,
  PRIMARY KEY (id)
);

#
# id - User ID;
# username - User name;
# password - Password;
# fullname - Full name;
#

#
# Dumping default data for table 'dmuser';
#

INSERT INTO dmuser (username,password,fullname) VALUES ('admin',PASSWORD('admin'),'Administrator');

# --------------------------------------------------------
#
# Table structure for table 'dmcat';
#

CREATE TABLE dmcat
(
  id SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT,     
  parent INT(4) UNSIGNED DEFAULT '0' NOT NULL,
  catcode VARCHAR(25) NOT NULL,
  catname VARCHAR(255) NOT NULL,
  PRIMARY KEY (id)
);

#
# id - Category ID;
# catcode - Category code;
# catname - Category name;
#

#
# Dumping default data for table 'dmcat';
#

INSERT INTO dmcat (catcode,catname) VALUES ('','Default category');

# --------------------------------------------------------
#
# Table structure for table 'dmgroup';
#

CREATE TABLE dmgroup
(
  id SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT,
  parent INT(4) UNSIGNED DEFAULT '0' NOT NULL,
  grocode VARCHAR(25) NOT NULL,
  groname VARCHAR(255) NOT NULL,
  imgname VARCHAR(255) DEFAULT '' NOT NULL,
  PRIMARY KEY (id)
);

#
# id - Group ID;
# grocode - Group code;
# groname - Group name;
#

#
# Dumping default data for table 'dmgroup'
#

INSERT INTO dmgroup (grocode,groname) VALUES ('','Default group');

# --------------------------------------------------------
#
# Table structure for table 'dmuperms';
#

CREATE TABLE dmuperms
(
  fid INT(4) UNSIGNED DEFAULT '0' NOT NULL,
  uid SMALLINT(4) UNSIGNED DEFAULT '0' NOT NULL,
  rights TINYINT(4) UNSIGNED DEFAULT '0' NOT NULL
);

#
# fid - Document ID, from "dmdoc" table; '0' = user privilege (e.g. admin);
# uid - User ID, from "dmuser" table; '0' = group permission;
# rights - rights user "uid" possesses for document "fid"; '0' = disabled, '1' = view, '2' = modify, '3' = admin;
#

#
# Dumping default data for table 'dmuperms'
# Administration privilege for 'admin' users
#

INSERT INTO dmuperms (fid,uid,rights) VALUES ('0','1','3');

# --------------------------------------------------------
#
# Table structure for table 'dmgperms';
#

CREATE TABLE dmgperms
(
  uid SMALLINT(4) UNSIGNED DEFAULT '0' NOT NULL,
  gid SMALLINT(4) UNSIGNED DEFAULT '0' NOT NULL
);

#
# uid - User ID, from "dmuser" table;
# gid - Group ID, from "dmgroup" table;
#

#
# Dumping default data for table 'dmgperms'
#

INSERT INTO dmgperms (uid,gid) VALUES ('1','1');

