ValidateUsersTable.php 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. declare(strict_types=1);
  3. namespace TestApp\Model\Table;
  4. use Cake\ORM\Table;
  5. class ValidateUsersTable extends Table
  6. {
  7. /**
  8. * Initializes the schema
  9. *
  10. * @param array $config
  11. */
  12. public function initialize(array $config): void
  13. {
  14. $this->setSchema([
  15. 'id' => ['type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'],
  16. 'name' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'],
  17. 'email' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'],
  18. 'balance' => ['type' => 'float', 'null' => false, 'length' => 5, 'precision' => 2],
  19. 'cost_decimal' => ['type' => 'decimal', 'null' => false, 'length' => 6, 'precision' => 3],
  20. 'null_decimal' => ['type' => 'decimal', 'null' => false, 'length' => null, 'precision' => null],
  21. 'ratio' => ['type' => 'decimal', 'null' => false, 'length' => 10, 'precision' => 6],
  22. 'population' => ['type' => 'decimal', 'null' => false, 'length' => 15, 'precision' => 0],
  23. 'created' => ['type' => 'date', 'null' => '1', 'default' => '', 'length' => ''],
  24. 'updated' => ['type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null],
  25. '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
  26. ]);
  27. }
  28. }