2024-03-14 13:38:42 +00:00
|
|
|
-- +migrate Up
|
|
|
|
CREATE TABLE `addresses` (
|
|
|
|
`id` INT PRIMARY KEY AUTO_INCREMENT,
|
|
|
|
`postal_code` VARCHAR(191) NOT NULL,
|
|
|
|
`address` TEXT NOT NULL,
|
|
|
|
`lat` FLOAT,
|
|
|
|
`lon` FLOAT,
|
2024-05-30 12:57:33 +00:00
|
|
|
`name` VARCHAR(191) NOT NULL,
|
2024-03-14 13:38:42 +00:00
|
|
|
`city_id` INT NOT NULL,
|
|
|
|
`province_id` INT NOT NULL,
|
|
|
|
`benefactor_id` INT NOT NULL,
|
|
|
|
|
|
|
|
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
2024-05-17 20:16:28 +00:00
|
|
|
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
2024-06-08 14:25:24 +00:00
|
|
|
`deleted_at` TIMESTAMP,
|
2024-03-14 13:38:42 +00:00
|
|
|
FOREIGN KEY (`province_id`) REFERENCES `provinces` (`id`),
|
|
|
|
FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`),
|
|
|
|
FOREIGN KEY (`benefactor_id`) REFERENCES `benefactors` (`id`)
|
|
|
|
);
|
|
|
|
|
|
|
|
-- +migrate Down
|
|
|
|
DROP TABLE `addresses`;
|