niki/repository/mysql/migration/1705244014_add_benefactor_t...

21 lines
922 B
SQL

-- +migrate Up
-- please read this article to understand why we use VARCHAR(191)
-- https://www.grouparoo.com/blog/varchar-191#why-varchar-and-not-text
CREATE TABLE `benefactors` (
`id` INT PRIMARY KEY AUTO_INCREMENT,
`first_name` VARCHAR(191) ,
`last_name` VARCHAR(191) ,
`phone_number` VARCHAR(191) NOT NULL UNIQUE,
`address` TEXT,
`description` TEXT,
`email` VARCHAR(191),
`city` VARCHAR(191),
`gender` VARCHAR(191),
`status` VARCHAR(191),
`birthdate` TIMESTAMP,
`role` ENUM('benefactor') NOT NULL,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- +migrate Down
DROP TABLE `benefactors`;