Closed (fixed)
Project:
Migrate
Version:
7.x-2.3
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Feb 2013 at 08:16 UTC
Updated:
12 Feb 2013 at 16:11 UTC
Maping table is created but with not destid1 field. On source database map table is not created at all. Do i have to change to ver 2.5?
class migrate_fr_newsletter_subscriberMigration extends Migration {
public function __construct() {
parent::__construct();
$this->description = 'Subscriber table';
// external database info
Database::addConnectionInfo('canal3_fr', 'default', array(
'driver' => 'mysql',
'database' => 'xxxx',
'username' => 'xxxx',
'password' => 'xxxx',
'host' => 'xxxx',
'collation' => 'utf8_general_ci'
));
// connection
$connection = Database::getConnection('default', 'canal3_fr');
$table_name = 'simplenews_subscriber';
$this->map = new MigrateSQLMap($this->machineName,
array('snid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
)
),
MigrateDestinationTable::getKeySchema(),
'default'
);
$query = $connection
->select('simplenews_subscriber', 'ns')
->fields('ns')
->condition('activated', 1);
$this->source = new MigrateSourceSQL($query);
$this->destination = new MigrateDestinationTable($table_name);
// Mapped fields
$this->addFieldMapping('activated', 'activated');
$this->addFieldMapping('mail', 'mail');
$this->addFieldMapping('uid', 'uid');
$this->addFieldMapping('language', 'language');
$this->addFieldMapping('timestamp', 'timestamp');
$this->addFieldMapping('changes', 'changes');
$this->addFieldMapping('created', ' created');
}
}
Comments
Comment #1
paralax commented