| Total Complexity | 7 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class update_cms_301 extends Migration implements MigrationInterface |
||
|
|
|||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Add database changes, provided in time between 3.0.0 and 3.0.1 release is done |
||
| 13 | * @return void |
||
| 14 | */ |
||
| 15 | public function up() |
||
| 16 | { |
||
| 17 | // use important column for content app |
||
| 18 | if (!$this->getSchema()->hasColumn('contents', 'important')) { |
||
| 19 | $this->getSchema()->table('contents', function ($table) { |
||
| 20 | $table->boolean('important')->default(false); |
||
| 21 | }); |
||
| 22 | } |
||
| 23 | // add group display color features |
||
| 24 | if (!$this->getSchema()->hasColumn('roles', 'color')) { |
||
| 25 | $this->getSchema()->table('roles', function ($table) { |
||
| 26 | $table->string('color')->default('#777777'); |
||
| 27 | }); |
||
| 28 | } |
||
| 29 | |||
| 30 | parent::up(); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Seed created table via up() method with some data |
||
| 35 | * @return void |
||
| 36 | */ |
||
| 37 | public function seed() |
||
| 39 | |||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Execute actions when migration is down |
||
| 44 | * @return void |
||
| 45 | */ |
||
| 46 | public function down() |
||
| 59 | } |
||
| 60 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.