niki/repository/mysql/migration/1705399195_create_cities_ta...

13 lines
552 B
MySQL
Raw Normal View History

-- +migrate Up
CREATE TABLE `cities` (
`id` INT PRIMARY KEY AUTO_INCREMENT,
`name` VARCHAR(191) NOT NULL,
`province_id` INT NOT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY (`province_id`) REFERENCES `provinces`(`id`)
);
-- +migrate Down
DROP TABLE `cities`;