CREATE TABLE IF NOT EXISTS `{{TABLE_PREFIX}}_tenant_users` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `full_name` TEXT NOT NULL,
  `username` TEXT NOT NULL,
  `email` TEXT NOT NULL,
  `password` TEXT NOT NULL,
  `user_id` TEXT NOT NULL,
  `role_id` INT NOT NULL,
  `role_name` TEXT NOT NULL,
  `last_login` TEXT NOT NULL,
  `last_login_ip` TEXT NOT NULL,
  `account_status` VARCHAR(20) NOT NULL,
  `account_status_changed_by` TEXT NOT NULL,
  `account_status_changed_ip` TEXT NOT NULL,
  `total_logins` INT NOT NULL,
  `otp` TEXT NOT NULL,
  `otp_generated_on` TEXT NOT NULL,
  `otp_generated_ip` TEXT NOT NULL,
  `created_by` TEXT NOT NULL,
  `created_at` TEXT NOT NULL,
  `create_ip` TEXT NOT NULL,
  `modified_by` TEXT NOT NULL,
  `modified_on` TEXT NOT NULL,
  `modified_ip` TEXT NOT NULL,
  `photo_path` TEXT NOT NULL,
  `phone` TEXT NOT NULL,
  `reporting_to` TEXT NOT NULL,
  `allocated_storage` BIGINT NOT NULL,
  PRIMARY KEY (`id`),
  FOREIGN KEY (`role_id`) REFERENCES `{{TABLE_PREFIX}}_tenant_users_roles`(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
