niki/repository/mysql/migration/1705244015_create_admins_ta...

19 lines
900 B
SQL

-- +migrate Up
CREATE TABLE `admins` (
`id` INT PRIMARY KEY AUTO_INCREMENT,
`first_name` VARCHAR(191),
`last_name` VARCHAR(191),
`password` VARCHAR(191) NOT NULL,
`phone_number` VARCHAR(191) NOT NULL UNIQUE,
`role` ENUM('super-admin','admin','agent') NOT NULL, -- default?
`description` TEXT,
`email` VARCHAR(191) NOT NULL UNIQUE,
`gender` ENUM('male','female'),
`status` ENUM('active','inactive') NOT NULL DEFAULT 'active',
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP
);
-- +migrate Down
DROP TABLE `admins`;