# 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' )
);
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' ),
$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
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,