Skip to content

Commit bd587ae

Browse files
committed
Merge pull request #172 from patrickli/index-on-tables
Mark token fields as unique in configuration
2 parents 64254d4 + cf8d5bc commit bd587ae

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

Resources/config/doctrine/AccessToken.orm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
66

77
<mapped-superclass name="FOS\OAuthServerBundle\Entity\AccessToken">
8-
<field name="token" column="token" type="string" />
8+
<field name="token" column="token" type="string" unique="true" />
99
<field name="expiresAt" column="expires_at" type="integer" nullable="true" />
1010
<field name="scope" column="scope" type="string" nullable="true" />
1111
</mapped-superclass>

Resources/config/doctrine/AuthCode.orm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
66

77
<mapped-superclass name="FOS\OAuthServerBundle\Entity\AuthCode">
8-
<field name="token" column="token" type="string" />
8+
<field name="token" column="token" type="string" unique="true" />
99
<field name="redirectUri" column="redirect_uri" type="text" />
1010
<field name="expiresAt" column="expires_at" type="integer" nullable="true" />
1111
<field name="scope" column="scope" type="string" nullable="true" />

Resources/config/doctrine/RefreshToken.orm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
66

77
<mapped-superclass name="FOS\OAuthServerBundle\Entity\RefreshToken">
8-
<field name="token" column="token" type="string" />
8+
<field name="token" column="token" type="string" unique="true" />
99
<field name="expiresAt" column="expires_at" type="integer" nullable="true" />
1010
<field name="scope" column="scope" type="string" nullable="true" />
1111
</mapped-superclass>

Resources/doc/index.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ use Doctrine\ORM\Mapping as ORM;
140140

141141
/**
142142
* @ORM\Entity
143-
* @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(columns={"token"})})
144143
*/
145144
class AccessToken extends BaseAccessToken
146145
{
@@ -175,7 +174,6 @@ use Doctrine\ORM\Mapping as ORM;
175174

176175
/**
177176
* @ORM\Entity
178-
* @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(columns={"token"})})
179177
*/
180178
class RefreshToken extends BaseRefreshToken
181179
{
@@ -210,7 +208,6 @@ use Doctrine\ORM\Mapping as ORM;
210208

211209
/**
212210
* @ORM\Entity
213-
* @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(columns={"token"})})
214211
*/
215212
class AuthCode extends BaseAuthCode
216213
{

0 commit comments

Comments
 (0)