| Conditions | 8 |
| Paths | 5 |
| Total Lines | 24 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function up() |
||
| 21 | { |
||
| 22 | $db = $this->db( 'db-locale' ); |
||
| 23 | |||
| 24 | if( !$db->hasTable( 'mshop_locale' ) ) { |
||
| 25 | return; |
||
| 26 | } |
||
| 27 | |||
| 28 | $this->info( 'Remove mshop_locale char constraints' , 'v' ); |
||
| 29 | |||
| 30 | if( $db->hasForeign( 'mshop_locale', 'fk_msloc_langid' ) |
||
| 31 | && $db->hasColumn( 'mshop_locale', 'langid' ) |
||
| 32 | && $db->table( 'mshop_locale' )->col( 'langid', 'string' )->fixed() |
||
| 33 | ) { |
||
| 34 | $this->info( 'Checking constraint for "langid"', 'v', 1 ); |
||
| 35 | $db->dropForeign( 'mshop_locale', 'fk_msloc_langid' ); |
||
| 36 | } |
||
| 37 | |||
| 38 | if( $db->hasForeign( 'mshop_locale', 'fk_msloc_currid' ) |
||
| 39 | && $db->hasColumn( 'mshop_locale', 'currencyid' ) |
||
| 40 | && $db->table( 'mshop_locale' )->col( 'currencyid', 'string' )->fixed() |
||
| 41 | ) { |
||
| 42 | $this->info( 'Checking constraint for "currencyid"', 'v', 1 ); |
||
| 43 | $db->dropForeign( 'mshop_locale', 'fk_msloc_currid' ); |
||
| 44 | } |
||
| 47 |