CREATE TABLE proftpd_groups (
  group_id INTEGER UNSIGNED NOT NULL,
  group_name VARCHAR(64) NOT NULL,
  group_member VARCHAR(256) NOT NULL,
  group_enabled ENUM("true", "false") NOT NULL DEFAULT "true",
  PRIMARY KEY(group_id)
)
ENGINE=InnoDB;
 
CREATE TABLE proftpd_users (
  user_name VARCHAR(32) NOT NULL,
  group_id INTEGER UNSIGNED NOT NULL,
  user_password VARCHAR(32) NOT NULL,
  user_homedir VARCHAR(256) NOT NULL,
  user_id INTEGER UNSIGNED NOT NULL,
  user_shell VARCHAR(256) NOT NULL DEFAULT "/bin/false",
  user_enabled ENUM("true", "false") NOT NULL DEFAULT "true",
  user_login_count INTEGER UNSIGNED NOT NULL,
  user_last_login DATETIME NOT NULL,
  PRIMARY KEY(user_name),
  INDEX proftpd_users_FKIndex1(group_id),
  FOREIGN KEY(group_id)
    REFERENCES proftpd_groups(group_id)
      ON DELETE RESTRICT
      ON UPDATE RESTRICT
)
ENGINE=InnoDB;
 
CREATE TABLE proftpd_quota_tallies (
  user_name VARCHAR(32) NOT NULL,
  qt_quota_type ENUM("user", "group", "class", "all") NOT NULL,
  qt_bytes_in_used FLOAT NOT NULL,
  qt_bytes_out_used FLOAT NOT NULL,
  qt_bytes_xfer_used FLOAT NOT NULL,
  qt_files_in_used FLOAT NOT NULL,
  qt_files_out_used FLOAT NOT NULL,
  qt_files_xfer_used FLOAT NOT NULL,
  PRIMARY KEY(user_name),
  INDEX proftpd_quota_tallies_FKIndex1(user_name),
  FOREIGN KEY(user_name)
    REFERENCES proftpd_users(user_name)
      ON DELETE RESTRICT
      ON UPDATE RESTRICT
)
ENGINE=InnoDB;
 
CREATE TABLE proftpd_quota_limits (
  user_name VARCHAR(32) NOT NULL,
  ql_quota_type ENUM("user", "group", "class", "all") NOT NULL,
  ql_per_session ENUM("false", "true") NOT NULL,
  ql_limit_type ENUM("soft", "hard") NOT NULL,
  ql_bytes_in_avail FLOAT NOT NULL,
  ql_bytes_out_avail FLOAT NOT NULL,
  ql_bytes_xfer_avail FLOAT NOT NULL,
  ql_files_in_avail FLOAT NOT NULL,
  ql_files_out_avail FLOAT NOT NULL,
  ql_files_xfer_avail FLOAT NOT NULL,
  PRIMARY KEY(user_name),
  INDEX proftpd_quota_limits_FKIndex1(user_name),
  FOREIGN KEY(user_name)
    REFERENCES proftpd_users(user_name)
      ON DELETE RESTRICT
      ON UPDATE RESTRICT
)
ENGINE=InnoDB;
