Backend with codeigniter and tank auth. CSS with metronic.
DROP TABLE IF EXISTS access
;
CREATE TABLE access
(
id
int(11) NOT NULL AUTO_INCREMENT,
name
varchar(40) NOT NULL,
key
varchar(40) NOT NULL,
controller
varchar(200) NOT NULL DEFAULT '',
date_created
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='控制应用是否可以访问一些接口';
DROP TABLE IF EXISTS access_keys
;
CREATE TABLE access_keys
(
id
int(11) NOT NULL AUTO_INCREMENT,
key
varchar(40) NOT NULL,
level
int(11) NOT NULL,
ignore_limits
varchar(45) NOT NULL DEFAULT '0',
is_private_key
varchar(45) NOT NULL DEFAULT '0',
ip_addresses
varchar(45) NOT NULL,
date_created
varchar(45) NOT NULL,
PRIMARY KEY (id
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='授权访问key';
DROP TABLE IF EXISTS access_limits
;
CREATE TABLE access_limits
(
id
int(11) NOT NULL AUTO_INCREMENT,
uri
varchar(255) NOT NULL,
count
int(11) NOT NULL,
hour_started
int(11) NOT NULL,
api_key
varchar(40) NOT NULL,
PRIMARY KEY (id
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='控制接口访问次数';
DROP TABLE IF EXISTS access_logs
;
CREATE TABLE access_logs
(
id
int(11) NOT NULL AUTO_INCREMENT,
uri
varchar(255) NOT NULL,
method
varchar(6) NOT NULL,
params
text,
api_key
varchar(40) NOT NULL,
ip_address
varchar(45) NOT NULL,
time
varchar(45) NOT NULL,
rtime
float DEFAULT NULL,
authorized
tinyint(1) NOT NULL,
PRIMARY KEY (id
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='接口调用纪录';
DROP TABLE IF EXISTS api
;
CREATE TABLE api
(
id
int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
name
varchar(50) NOT NULL DEFAULT '' COMMENT 'API名称',
controller
varchar(50) NOT NULL DEFAULT '' COMMENT 'API控制器路径',
date_created
timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS ci_sessions
;
CREATE TABLE ci_sessions
(
session_id
varchar(40) COLLATE utf8_bin NOT NULL DEFAULT '0',
ip_address
varchar(16) COLLATE utf8_bin NOT NULL DEFAULT '0',
user_agent
varchar(150) COLLATE utf8_bin NOT NULL,
last_activity
int(10) unsigned NOT NULL DEFAULT '0',
user_data
text COLLATE utf8_bin NOT NULL,
PRIMARY KEY (session_id
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS face_recognition
;
CREATE TABLE face_recognition
(
id
int(11) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (id
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS file
;
CREATE TABLE file
(
id
int(11) NOT NULL AUTO_INCREMENT,
type
int(11) NOT NULL,
channel_id
int(11) NOT NULL DEFAULT '0',
version
int(11) NOT NULL DEFAULT '0',
file_name
varchar(200) NOT NULL,
raw_name
varchar(200) NOT NULL,
file_path
varchar(200) NOT NULL,
full_path
varchar(200) NOT NULL,
file_size
int(11) NOT NULL,
client_name
varchar(200) NOT NULL,
file_ext
varchar(45) NOT NULL,
is_image
tinyint(1) NOT NULL,
image_width
int(11) NOT NULL,
image_height
int(11) NOT NULL,
image_type
varchar(45) NOT NULL,
date_created
timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id
),
KEY channel_id
(channel_id
),
KEY version
(version
),
KEY type
(type
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS login_attempts
;
CREATE TABLE login_attempts
(
id
int(11) NOT NULL AUTO_INCREMENT,
ip_address
varchar(40) COLLATE utf8_bin NOT NULL,
login
varchar(50) COLLATE utf8_bin NOT NULL,
time
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS user_autologin
;
CREATE TABLE user_autologin
(
key_id
char(32) COLLATE utf8_bin NOT NULL,
user_id
int(11) NOT NULL DEFAULT '0',
user_agent
varchar(150) COLLATE utf8_bin NOT NULL,
last_ip
varchar(40) COLLATE utf8_bin NOT NULL,
last_login
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (key_id
,user_id
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS user_profiles
;
CREATE TABLE user_profiles
(
id
int(11) NOT NULL AUTO_INCREMENT,
user_id
int(11) NOT NULL,
country
varchar(20) COLLATE utf8_bin DEFAULT NULL,
website
varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
DROP TABLE IF EXISTS users
;
CREATE TABLE users
(
id
int(11) NOT NULL AUTO_INCREMENT,
username
varchar(50) COLLATE utf8_bin NOT NULL,
password
varchar(255) COLLATE utf8_bin NOT NULL,
email
varchar(100) COLLATE utf8_bin NOT NULL,
activated
tinyint(1) NOT NULL DEFAULT '1',
banned
tinyint(1) NOT NULL DEFAULT '0',
ban_reason
varchar(255) COLLATE utf8_bin DEFAULT NULL,
new_password_key
varchar(50) COLLATE utf8_bin DEFAULT NULL,
new_password_requested
datetime DEFAULT NULL,
new_email
varchar(100) COLLATE utf8_bin DEFAULT NULL,
new_email_key
varchar(50) COLLATE utf8_bin DEFAULT NULL,
last_ip
varchar(40) COLLATE utf8_bin NOT NULL,
last_login
datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
created
datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
modified
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;