aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/Block.php5
-rw-r--r--includes/installer/OracleUpdater.php11
-rw-r--r--maintenance/oracle/archives/patch_remove_not_null_empty_defs2.sql3
-rw-r--r--maintenance/oracle/tables.sql2
4 files changed, 19 insertions, 2 deletions
diff --git a/includes/Block.php b/includes/Block.php
index 3a2fa6eb9621..7aa1bc1dc811 100644
--- a/includes/Block.php
+++ b/includes/Block.php
@@ -426,9 +426,12 @@ class Block {
# Don't collide with expired blocks
Block::purgeExpired();
+ $row = $this->getDatabaseArray();
+ $row['ipb_id'] = $dbw->nextSequenceValue("ipblocks_ipb_id_seq");
+
$dbw->insert(
'ipblocks',
- $this->getDatabaseArray(),
+ $row,
__METHOD__,
array( 'IGNORE' )
);
diff --git a/includes/installer/OracleUpdater.php b/includes/installer/OracleUpdater.php
index 82031ad2cb1e..64188cb8440f 100644
--- a/includes/installer/OracleUpdater.php
+++ b/includes/installer/OracleUpdater.php
@@ -46,6 +46,7 @@ class OracleUpdater extends DatabaseUpdater {
array( 'addTable', 'globalinterwiki', 'patch-globalinterwiki.sql' ),
array( 'addField', 'revision', 'rev_sha1', 'patch-rev_sha1_field.sql' ),
array( 'addField', 'archive', 'ar_sha1', 'patch-ar_sha1_field.sql' ),
+ array( 'doRemoveNotNullEmptyDefaults2' ),
// till 2.0 i guess
array( 'doRebuildDuplicateFunction' ),
@@ -145,6 +146,16 @@ class OracleUpdater extends DatabaseUpdater {
$this->applyPatch( 'patch_remove_not_null_empty_defs.sql', false );
$this->output( "ok\n" );
}
+ protected function doRemoveNotNullEmptyDefaults2() {
+ $this->output( "Removing not null empty constraints ... " );
+ $meta = $this->db->fieldInfo( 'ipblocks' , 'ipb_by_text' );
+ if ( $meta->isNullable() ) {
+ $this->output( "constraints seem to be removed\n" );
+ return;
+ }
+ $this->applyPatch( 'patch_remove_not_null_empty_defs2.sql', false );
+ $this->output( "ok\n" );
+ }
/**
* rebuilding of the function that duplicates tables for tests
diff --git a/maintenance/oracle/archives/patch_remove_not_null_empty_defs2.sql b/maintenance/oracle/archives/patch_remove_not_null_empty_defs2.sql
new file mode 100644
index 000000000000..f7a38a05f09a
--- /dev/null
+++ b/maintenance/oracle/archives/patch_remove_not_null_empty_defs2.sql
@@ -0,0 +1,3 @@
+define mw_prefix='{$wgDBprefix}';
+
+ALTER TABLE &mw_prefix.ipblocks MODIFY ipb_by_text DEFAULT NULL NULL;
diff --git a/maintenance/oracle/tables.sql b/maintenance/oracle/tables.sql
index c9fc05f40422..02488cd35e8a 100644
--- a/maintenance/oracle/tables.sql
+++ b/maintenance/oracle/tables.sql
@@ -259,7 +259,7 @@ CREATE TABLE &mw_prefix.ipblocks (
ipb_address VARCHAR2(255) NULL,
ipb_user NUMBER DEFAULT 0 NOT NULL,
ipb_by NUMBER DEFAULT 0 NOT NULL,
- ipb_by_text VARCHAR2(255) NOT NULL,
+ ipb_by_text VARCHAR2(255) NULL,
ipb_reason VARCHAR2(255) NOT NULL,
ipb_timestamp TIMESTAMP(6) WITH TIME ZONE NOT NULL,
ipb_auto CHAR(1) DEFAULT '0' NOT NULL,