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

Размер файла: 827B
  1. <?php
  2.  
  3. use Phinx\Migration\AbstractMigration;
  4. use Phinx\Db\Adapter\MysqlAdapter;
  5.  
  6. class CreateErrorTable extends AbstractMigration
  7. {
  8. /**
  9. * Change Method.
  10. */
  11. public function change()
  12. {
  13. $table = $this->table('error', ['collation' => 'utf8mb4_unicode_ci']);
  14. $table->addColumn('num', 'integer', ['limit' => MysqlAdapter::INT_SMALL])
  15. ->addColumn('request', 'string', ['null' => true])
  16. ->addColumn('referer', 'string', ['null' => true])
  17. ->addColumn('username', 'string', ['limit' => 20, 'null' => true])
  18. ->addColumn('ip', 'string', ['limit' => 15])
  19. ->addColumn('brow', 'string', ['limit' => 25])
  20. ->addColumn('time', 'integer')
  21. ->addIndex(['num', 'time'], ['name' => 'num_time'])
  22. ->create();
  23. }
  24. }