-- dependson: None
-- model: relation.UserTagRelation
-- author: Pengfei.X
-- date: 2015.08.31 14:00:00
-- description: add table relation_usertagrelation

BEGIN;


CREATE table relation_usertagrelation (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `related_tag_id` int(11) NOT NULL,
  `tag_type` varchar(1) not null,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

ALTER TABLE relation_usertagrelation ADD CONSTRAINT `fk_relation_usertagrelation_user` FOREIGN KEY (`user_id`) REFERENCES auth_user (`id`);
ALTER TABLE relation_usertagrelation ADD CONSTRAINT `fk_relation_usertagrelation_tag` FOREIGN KEY (`related_tag_id`) REFERENCES api_tag(`id`);

COMMIT;
