-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
Bug Report
| Q | A |
|---|---|
| BC Break | no |
| Version | 2.6.2 |
Summary
Documentation should be updated, I think it's outdated.
Current behavior
- Class "Doctrine\ORM\Annotation" is not exist.
- Annotation classes (ORM\Entity) and (ORM\Table) is defined incorrectly, hence annotations are not being parsed.
When annotation parser tries to parse the entity annotations, it does not, since the classes (@Orm\Entity), (@Orm\Table), (@Orm\Id), (@Orm\Column) and (@Orm\GeneratedValue) are not defined.
How to reproduce
Follow the steps described in the documentation:
https://www.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html#what-is-doctrine
- Install doctrine via composer v2.6.2
- Create entity src/Product.php
- Run the command
vendor/bin/doctrine orm:schema-tool:update --force --dump-sql - The result is
[OK] No Metadata Classes to process.
Expected behavior
The following SQL statements will be executed:
CREATE TABLE products (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL);
Updating database schema...
1 query was executed
Fix
- No need to import the annotation class
- Writing annotations as
@Entityinstead of@ORM\Entity
Reactions are currently unavailable