You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
986B

  1. <?php
  2. declare(strict_types=1);
  3. use Migrations\BaseMigration;
  4. class CreateTerritories extends BaseMigration
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * More information on this method is available here:
  10. * https://book.cakephp.org/migrations/5/guides/writing-migrations/migration-methods.html#the-change-method
  11. *
  12. * @return void
  13. */
  14. public function change(): void
  15. {
  16. $table = $this->table('territories');
  17. $table->addColumn('name', 'string', [
  18. 'default' => null,
  19. 'limit' => 255,
  20. 'null' => false,
  21. ]);
  22. $table->addColumn('polygon', 'json', [
  23. 'default' => null,
  24. 'null' => false,
  25. ]);
  26. $table->addColumn('created', 'datetime', [
  27. 'default' => null,
  28. 'null' => false,
  29. ]);
  30. $table->addColumn('modified', 'datetime', [
  31. 'default' => null,
  32. 'null' => false,
  33. ]);
  34. $table->create();
  35. }
  36. }

Powered by TurnKey Linux.