20220109130532_create_stream_media_table.php 872 B

123456789101112131415161718192021222324252627
  1. <?php
  2. declare(strict_types=1);
  3. use Phinx\Migration\AbstractMigration;
  4. final class CreateStreamMediaTable extends AbstractMigration
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. *
  11. * More information on writing migrations is available here:
  12. * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
  13. *
  14. * Remember to call "create()" or "update()" and NOT "save()" when working
  15. * with the Table class.
  16. */
  17. public function change(): void
  18. {
  19. $table = $this->table('stream_media');
  20. $table->addColumn('node_id', 'integer', array('comment' => '节点id'))
  21. ->addColumn('result', 'text', array('comment' => '检测结果'))
  22. ->addColumn('created_at', 'integer', array('comment' => '创建时间'))
  23. ->create();
  24. }
  25. }