[PR #973] [CLOSED] Added index flags support in annotation, xml & yaml mapping drivers. #8986

Open
opened 2026-01-22 16:02:38 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/973
Author: @adrianolek
Created: 3/6/2014
Status: Closed

Base: masterHead: index-flags


📝 Commits (5)

  • 0368e64 Added index flags support in annotation, xml & yaml mapping drivers.
  • 6271f60 CS fixes
  • 6fbe944 Added index flags test
  • 78a8b0c Added Comment entity mapping for StaticPHPDriver test
  • 369694a cs fixes

📊 Changes

10 files changed (+145 additions, -21 deletions)

View changed files

📝 doctrine-mapping.xsd (+1 -0)
📝 lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php (+7 -1)
📝 lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php (+14 -10)
📝 lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php (+20 -9)
📝 lib/Doctrine/ORM/Mapping/Index.php (+5 -0)
📝 lib/Doctrine/ORM/Tools/SchemaTool.php (+5 -1)
📝 tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php (+45 -0)
tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Comment.php (+21 -0)
tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Comment.dcm.xml (+18 -0)
tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.Comment.dcm.yml (+9 -0)

📄 Description

It allows specifying eg. fulltext index for MysqlPlatform (the platform already supports it - https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L714 , but it couldn't be used in annotations/xml/yaml/php schemas). And also other platforms use flags for indexes (virtual, clustered etc.).

So now flags can be used like:

/**
 * @Table(...,indexes={@Index(columns={"description"},flags={"fulltext"})})
 */
class Foo
{ ... }
...
    <indexes>
      <index name="0" columns="description" flags="fulltext"/>
    </indexes>
...
Foo:
  ...
  indexes:
    -
      columns: [ description ]
      flags: [ fulltext ]
$metadata->setPrimaryTable(array(
   ...
   'indexes' => array(
       array(
          'columns' => array('description'),
          'flags' => array('fulltext'),
       )
   ),
   ...
));

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/973 **Author:** [@adrianolek](https://github.com/adrianolek) **Created:** 3/6/2014 **Status:** ❌ Closed **Base:** `master` ← **Head:** `index-flags` --- ### 📝 Commits (5) - [`0368e64`](https://github.com/doctrine/orm/commit/0368e6474ed15133a597d5e7882588d16fa4da3d) Added index flags support in annotation, xml & yaml mapping drivers. - [`6271f60`](https://github.com/doctrine/orm/commit/6271f6056ed5cc19b5416a43f7d10df28ab51a88) CS fixes - [`6fbe944`](https://github.com/doctrine/orm/commit/6fbe9443d02835a897d2a4b9ec69106bd547f777) Added index flags test - [`78a8b0c`](https://github.com/doctrine/orm/commit/78a8b0c386d374bab705005b2c40725adca8e2b3) Added Comment entity mapping for StaticPHPDriver test - [`369694a`](https://github.com/doctrine/orm/commit/369694a4d49b1f47a55f59ef6b71e7ca7e3bf522) cs fixes ### 📊 Changes **10 files changed** (+145 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `doctrine-mapping.xsd` (+1 -0) 📝 `lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php` (+7 -1) 📝 `lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php` (+14 -10) 📝 `lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php` (+20 -9) 📝 `lib/Doctrine/ORM/Mapping/Index.php` (+5 -0) 📝 `lib/Doctrine/ORM/Tools/SchemaTool.php` (+5 -1) 📝 `tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php` (+45 -0) ➕ `tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Comment.php` (+21 -0) ➕ `tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.Comment.dcm.xml` (+18 -0) ➕ `tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.Comment.dcm.yml` (+9 -0) </details> ### 📄 Description It allows specifying eg. fulltext index for MysqlPlatform (the platform already supports it - https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L714 , but it couldn't be used in annotations/xml/yaml/php schemas). And also other platforms use flags for indexes (virtual, clustered etc.). So now flags can be used like: ``` php /** * @Table(...,indexes={@Index(columns={"description"},flags={"fulltext"})}) */ class Foo { ... } ``` ``` xml ... <indexes> <index name="0" columns="description" flags="fulltext"/> </indexes> ... ``` ``` yml Foo: ... indexes: - columns: [ description ] flags: [ fulltext ] ``` ``` php $metadata->setPrimaryTable(array( ... 'indexes' => array( array( 'columns' => array('description'), 'flags' => array('fulltext'), ) ), ... )); ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 16:02:38 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#8986