added view for RSS campaigns
This commit is contained in:
parent
09103ac58b
commit
fd0e75da27
10 changed files with 430 additions and 134 deletions
24
setup/sql/upgrade-00008.sql
Normal file
24
setup/sql/upgrade-00008.sql
Normal file
|
@ -0,0 +1,24 @@
|
|||
# Header section
|
||||
# Define incrementing schema version number
|
||||
SET @schema_version = '8';
|
||||
|
||||
# Create new table to store RSS entries for RSS campaigns
|
||||
CREATE TABLE `rss` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`parent` int(11) unsigned NOT NULL,
|
||||
`guid` varchar(255) NOT NULL DEFAULT '',
|
||||
`pubdate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`campaign` int(11) unsigned DEFAULT NULL,
|
||||
`found` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `parent_2` (`parent`,`guid`),
|
||||
KEY `parent` (`parent`),
|
||||
CONSTRAINT `rss_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `campaigns` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
ALTER TABLE `campaigns` ADD COLUMN `parent` int(11) unsigned DEFAULT NULL AFTER `type`;
|
||||
CREATE INDEX parent_index ON `campaigns` (`parent`);
|
||||
|
||||
# Footer section
|
||||
LOCK TABLES `settings` WRITE;
|
||||
INSERT INTO `settings` (`key`, `value`) VALUES('db_schema_version', @schema_version) ON DUPLICATE KEY UPDATE `value`=@schema_version;
|
||||
UNLOCK TABLES;
|
Loading…
Add table
Add a link
Reference in a new issue