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

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