From df3108e61b5cea0e5d1de3d9e2182bc8e5009c92 Mon Sep 17 00:00:00 2001 From: Alexandre Quercia Date: Fri, 12 Apr 2024 22:54:39 +0200 Subject: [PATCH] fix(Table): support for index declared with single field as string --- .../IndexesUsingSingleFieldStringTestCase.php | 27 +++++++++++++++++++ tests/run.php | 1 + 2 files changed, 28 insertions(+) create mode 100644 tests/Table/IndexesUsingSingleFieldStringTestCase.php diff --git a/tests/Table/IndexesUsingSingleFieldStringTestCase.php b/tests/Table/IndexesUsingSingleFieldStringTestCase.php new file mode 100644 index 000000000..1c4261dc8 --- /dev/null +++ b/tests/Table/IndexesUsingSingleFieldStringTestCase.php @@ -0,0 +1,27 @@ +tables = array('IndexDeclaredWithSingleFieldStringRecord'); + + parent::prepareTables(); + } + + public function testSupportIndexesUsingSingleFieldString() + { + } +} + +class IndexDeclaredWithSingleFieldStringRecord extends Doctrine_Record +{ + public function setTableDefinition() + { + $this->hasColumn('some_column_name', 'string', 255); + + $this->index('single_field_index_as_string', array( + 'fields' => 'some_column_name', + )); + } +} diff --git a/tests/run.php b/tests/run.php index d1dd2c7ee..16fe619fa 100644 --- a/tests/run.php +++ b/tests/run.php @@ -140,6 +140,7 @@ $core->addTestCase(new Doctrine_Table_TestCase()); $core->addTestCase(new Doctrine_Table_RemoveColumn_TestCase()); $core->addTestCase(new Doctrine_Table_NamedQuery_TestCase()); +$core->addTestCase(new Doctrine_Table_IndexesUsingSingleFieldString_TestCase()); $core->addTestCase(new Doctrine_UnitOfWork_TestCase()); $core->addTestCase(new Doctrine_Collection_TestCase()); $core->addTestCase(new Doctrine_Collection_Snapshot_TestCase());