Advertisement
Sdelkadrom

Untitled

Jan 21st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. use Phinx\Migration\AbstractMigration;
  5.  
  6. class TableApartmentDocument extends AbstractMigration
  7. {
  8.  
  9. public function up()
  10. {
  11. $table = $this->table('ore_nf_apartment_document');
  12.  
  13. $table->addIndex(
  14. [
  15. 'type'
  16. ],
  17. [
  18. 'name' => 'type'
  19. ]
  20. );
  21.  
  22. $table->save();
  23. }
  24.  
  25. public function down()
  26. {
  27. $table = $this->table('ore_nf_apartment_document');
  28.  
  29. $table->removeIndexByName('type');
  30.  
  31. $table->save();
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement