configs/sql-init-scripts/sqlite/create_admins.sql
author Scott Ehlert <ds@alliedmods.net>
Sun Mar 30 07:00:22 2008 +0000 (2008-03-30)
changeset 1952 b7aa2b626807
permissions -rw-r--r--
Spring Cleaning, Part Ichi (1)
Various minor things done to project files
Updated sample extension project file and updated makefile to the new unified version (more changes likely on the way)
Updated regex project file and makefile
ds@1952
     1
ds@1952
     2
CREATE TABLE sm_admins (
ds@1952
     3
  id INTEGER PRIMARY KEY AUTOINCREMENT,
ds@1952
     4
  authtype varchar(16) NOT NULL CHECK(authtype IN ('steam', 'ip', 'name')),
ds@1952
     5
  identity varchar(65) NOT NULL,
ds@1952
     6
  password varchar(65),
ds@1952
     7
  flags varchar(30) NOT NULL,
ds@1952
     8
  name varchar(65) NOT NULL,
ds@1952
     9
  immunity INTEGER NOT NULL
ds@1952
    10
);
ds@1952
    11
ds@1952
    12
CREATE TABLE sm_groups (
ds@1952
    13
  id INTEGER PRIMARY KEY AUTOINCREMENT,
ds@1952
    14
  flags varchar(30) NOT NULL,
ds@1952
    15
  name varchar(120) NOT NULL,
ds@1952
    16
  immunity_level INTEGER NOT NULL
ds@1952
    17
);
ds@1952
    18
ds@1952
    19
CREATE TABLE sm_group_immunity (
ds@1952
    20
  group_id INTEGER NOT NULL,
ds@1952
    21
  other_id INTEGER NOT NULL,
ds@1952
    22
  PRIMARY KEY (group_id, other_id)
ds@1952
    23
);
ds@1952
    24
ds@1952
    25
CREATE TABLE sm_group_overrides (
ds@1952
    26
  group_id INTEGER NOT NULL,
ds@1952
    27
  type varchar(16) NOT NULL CHECK (type IN ('command', 'group')),
ds@1952
    28
  name varchar(32) NOT NULL,
ds@1952
    29
  access varchar(16) NOT NULL CHECK (access IN ('allow', 'deny')),
ds@1952
    30
  PRIMARY KEY (group_id, type, name)
ds@1952
    31
);
ds@1952
    32
ds@1952
    33
CREATE TABLE sm_overrides (
ds@1952
    34
  type varchar(16) NOT NULL CHECK (type IN ('command', 'group')),
ds@1952
    35
  name varchar(32) NOT NULL,
ds@1952
    36
  flags varchar(30) NOT NULL,
ds@1952
    37
  PRIMARY KEY (type,name)
ds@1952
    38
);
ds@1952
    39
ds@1952
    40
CREATE TABLE sm_admins_groups (
ds@1952
    41
  admin_id INTEGER NOT NULL,
ds@1952
    42
  group_id INTEGER NOT NULL,
ds@1952
    43
  inherit_order int(10) NOT NULL,
ds@1952
    44
  PRIMARY KEY (admin_id, group_id)
ds@1952
    45
);
ds@1952
    46
ds@1952
    47
CREATE TABLE IF NOT EXISTS sm_config (
ds@1952
    48
  cfg_key varchar(32) NOT NULL,
ds@1952
    49
  cfg_value varchar(255) NOT NULL,
ds@1952
    50
  PRIMARY KEY (cfg_key)
ds@1952
    51
);
ds@1952
    52
ds@1952
    53
REPLACE INTO sm_config (cfg_key, cfg_value) VALUES ('admin_version', '1.0.0.1409');
ds@1952
    54