CREATE TABLE `#__openaire` (`key` VARCHAR(32) NOT NULL PRIMARY KEY, `value` VARCHAR(256));
INSERT INTO `#__openaire` (`key`, `value`) VALUES 
	('atomUrn', 'urn:uuid:afdb7560-8ff4-4a6d-a9f1-6acb55269134'),
	('claim.message', 'Dear sir/madame/amalgam...'),
	('claim.subject', 'You have won $1,000,000'),
	('invenioPassword', 'password'),
	('invenioUrl', 'https://openaire-dev.cern.ch'),
	('jdbcUri', 'jdbc:mysql://localhost:3306/joomla&user=joomla&password=aighe6Ba'),
	('newsCategory', 88),
	('newsSection', 1),
	('newsUser', 1659),
	('pageSize', '10'),
	('serviceUrl.driver', 'http://search.driver.research-infrastructures.eu:8380/dnet-web-generic/'),
	('serviceUrl.openaire', 'http://test.openaire.eu:8380/dnet-web-generic/'),
	('serviceUrl.stats.chart.docs', 'http://test.openaire.eu:18080/stats/pubchart?pubdrid='),
	('serviceUrl.stats.chart.repos', 'http://test.openaire.eu:18080/stats/repchart?replink='),
	('serviceUrl.stats.exist.docs', 'http://test.openaire.eu:18080/stats/exist?pubdrid='),
	('serviceUrl.stats.exist.repos', 'http://test.openaire.eu:18080/stats/exist?replink='),
	('subscriptionsPageSize', '1000'),
	('thriftConnectorHost', 'localhost'),
	('thriftConnectorPort', '7911'),
	('thriftConnectorTimeout', '10000'),
	('twitterAccessToken', '292267214-mvvJnhkzBtZ4xWv3DTCiAAO1ZRKf3TkULWG2hUMN'),
	('twitterAccessTokenSecret', 'qqojkHjZInqOX1ZMUYPn2owEONj4qptNjOywSLha4k'),
	('validatorBaseUrl', 'http://test.openaire.eu:8380/dnet-validator-openaire/portalLogin.action'), 
	('validatorPassword', '568345');

CREATE TABLE `#__openaire_alert_modes` (`id` VARCHAR (16) NOT NULL PRIMARY KEY, `name` VARCHAR (32) NOT NULL, `description` TEXT NOT NULL, `batch` BOOLEAN NOT NULL, `adminOnly` BOOLEAN NOT NULL);
INSERT INTO `#__openaire_alert_modes` (`id`, `name`, `description`, `batch`, `adminOnly`) VALUES
	('Atom', 'Atom Feed (RSS)', 'Post alert in OpenAIRE Atom feed.', FALSE, TRUE),
	('JDBC', 'OpenAIRE Portal - My Alerts', 'Post alert in My Alerts.', FALSE, FALSE),
	('Joomla!', 'OpenAIRE News', 'Post alert in OpenAIRE News.', FALSE, TRUE),
	('SMTP', 'Email', 'Send alert by email.', TRUE, FALSE),
	('twitter', 'twitter', 'Post alert to OpenAIRE twitter account.', FALSE, TRUE);

CREATE TABLE `#__openaire_alerts` (`username` VARCHAR (150) NOT NULL, `time` TIMESTAMP NOT NULL, `title` VARCHAR (255) NOT NULL, `message` TEXT NOT NULL, `link` TEXT, PRIMARY KEY (`username`, `time`, `title`));

CREATE TABLE `#__openaire_topic_hierarchy` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `parent` INT, `name` TEXT NOT NULL, `description` TEXT NOT NULL, `templateId` VARCHAR (36), `notificationService` VARCHAR (255), `queryId` VARCHAR (36), `resultId` VARCHAR (36), FOREIGN KEY (`parent`) REFERENCES `#__openaire_topic_hierarchy` (`id`) ON UPDATE CASCADE ON DELETE CASCADE);

