
	CREATE TABLE `rq_phonics_img` (
	  `file_id` int(11) NOT NULL,
	  `user_id` int(11) NOT NULL,
	  `area_id` int(11) NOT NULL,
	  `area` varchar(50) NOT NULL,
	  `file_type` varchar(50) NOT NULL,
	  `file_name` varchar(50) NOT NULL,
	  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
	  `status` tinyint(4) NOT NULL
	) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;


	CREATE TABLE `rq_phonics_img_lang` (
	  `file_id` int(11) NOT NULL,
	  `lang` varchar(10) NOT NULL,
	  `porder` int(11) DEFAULT '1',
	  `title` varchar(25) NOT NULL,
	  `caption` text NOT NULL,
	  `link` text NOT NULL,
	  `link_target` tinyint(4) NOT NULL DEFAULT '0'
	) ENGINE=InnoDB DEFAULT CHARSET=latin1;


	CREATE TABLE `rq_phonics_img_priority` (
	  `file_id` int(11) NOT NULL,
	  `priority` int(11) NOT NULL DEFAULT '0'
	) ENGINE=InnoDB DEFAULT CHARSET=latin1;


	ALTER TABLE `rq_phonics_img`
	  ADD PRIMARY KEY (`file_id`);

	ALTER TABLE `rq_phonics_img_lang`
	  ADD PRIMARY KEY (`file_id`);
	ALTER TABLE `rq_phonics_img`
	  MODIFY `file_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

    /*foundations*/
    ALTER TABLE `rq_foundations_videos_lang` ADD `porder` INT(11) NOT NULL DEFAULT '1' AFTER `lang`;

	CREATE TABLE `rq_foundations_img` (
	  `file_id` int(11) NOT NULL,
	  `user_id` int(11) NOT NULL,
	  `area_id` int(11) NOT NULL,
	  `area` varchar(50) NOT NULL,
	  `file_type` varchar(50) NOT NULL,
	  `file_name` varchar(50) NOT NULL,
	  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
	  `status` tinyint(4) NOT NULL
	) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;


	CREATE TABLE `rq_foundations_img_lang` (
	  `file_id` int(11) NOT NULL,
	  `lang` varchar(10) NOT NULL,
	  `porder` int(11) DEFAULT '1',
	  `title` varchar(25) NOT NULL,
	  `caption` text NOT NULL,
	  `link` text NOT NULL,
	  `link_target` tinyint(4) NOT NULL DEFAULT '0'
	) ENGINE=InnoDB DEFAULT CHARSET=latin1;


	CREATE TABLE `rq_foundations_img_priority` (
	  `file_id` int(11) NOT NULL,
	  `priority` int(11) NOT NULL DEFAULT '0'
	) ENGINE=InnoDB DEFAULT CHARSET=latin1;


	ALTER TABLE `rq_foundations_img`
	  ADD PRIMARY KEY (`file_id`);

	ALTER TABLE `rq_foundations_img_lang`
	  ADD PRIMARY KEY (`file_id`);
	ALTER TABLE `rq_foundations_img`
	  MODIFY `file_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;


      /*math*/

  ALTER TABLE `rq_math_videos_lang` ADD `porder` INT(11) NOT NULL DEFAULT '1' AFTER `lang`;

  	CREATE TABLE `rq_math_img` (
  	  `file_id` int(11) NOT NULL,
  	  `user_id` int(11) NOT NULL,
  	  `area_id` int(11) NOT NULL,
  	  `area` varchar(50) NOT NULL,
  	  `file_type` varchar(50) NOT NULL,
  	  `file_name` varchar(50) NOT NULL,
  	  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  	  `status` tinyint(4) NOT NULL
  	) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;


  	CREATE TABLE `rq_math_img_lang` (
  	  `file_id` int(11) NOT NULL,
  	  `lang` varchar(10) NOT NULL,
  	  `porder` int(11) DEFAULT '1',
  	  `title` varchar(25) NOT NULL,
  	  `caption` text NOT NULL,
  	  `link` text NOT NULL,
  	  `link_target` tinyint(4) NOT NULL DEFAULT '0'
  	) ENGINE=InnoDB DEFAULT CHARSET=latin1;


  	CREATE TABLE `rq_math_img_priority` (
  	  `file_id` int(11) NOT NULL,
  	  `priority` int(11) NOT NULL DEFAULT '0'
  	) ENGINE=InnoDB DEFAULT CHARSET=latin1;


  	ALTER TABLE `rq_math_img`
  	  ADD PRIMARY KEY (`file_id`);

  	ALTER TABLE `rq_math_img_lang`
  	  ADD PRIMARY KEY (`file_id`);
  	ALTER TABLE `rq_math_img`
  	  MODIFY `file_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

      /*grammar*/

    CREATE TABLE `rq_grammars_img` (
      `file_id` int(11) NOT NULL,
      `user_id` int(11) NOT NULL,
      `area_id` int(11) NOT NULL,
      `area` varchar(50) NOT NULL,
      `file_type` varchar(50) NOT NULL,
      `file_name` varchar(50) NOT NULL,
      `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
      `status` tinyint(4) NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;


    CREATE TABLE `rq_grammars_img_lang` (
      `file_id` int(11) NOT NULL,
      `lang` varchar(10) NOT NULL,
      `porder` int(11) DEFAULT '1',
      `title` varchar(25) NOT NULL,
      `caption` text NOT NULL,
      `link` text NOT NULL,
      `link_target` tinyint(4) NOT NULL DEFAULT '0'
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;


    CREATE TABLE `rq_grammars_img_priority` (
      `file_id` int(11) NOT NULL,
      `priority` int(11) NOT NULL DEFAULT '0'
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;


    ALTER TABLE `rq_grammars_img`
      ADD PRIMARY KEY (`file_id`);

    ALTER TABLE `rq_grammars_img_lang`
      ADD PRIMARY KEY (`file_id`);
    ALTER TABLE `rq_grammars_img`
      MODIFY `file_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
