|
- <?php
- declare(strict_types=1);
-
- use Migrations\BaseMigration;
-
- class CreateTerritories extends BaseMigration
- {
- /**
- * Change Method.
- *
- * More information on this method is available here:
- * https://book.cakephp.org/migrations/5/guides/writing-migrations/migration-methods.html#the-change-method
- *
- * @return void
- */
- public function change(): void
- {
- $table = $this->table('territories');
- $table->addColumn('name', 'string', [
- 'default' => null,
- 'limit' => 255,
- 'null' => false,
- ]);
- $table->addColumn('polygon', 'json', [
- 'default' => null,
- 'null' => false,
- ]);
- $table->addColumn('created', 'datetime', [
- 'default' => null,
- 'null' => false,
- ]);
- $table->addColumn('modified', 'datetime', [
- 'default' => null,
- 'null' => false,
- ]);
- $table->create();
- }
- }
|