马上注册浏览全部内容。。。。。。
您需要 登录 才可以下载或查看,没有账号?中文注册
×
- // 创建表结构(使用预处理语句)
- $tables = [
- "{$config['prefix']}users" => "
- DROP TABLE IF EXISTS {$config['prefix']}users;
- CREATE TABLE `{$config['prefix']}users` (
- id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
- uid VARCHAR(16) UNIQUE NOT NULL,
- username VARCHAR(50) NOT NULL,
- email VARCHAR(100) NOT NULL UNIQUE,
- password_hash VARCHAR(255) NOT NULL,
- is_admin TINYINT(1) DEFAULT 0,
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
- ",
- "{$config['prefix']}user_points" => "
- DROP TABLE IF EXISTS {$config['prefix']}user_points;
- CREATE TABLE `{$config['prefix']}user_points` (
- id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
- uid VARCHAR(16) UNIQUE NOT NULL,
- point_1 INT DEFAULT 0,
- point_2 INT DEFAULT 0,
- point_3 INT DEFAULT 0,
- point_4 INT DEFAULT 0,
- point_5 INT DEFAULT 0,
- point_6 INT DEFAULT 0,
- point_7 INT DEFAULT 0,
- point_8 INT DEFAULT 0,
- FOREIGN KEY (uid) REFERENCES users(id)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
- ",
- "{$config['prefix']}nav_links" => "
- DROP TABLE IF EXISTS {$config['prefix']}nav_links;
- CREATE TABLE `{$config['prefix']}nav_links` (
- id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
- url VARCHAR(255) NOT NULL,
- title VARCHAR(100) NOT NULL,
- icon VARCHAR(255),
- uid VARCHAR(16) UNIQUE NOT NULL,
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
- sort_order INT DEFAULT 0
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
- ",
- // 其他表结构...
- ];
复制代码 |