-- Deploy gaia:api_2016_03_16_add_out_of_stock_alert to mysql

BEGIN;

    CREATE TABLE `api_stock_alert` (
        `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
        `diary_id` int(11) NOT NULL,
        `appointment` int(11) NOT NULL DEFAULT 1,
        `doctor` varchar(50) NOT NULL,
        `hospital` varchar(100) NOT NULL,
        `item_name` varchar(30) NOT NULL,
        `phone` varchar(30) UNIQUE NULL,
        `business_partener_id` int(11) DEFAULT NULL,
        `note` longtext NULL,
        `update_time` datetime NOT NULL
    );

COMMIT;
