ALTER TABLE `courses` ADD `category` INT(50) NOT NULL AFTER `itemCode`;

CREATE TABLE `course_category` (
  `id` int(11) NOT NULL,
  `category` text NOT NULL,
  `slug` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `course_category`
--
ALTER TABLE `course_category`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `course_category`
--
ALTER TABLE `course_category`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;



CREATE TABLE `course_sub_category` (
  `id` int(11) NOT NULL,
  `category_id` int(50) NOT NULL,
  `sub_category` text NOT NULL,
  `slug` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `course_sub_category`
--
ALTER TABLE `course_sub_category`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `course_sub_category`
--
ALTER TABLE `course_sub_category`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

ALTER TABLE `courses` ADD `sub_category` INT(50) NOT NULL AFTER `category`;