| Conditions | 4 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public function migrate() |
||
| 33 | { |
||
| 34 | $this->msg( sprintf( 'Migrating "%1$s" column in "%2$s" table', 'static_info_country', 'fe_users' ), 0 ); |
||
| 35 | |||
| 36 | $schema = $this->getSchema( 'db-customer' ); |
||
| 37 | |||
| 38 | if( $schema->tableExists( 'fe_users' ) === true && $schema->tableExists( 'static_countries' ) === true |
||
| 39 | && $schema->columnExists( 'fe_users', 'static_info_country' ) === true ) |
||
| 40 | { |
||
| 41 | $stmt = 'UPDATE fe_users SET static_info_country = ( |
||
| 42 | SELECT cn_iso_2 FROM static_countries WHERE cn_iso_3 = static_info_country |
||
| 43 | ) WHERE LENGTH(static_info_country) = 3'; |
||
| 44 | |||
| 45 | $this->execute( $stmt, 'db-customer' ); |
||
| 46 | $this->status( 'done' ); |
||
| 47 | } |
||
| 48 | else |
||
| 49 | { |
||
| 50 | $this->status( 'OK' ); |
||
| 51 | } |
||
| 54 |