diff --git a/docs/book/sql-ddl.md b/docs/book/sql-ddl.md index 7aa64503..4ea69839 100644 --- a/docs/book/sql-ddl.md +++ b/docs/book/sql-ddl.md @@ -171,12 +171,15 @@ Column (generic) | `$name = null` Date | `$name` DateTime | `$name` Decimal | `$name`, `$precision`, `$scale = null` +Double | `$name`, `$digits`, `$decimal` Float | `$name`, `$digits`, `$decimal` (Note: this class is deprecated as of 2.4.0; use Floating instead) Floating | `$name`, `$digits`, `$decimal` Integer | `$name`, `$nullable = false`, `default = null`, `array $options = array()` +SmallInteger | `$name`, `$nullable = false`, `$default = null`, `array $options = array()` Text | `$name`, `$length`, `nullable = false`, `$default = null`, `array $options = array()` Time | `$name` Timestamp | `$name` +TinyInteger | `$name`, `$nullable = false`, `$default = null`, `array $options = array()` Varbinary | `$name`, `$length` Varchar | `$name`, `$length` diff --git a/src/Sql/Ddl/Column/Double.php b/src/Sql/Ddl/Column/Double.php new file mode 100644 index 00000000..871181d0 --- /dev/null +++ b/src/Sql/Ddl/Column/Double.php @@ -0,0 +1,14 @@ +getExpressionData() + ); + } +} diff --git a/test/unit/Sql/Ddl/Column/SmallIntegerTest.php b/test/unit/Sql/Ddl/Column/SmallIntegerTest.php new file mode 100644 index 00000000..fbaa4186 --- /dev/null +++ b/test/unit/Sql/Ddl/Column/SmallIntegerTest.php @@ -0,0 +1,30 @@ +getName()); + } + + /** + * @covers \Laminas\Db\Sql\Ddl\Column\Column::getExpressionData + */ + public function testGetExpressionData() + { + $column = new SmallInteger('foo'); + self::assertEquals( + [['%s %s NOT NULL', ['foo', 'SMALLINT'], [$column::TYPE_IDENTIFIER, $column::TYPE_LITERAL]]], + $column->getExpressionData() + ); + } +} diff --git a/test/unit/Sql/Ddl/Column/TinyIntegerTest.php b/test/unit/Sql/Ddl/Column/TinyIntegerTest.php new file mode 100644 index 00000000..b80cd354 --- /dev/null +++ b/test/unit/Sql/Ddl/Column/TinyIntegerTest.php @@ -0,0 +1,30 @@ +getName()); + } + + /** + * @covers \Laminas\Db\Sql\Ddl\Column\Column::getExpressionData + */ + public function testGetExpressionData() + { + $column = new TinyInteger('foo'); + self::assertEquals( + [['%s %s NOT NULL', ['foo', 'TINYINT'], [$column::TYPE_IDENTIFIER, $column::TYPE_LITERAL]]], + $column->getExpressionData() + ); + } +}