Ability to close comments at a certain date/time - needed for loom.io emulation (and many other uses)

This commit is contained in:
friendica
2014-08-28 16:56:13 -07:00
parent f526a10f07
commit 53b5cf7f50
6 changed files with 105 additions and 57 deletions

View File

@@ -511,6 +511,7 @@ CREATE TABLE IF NOT EXISTS `item` (
`commented` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`received` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`comments_closed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`owner_xchan` char(255) NOT NULL DEFAULT '',
`author_xchan` char(255) NOT NULL DEFAULT '',
`source_xchan` char(255) NOT NULL DEFAULT '',
@@ -553,6 +554,8 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `received` (`received`),
KEY `uid_commented` (`uid`,`commented`),
KEY `uid_created` (`uid`,`created`),
KEY `changed` (`changed`),
KEY `comments_closed` (`comments_closed`),
KEY `aid` (`aid`),
KEY `owner_xchan` (`owner_xchan`),
KEY `author_xchan` (`author_xchan`),

View File

@@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1127 );
define( 'UPDATE_VERSION' , 1128 );
/**
*
@@ -1440,3 +1440,11 @@ ADD INDEX ( `convid` )");
}
function update_r1127() {
$r = q("ALTER TABLE `item` ADD `comments_closed` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `changed` ,
ADD INDEX ( `comments_closed` ), ADD INDEX ( `changed` ) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}