-- Install this in the same database configured by api/konak.php.
-- Review the column sizes and types against your existing application data
-- before running it in production.

CREATE TABLE IF NOT EXISTS `user_id` (
    `ID` INT UNSIGNED NOT NULL AUTO_INCREMENT,
    `last` DATE DEFAULT NULL,
    `username` VARCHAR(100) NOT NULL,
    `email` VARCHAR(255) NOT NULL,
    `password` VARCHAR(255) NOT NULL,
    `hwid` VARCHAR(255) DEFAULT NULL,
    `status` VARCHAR(30) NOT NULL DEFAULT 'Active',
    `time` DATE DEFAULT NULL,
    `expired` DATE DEFAULT NULL,
    `cr` DECIMAL(12,2) NOT NULL DEFAULT 0.00,
    `info` TEXT DEFAULT NULL,
    PRIMARY KEY (`ID`),
    UNIQUE KEY `uq_user_id_username` (`username`),
    UNIQUE KEY `uq_user_id_email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;