Просмотр файла app/database/migrations/20161216115501_create_bank_table.php

Размер файла: 595B
  1. <?php
  2.  
  3. use Phinx\Migration\AbstractMigration;
  4.  
  5. class CreateBankTable extends AbstractMigration
  6. {
  7. /**
  8. * Migrate Change.
  9. */
  10. public function change()
  11. {
  12. $table = $this->table('bank', ['collation' => 'utf8mb4_unicode_ci']);
  13. $table->addColumn('user', 'string', ['limit' => 20])
  14. ->addColumn('sum', 'integer', ['signed' => false, 'default' => 0])
  15. ->addColumn('oper', 'integer', ['signed' => false, 'default' => 0])
  16. ->addColumn('time', 'integer')
  17. ->addIndex('user', ['unique' => true])
  18. ->create();
  19. }
  20. }