CREATE DATABASE `whatsApp` CHARACTER SET utf8 COLLATE utf8_general_ci;


CREATE TABLE IF NOT EXISTS `users` (
    `id`  int UNSIGNED NOT NULL AUTO_INCREMENT ,
    `name`  varchar(100) NOT NULL ,
    `mobile`  varchar(15) NOT NULL ,
    `zarrinId`  int(6) NULL ,
    `isActive`  tinyint(1) NOT NULL DEFAULT 1 ,
    `accessHash`  varchar(50) NOT NULL ,
    `createdAt`  datetime NOT NULL ,
    `updatedAt`  datetime NOT NULL ,
    PRIMARY KEY (`id`),
    INDEX `idx1` USING BTREE (`zarrinId`),
    UNIQUE INDEX `idx2` USING BTREE (`zarrinId`),
    INDEX `idx3` USING BTREE (`mobile`),
    INDEX `idx4` USING BTREE (`accessHash`),
    INDEX `idx5` USING BTREE (`isActive`),
    INDEX `idx6` USING BTREE (`name`)
);