],
'Image, write-both' => [
MIGRATION_WRITE_BOTH, 'img_description',
- [ 'img_description_old' => 'img_description', 'img_description_pk' => 'img_name' ],
+ [
+ 'img_description_old' => 'img_description',
+ 'img_description_id' => 'img_description_id'
+ ],
],
'Image, write-new' => [
MIGRATION_WRITE_NEW, 'img_description',
- [ 'img_description_old' => 'img_description', 'img_description_pk' => 'img_name' ],
+ [
+ 'img_description_old' => 'img_description',
+ 'img_description_id' => 'img_description_id'
+ ],
],
'Image, new' => [
MIGRATION_NEW, 'img_description',
- [ 'img_description_pk' => 'img_name' ],
+ [
+ 'img_description_id' => 'img_description_id'
+ ],
],
];
}
'Image, write-both' => [
MIGRATION_WRITE_BOTH, 'img_description', [
'tables' => [
- 'temp_img_description' => 'image_comment_temp',
'comment_img_description' => 'comment',
],
'fields' => [
'img_description_cid' => 'comment_img_description.comment_id',
],
'joins' => [
- 'temp_img_description' => [ 'LEFT JOIN', 'temp_img_description.imgcomment_name = img_name' ],
'comment_img_description' => [ 'LEFT JOIN',
- 'comment_img_description.comment_id = temp_img_description.imgcomment_description_id' ],
+ 'comment_img_description.comment_id = img_description_id',
+ ],
],
],
],
'Image, write-new' => [
MIGRATION_WRITE_NEW, 'img_description', [
'tables' => [
- 'temp_img_description' => 'image_comment_temp',
'comment_img_description' => 'comment',
],
'fields' => [
'img_description_cid' => 'comment_img_description.comment_id',
],
'joins' => [
- 'temp_img_description' => [ 'LEFT JOIN', 'temp_img_description.imgcomment_name = img_name' ],
'comment_img_description' => [ 'LEFT JOIN',
- 'comment_img_description.comment_id = temp_img_description.imgcomment_description_id' ],
+ 'comment_img_description.comment_id = img_description_id',
+ ],
],
],
],
'Image, new' => [
MIGRATION_NEW, 'img_description', [
'tables' => [
- 'temp_img_description' => 'image_comment_temp',
'comment_img_description' => 'comment',
],
'fields' => [
'img_description_cid' => 'comment_img_description.comment_id',
],
'joins' => [
- 'temp_img_description' => [ 'JOIN', 'temp_img_description.imgcomment_name = img_name' ],
'comment_img_description' => [ 'JOIN',
- 'comment_img_description.comment_id = temp_img_description.imgcomment_description_id' ],
+ 'comment_img_description.comment_id = img_description_id',
+ ],
],
],
],
* @param int $stage
*/
public function testInsertWithTempTableDeprecated( $stage ) {
- $wrap = TestingAccessWrapper::newFromClass( CommentStore::class );
- $wrap->formerTempTables += [ 'ipb_reason' => '1.30' ];
+ $store = $this->makeStore( $stage );
+ $wrap = TestingAccessWrapper::newFromObject( $store );
+ $wrap->tempTables += [ 'ipb_reason' => [
+ 'stage' => MIGRATION_NEW,
+ 'deprecatedIn' => '1.30',
+ ] ];
$this->hideDeprecated( 'CommentStore::insertWithTempTable for ipb_reason' );
- $store = $this->makeStore( $stage );
list( $fields, $callback ) = $store->insertWithTempTable( $this->db, 'ipb_reason', 'foo' );
$this->assertTrue( is_callable( $callback ) );
}