-- Deploy gaia:api_2016_09_12_create_table_pgcclassfiy_add_column_for_problem to mysql

BEGIN;

-- XXX Add DDLs here.
CREATE TABLE `api_pgcclassify` (
    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
    `name` varchar(20) NOT NULL,
    `ordering` integer NOT NULL,
    `is_online` bool NOT NULL
)
;
ALTER TABLE `api_problem` ADD COLUMN `audit_status` bool NOT NULL default True;
ALTER TABLE `api_problem` ADD COLUMN `pgc_classfy_id` integer;
ALTER TABLE `api_problem` ADD CONSTRAINT `pgc_classfy_id_refs_id_014d1a14` FOREIGN KEY (`pgc_classfy_id`) REFERENCES `api_pgcclassify` (`id`);

COMMIT;
