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

Размер файла: 730B
  1. <?php
  2.  
  3. use Phinx\Migration\AbstractMigration;
  4.  
  5. class CreateChatTable extends AbstractMigration
  6. {
  7. /**
  8. * Change Method.
  9. */
  10. public function change()
  11. {
  12. $table = $this->table('chat', ['collation' => 'utf8mb4_unicode_ci']);
  13. $table->addColumn('user', 'string', ['limit' => 20])
  14. ->addColumn('text', 'text', ['null' => true])
  15. ->addColumn('ip', 'string', ['limit' => 15])
  16. ->addColumn('brow', 'string', ['limit' => 25])
  17. ->addColumn('time', 'integer')
  18. ->addColumn('edit', 'string', ['limit' => 20, 'null' => true])
  19. ->addColumn('edit_time', 'integer', ['default' => 0])
  20. ->addIndex('time')
  21. ->create();
  22. }
  23. }