Advertisement
Sdelkadrom

Untitled

Jan 20th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. use Phinx\Migration\AbstractMigration;
  5.  
  6. class TableComments extends AbstractMigration
  7. {
  8.  
  9. public function up()
  10. {
  11. $table = $this->table('ore_nf_comments');
  12.  
  13. $table->changeColumn(
  14. 'rating',
  15. 'integer',
  16. [
  17. 'signed' => false,
  18. 'default' => '0',
  19. 'null' => false,
  20. 'limit' => MysqlAdapter::INT_TINY
  21. ]
  22. );
  23. $table->save();
  24. }
  25.  
  26. public function down()
  27. {
  28. $table = $this->table('ore_nf_comments');
  29.  
  30. $table->changeColumn(
  31. 'rating',
  32. 'integer',
  33. [
  34. 'signed' => true,
  35. 'default' => '0',
  36. 'null' => false,
  37. 'limit' => MysqlAdapter::INT_TINY
  38.  
  39. ]
  40. );
  41.  
  42. $table->save();
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement