Advertisement
Sdelkadrom

Untitled

Feb 25th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2.  
  3. use Phinx\Migration\AbstractMigration;
  4.  
  5. class AnonseArticles extends AbstractMigration
  6. {
  7. public function up()
  8. {
  9. $table = $this->table('articles');
  10.  
  11. $table->addColumn('announce_ru', 'text', ['default' => null]);
  12. $table->addColumn('announce_en', 'text', ['default' => null]);
  13. $table->addColumn('announce_de', 'text', ['default' => null]);
  14. $table->addColumn('announce_es', 'text', ['default' => null]);
  15. $table->addColumn('announce_ar', 'text', ['default' => null]);
  16.  
  17. $table->save();
  18. }
  19.  
  20. public function down()
  21. {
  22. $table = $this->table('articles');
  23. $table->removeColumn('announce_ru');
  24. $table->removeColumn('announce_en');
  25. $table->removeColumn('announce_de');
  26. $table->removeColumn('announce_es');
  27. $table->removeColumn('announce_ar');
  28. $table->save();
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement