Feature #29547

@identity should make property unique in Database

Added by Torsten over 1 year ago. Updated about 1 year ago.

Status:Resolved Start date:2012-04-30
Priority:Should have Due date:
Assignee:Christian Mueller % Done:

100%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 1.1
PHP Version: Complexity:
Has patch:No
Votes: 3 (View)

Description

A Property with the @indentify annotation is currently not unique in the database.

So you could for example add 2 accounts with the same accountIdentifier. That shouldn't work.


Subtasks

Bug #36717: Remove Identity from ResourceResolvedChristian Mueller


Related issues

related to TYPO3.Flow - Feature #30933: Check for unique constraints on add() Needs Feedback 2011-10-14
related to TYPO3.Party - Bug #37266: Duplicate email address throws exception Resolved 2012-05-17
related to TYPO3.Flow - Bug #9557: It's possible to persist multiple entities with the same ... Rejected 2010-09-01
related to TYPO3.Flow - Bug #32823: Make combination of Account identifier and authentication... Resolved 2011-12-23

Associated revisions

Revision b0fb449c
Added by Christian Mueller about 1 year ago

[FEATURE] Identity annotation should make properties unique

With this change all properties annotated with the Identity
annotation will be added to an unique constraint in the database.

Change-Id: Ief9455e10c58f999cf46e0586e632ff3e2ef9ad5
Resolves: #29547
Releases: 1.1

Revision a788b292
Added by Karsten Dambekalns about 1 year ago

[TASK] Fix schema migrations adding useless unique indexes

This change removes the index creation commands on the Role table from
the migrations supplied with Ief9455e10c58f999cf46e0586e632ff3e2ef9ad5,
as the involved field is the primary key (and thus a unique index) anyway.

Change-Id: I7280a5f5265109cea8ef110c399c5b76563c4b03
Related: #29547

History

Updated by Karsten Dambekalns over 1 year ago

  • Project changed from TYPO3 Flow Base Distribution to TYPO3.Flow

Updated by Karsten Dambekalns over 1 year ago

  • Category set to Persistence

Updated by Karsten Dambekalns over 1 year ago

  • Assignee set to Karsten Dambekalns

Updated by Christian Mueller about 1 year ago

  • Status changed from New to Accepted
  • Assignee changed from Karsten Dambekalns to Christian Mueller
  • Has patch set to No

Updated by Gerrit Code Review about 1 year ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Adrian Föder about 1 year ago

User Kirab mentioned there were "problems with Resource system"; I assume it's the problem that duplicate \TYPO3\FLOW3\Resource\Resource records may occur, the identities are the following:

 1     /**
 2      * @var \TYPO3\FLOW3\Resource\ResourcePointer
 3      * @ORM\ManyToOne
 4      * @FLOW3\Identity
 5      */
 6     protected $resourcePointer;
 7 
 8     /**
 9      * @var string
10      * @FLOW3\Validate(type="StringLength", options={ "maximum"=100 })
11      * @FLOW3\Identity
12      */
13     protected $filename = '';
14 
15     /**
16      * @var string
17      * @FLOW3\Validate(type="StringLength", options={ "maximum"=100 })
18      * @FLOW3\Identity
19      */
20     protected $fileExtension = '';

If you upload the exact same file with the same filename, a violation will occur because the same key emerges.
(the ResourcePointer, on the other hand, is intended to be there only once for the same file (content => SHA1).

I would even say the same goes for a Resource: if a Resource has the same filename, extension and ResourcePointer, it is the exact same file and no need for an additional recordset...

If not, or if there should me multiple recordsets for a same file (e.g. for separating ownership etc), the identity must then be a UUID, like usual. I can't see anything more that intrinsically makes a file representation unique than the name, the content and the extension...

Updated by Gerrit Code Review about 1 year ago

Patch set 4 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 5 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 6 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Karsten Dambekalns about 1 year ago

  • Target version set to 1.1

The full stack of changes can be found at https://review.typo3.org/#/q/topic:29547-unique-identity,n,z

Updated by Gerrit Code Review about 1 year ago

Patch set 7 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 8 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 9 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 10 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 11 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 12 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 13 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 14 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 15 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Gerrit Code Review about 1 year ago

Patch set 16 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9647

Updated by Christian Mueller about 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF