20220329082210_user.php 862 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. declare(strict_types=1);
  3. use Phinx\Migration\AbstractMigration;
  4. final class User 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('users');
  20. $table->addColumn('username', 'string', ['limit'=>64])
  21. ->addColumn('password', 'string', ['limit'=>64])
  22. ->addColumn('created', 'datetime')
  23. ->create();
  24. }
  25. public function up(): void
  26. {
  27. }
  28. public function down(): void
  29. {
  30. }
  31. }