Index: trunk/extensions/Configure/CHANGELOG |
— | — | @@ -1,6 +1,10 @@ |
2 | 2 | This file lists changes on this extension. |
3 | 3 | Localisation updates are done on betawiki and aren't listed here. |
4 | 4 | |
| 5 | +0.12.0 - 6 February 2009 |
| 6 | + Added support for PostgreSQL when using database handler. |
| 7 | + |
| 8 | + |
5 | 9 | 0.11.16 - 2 February 2009 |
6 | 10 | * Added new section "Pages" on Special:Configure |
7 | 11 | * Changed order of some sections |
Index: trunk/extensions/Configure/Configure.handler-db.php |
— | — | @@ -140,11 +140,11 @@ |
141 | 141 | * @return array |
142 | 142 | */ |
143 | 143 | public function getOldSettings( $ts ) { |
144 | | - $db = $this->getSlaveDB(); |
145 | | - $ret = $db->select( |
| 144 | + $dbr = $this->getSlaveDB(); |
| 145 | + $ret = $dbr->select( |
146 | 146 | array( 'config_setting', 'config_version' ), |
147 | 147 | array( 'cs_name', 'cv_wiki', 'cs_value' ), |
148 | | - array( 'cv_timestamp' => $ts ), |
| 148 | + array( 'cv_timestamp' => $dbr->timestamp( $ts ) ), |
149 | 149 | __METHOD__, |
150 | 150 | array(), |
151 | 151 | array( 'config_version' => array( 'LEFT JOIN', 'cs_id = cv_id' ) ) |
— | — | @@ -164,7 +164,8 @@ |
165 | 165 | * @return array |
166 | 166 | */ |
167 | 167 | public function getWikisInVersion( $ts ) { |
168 | | - $wiki = $this->getSlaveDB()->selectField( 'config_version', 'cv_wiki', array( 'cv_timestamp' => $ts ), __METHOD__ ); |
| 168 | + $dbr = $this->getSlaveDB(); |
| 169 | + $wiki = $dbr->selectField( 'config_version', 'cv_wiki', array( 'cv_timestamp' => $dbr->timestamp( $ts ) ), __METHOD__ ); |
169 | 170 | if ( $wiki === false ) |
170 | 171 | return array(); |
171 | 172 | return array( $wiki ); |
— | — | @@ -217,10 +218,12 @@ |
218 | 219 | $this->saveSettingsForWiki( $settings, $wiki, $ts+1, $reason ); |
219 | 220 | |
220 | 221 | $dbw->begin(); |
| 222 | + $newId = $dbw->nextSequenceValue( 'config_version_cv_id_seq' ); |
221 | 223 | $dbw->insert( 'config_version', |
222 | 224 | array( |
| 225 | + 'cv_id' => $newId, |
223 | 226 | 'cv_wiki' => $wiki, |
224 | | - 'cv_timestamp' => $dbw->timestamp($ts), |
| 227 | + 'cv_timestamp' => $dbw->timestamp( $ts ), |
225 | 228 | 'cv_is_latest' => 1, |
226 | 229 | 'cv_user_text' => $wgUser->getName(), |
227 | 230 | 'cv_user_wiki' => wfWikiId(), |
— | — | @@ -295,7 +298,7 @@ |
296 | 299 | */ |
297 | 300 | public function versionExists( $ts ) { |
298 | 301 | $dbr = $this->getSlaveDB(); |
299 | | - return (bool)$dbr->selectField( 'config_version', '1', array( 'cv_timestamp' => $ts ), __METHOD__ ); |
| 302 | + return (bool)$dbr->selectField( 'config_version', '1', array( 'cv_timestamp' => $dbr->timestamp( $ts ) ), __METHOD__ ); |
300 | 303 | } |
301 | 304 | |
302 | 305 | /** |
Index: trunk/extensions/Configure/Configure.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Configure', |
19 | 19 | 'description' => 'Allow authorised users to configure the wiki via a web-based interface', |
20 | 20 | 'descriptionmsg' => 'configure-desc', |
21 | | - 'version' => '0.11.16', |
| 21 | + 'version' => '0.12.0', |
22 | 22 | ); |
23 | 23 | |
24 | 24 | # Configuration part |
Index: trunk/extensions/Configure/configure.pg.sql |
— | — | @@ -0,0 +1,45 @@ |
| 2 | +-- |
| 3 | +-- Postgres' SQL schema for Configure extension |
| 4 | +-- |
| 5 | + |
| 6 | +-- Information about each configuration version |
| 7 | +CREATE SEQUENCE config_version_cv_id_seq; |
| 8 | +CREATE TABLE config_version ( |
| 9 | + |
| 10 | + -- Primary key, used for joins with config_setting table |
| 11 | + cv_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval( 'config_version_cv_id_seq' ), |
| 12 | + |
| 13 | + -- wiki concerned by this version |
| 14 | + cv_wiki TEXT NOT NULL, |
| 15 | + |
| 16 | + -- TS_MV timestamp of the version |
| 17 | + cv_timestamp TIMESTAMPTZ NOT NULL, |
| 18 | + |
| 19 | + -- Whether this is the latest version for cv_wiki, will be used to get |
| 20 | + -- all curent version when loading all the configuration at startup |
| 21 | + cv_is_latest SMALLINT NOT NULL DEFAULT 0, |
| 22 | + |
| 23 | + -- Who made the revision, name and wiki ID |
| 24 | + cv_user_text TEXT NOT NULL, |
| 25 | + cv_user_wiki TEXT NOT NULL, |
| 26 | + |
| 27 | + -- Reason - not used yet but maybe in the future. |
| 28 | + cv_reason TEXT NOT NULL |
| 29 | +); |
| 30 | +CREATE INDEX cv_timestamp ON config_version( cv_timestamp ); |
| 31 | +CREATE INDEX cv_is_latest ON config_version( cv_is_latest ); |
| 32 | + |
| 33 | +-- Configuration settings |
| 34 | +CREATE TABLE config_setting ( |
| 35 | + |
| 36 | + -- foreign key to config_version.cv_id, used for joins |
| 37 | + cs_id INTEGER NOT NULL, |
| 38 | + |
| 39 | + -- setting's name |
| 40 | + cs_name TEXT NOT NULL, |
| 41 | + |
| 42 | + -- setting's value, in php serialized format |
| 43 | + cs_value TEXT |
| 44 | +); |
| 45 | +CREATE UNIQUE INDEX cs_id_name ON config_setting( cs_id, cs_name ); |
| 46 | +CREATE INDEX cs_id ON config_setting( cs_id ); |
\ No newline at end of file |
Property changes on: trunk/extensions/Configure/configure.pg.sql |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 47 | + native |