From 79eb27f4857acd7f6bfa42a99c794db7e77459cd Mon Sep 17 00:00:00 2001 From: Michal Lulco Date: Mon, 16 Jan 2023 23:31:05 +0100 Subject: [PATCH] Unsigned int mysql 8 (#13) --- src/Database/Database.php | 2 +- tests/Behavior/CreateStructureBehavior.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Database/Database.php b/src/Database/Database.php index 13fce48..0b5bb17 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -174,7 +174,7 @@ private function getColumnSettings(array $column): array private function getType(array $column): string { - $type = strtolower($column['nativetype']); + $type = explode(' ', strtolower($column['nativetype']))[0]; $types = [ 'bool' => 'boolean', 'int' => 'integer', diff --git a/tests/Behavior/CreateStructureBehavior.php b/tests/Behavior/CreateStructureBehavior.php index 86767c8..5efb050 100644 --- a/tests/Behavior/CreateStructureBehavior.php +++ b/tests/Behavior/CreateStructureBehavior.php @@ -40,7 +40,7 @@ protected function createSimpleTable(): void ->addColumn('created_at', 'datetime') ->addColumn('title', 'string') ->addColumn('type', 'string', ['null' => true, 'default' => 'type1']) - ->addColumn('sorting', 'integer', ['null' => true, 'length' => 10]) + ->addColumn('sorting', 'integer', ['null' => true, 'length' => 10, 'signed' => false]) ->addColumn('price', 'double', ['length' => 10, 'decimals' => 2]) ; $migrationTable->create();