niki/benefactorapp/repository/database/migration/1775190076-create-benefacot...

20 lines
748 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 `benefactors1` (
`id` INT PRIMARY KEY AUTO_INCREMENT,
`first_name` VARCHAR(191),
`last_name` VARCHAR(191),
`phone_number` VARCHAR(191) NOT NULL UNIQUE,
`description` TEXT,
`email` VARCHAR(191),
`gender` ENUM('male','female'),
`birth_date` TIMESTAMP,
`status` ENUM('active','inactive') NOT NULL DEFAULT 'active',
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
-- +migrate Down
DROP TABLE `benefactors1`;