USE `ekktt`;
DROP TABLE IF EXISTS `ekktt_rss_feed_urls`;
CREATE TABLE `ekktt_rss_feed_urls` (
  `url_id` int(11) NOT NULL AUTO_INCREMENT,
  `url` varchar(256) NOT NULL, /*the url where the feed is */
  `crawled_date` datetime DEFAULT NULL, /*last date the url was crawled */
  `insert_date` datetime NOT NULL,  /*Time the url was added to database */
  `crawled´ boolean default false,
  UNIQUE KEY (`url`),
  PRIMARY KEY (`url_id`)
) ENGINE=MyISAM;

ALTER TABLE ekktt_article 
CHANGE channel_id channel_id enum('POSTIMEES','ARIPAEV','PAEVALEHT','EESTIEKSPRESS','DELFI', 'RSS') NOT NULL;

ALTER TABLE ekktt_visit_url 
CHANGE channel_id channel_id enum('POSTIMEES','ARIPAEV','PAEVALEHT','EESTIEKSPRESS','DELFI', 'RSS') NOT NULL;


/*
Table that holds all the url-s that have been visited
 */

CREATE DATABASE IF NOT EXISTS `experiment_crawler_urls` CHARACTER SET utf8 COLLATE utf8_bin;
USE `experiment_crawler_urls`;

DROP TABLE IF EXISTS `ekktt_crawled_urls_for_feeds`;
CREATE TABLE `ekktt_crawled_urls_for_feeds` (
  `url_id` int(11) NOT NULL AUTO_INCREMENT,
  `url` varchar(256) NOT NULL, 
  `crawled_date` datetime NOT NULL,
  `insert_date` datetime NOT NULL,
  PRIMARY KEY (`url_id`)
) ENGINE=MyISAM;

/*
Table that holds the url-s that are to be crawled
 */
DROP TABLE IF EXISTS `ekktt_urls_to_be_crawled`;
CREATE TABLE `ekktt_urls_to_be_crawled` (
  `url` varchar(256) NOT NULL NOT NULL,
  `insert_date` datetime NOT NULL,
  `crawled` boolean default false,
  `amount_of_urls` int(11) default null,
  `crawled_date` datetime DEFAULT NULL
) ENGINE=MyISAM;


