forked from ebhomengo/niki
19 lines
681 B
MySQL
19 lines
681 B
MySQL
|
-- +migrate Up
|
||
|
CREATE TABLE `addresses`
|
||
|
(
|
||
|
`id` INT PRIMARY KEY AUTO_INCREMENT,
|
||
|
`postal_code` VARCHAR(191) NOT NULL,
|
||
|
`address` TEXT NOT NULL,
|
||
|
`lat` FLOAT NOT NULL,
|
||
|
`lon` FLOAT NOT NULL,
|
||
|
`province_id` INT NOT NULL,
|
||
|
`city_id` INT NOT NULL,
|
||
|
`benefactor_id` INT NOT NULL,
|
||
|
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||
|
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`;
|