Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F9227
textMigration.php
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 22 2014, 12:20 AM
2014-11-22 00:20:21 (UTC+0)
Size
744 B
Referenced Files
None
Subscribers
None
textMigration.php
View Options
<?php
require_once
'Maintenance.php'
;
class
TextMigration
extends
Maintenance
{
public
function
__construct
()
{
parent
::
__construct
();
}
public
function
execute
()
{
$this
->
output
(
"Migrating the fields archive.ar_text and archive.ar_flags from archive table to text table
\n
"
);
$dbw
=
wfGetDB
(
DB_MASTER
);
$result
=
$dbw
->
select
(
'archive'
,
array
(
'ar_text'
,
'ar_flags'
),
NULL
,
__METHOD__
);
foreach
(
$result
as
$row
)
{
$dbw
->
insert
(
'text'
,
array
(
'old_text'
=>
$row
->
ar_text
,
'old_flags'
=>
$row
->
ar_flags
),
__METHOD__
,
''
);
$count
=
$dbw
->
affectedRows
();
$this
->
output
(
"Successfully migrated $count number of rows
\n
"
)
;
}
}
}
$maintClass
=
"TextMigration"
;
require_once
RUN_MAINTENANCE_IF_MAIN
;
File Metadata
Details
Attached
Mime Type
text/x-php
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8733
Default Alt Text
textMigration.php (744 B)
Attached To
Mode
T36925: [MCR] create maintenance script for Migration of text from archive table to text table
Attached
Detach File
Event Timeline
Log In to Comment