sql generation

This commit is contained in:
Garvin Hicking 2012-04-22 20:23:02 +02:00
parent 4303dd0861
commit 74023f1387
2 changed files with 17 additions and 5 deletions

View file

@ -1,5 +1,8 @@
1.14:
* Fixed bad SQL table create statement
1.13:
* Issue SQL statement compatible with pgsql, thanks to ads
* Issue SQL statement compatible with pgsql, thanks to ads
1.12:
* Added delayed trackbacks, generating those of entries published

View file

@ -26,7 +26,7 @@ class serendipity_event_trackback extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_MTRACKBACK_TITLEDESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Garvin Hicking, Malte Paskuda');
$propbag->add('version', '1.13');
$propbag->add('version', '1.14');
$propbag->add('requirements', array(
'serendipity' => '0.8',
'smarty' => '2.6.7',
@ -315,17 +315,26 @@ class serendipity_event_trackback extends serendipity_event
global $serendipity;
$sql = "CREATE TABLE {$serendipity['dbPrefix']}delayed_trackbacks (
id int(11) NOT NULL ,
timestamp int(10) {UNSIGNED},
PRIMARY KEY (id)
)";
serendipity_db_schema_import ( $sql );
// Hotfix; better to check for pgsql vs. mysql here, but I didn't have time and needed this fixed for my install
$sql = "CREATE TABLE {$serendipity['dbPrefix']}delayed_trackbacks (
id int(11) NOT NULL ,
timestamp int(10) {UNSIGNED}
PRIMARY KEY (id)
)";
serendipity_db_schema_import ( $sql );
}
function upgradeCheck() {
$db_upgrade = serendipity_db_bool($this->get_config('db_upgrade', false));
if ($db_upgrade == false || $db_upgrade === null) {
$db_upgrade = serendipity_db_bool($this->get_config('db_upgrade', 2));
if ((int)$db_upgrade !== 2) {
$this->setupDB();
$this->set_config('db_upgrade', true);
$this->set_config('db_upgrade', 2);
}
}