Skip to content

Commit 22fcd7a

Browse files
blued-gearBentiGorlich
authored andcommitted
use 'JSONB' type as the option 'jsonb' is deprecated
1 parent 34d6a19 commit 22fcd7a

File tree

8 files changed

+19
-11
lines changed

8 files changed

+19
-11
lines changed

src/Entity/ApActivity.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use App\Entity\Traits\CreatedAtTrait;
88
use App\Repository\ApActivityRepository;
9+
use Doctrine\DBAL\Types\Types;
910
use Doctrine\ORM\Mapping\Column;
1011
use Doctrine\ORM\Mapping\Entity;
1112
use Doctrine\ORM\Mapping\GeneratedValue;
@@ -30,7 +31,7 @@ class ApActivity
3031
public int $subjectId;
3132
#[Column(type: 'string', nullable: false)]
3233
public string $type;
33-
#[Column(type: 'json', nullable: true, options: ['jsonb' => true])]
34+
#[Column(type: Types::JSONB, nullable: true)]
3435
public string $body;
3536
#[Id]
3637
#[GeneratedValue]

src/Entity/Entry.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use Doctrine\Common\Collections\ArrayCollection;
2424
use Doctrine\Common\Collections\Collection;
2525
use Doctrine\Common\Collections\Criteria;
26+
use Doctrine\DBAL\Types\Types;
2627
use Doctrine\ORM\Mapping\Column;
2728
use Doctrine\ORM\Mapping\Entity;
2829
use Doctrine\ORM\Mapping\GeneratedValue;
@@ -112,7 +113,7 @@ class Entry implements VotableInterface, CommentInterface, DomainInterface, Visi
112113
public ?\DateTime $lastActive = null;
113114
#[Column(type: 'string', nullable: true)]
114115
public ?string $ip = null;
115-
#[Column(type: 'json', nullable: true, options: ['jsonb' => true])]
116+
#[Column(type: Types::JSONB, nullable: true)]
116117
public ?array $mentions = null;
117118
#[OneToMany(mappedBy: 'entry', targetEntity: EntryComment::class, cascade: ['persist', 'remove'], fetch: 'EXTRA_LAZY', orphanRemoval: true)]
118119
public Collection $comments;

src/Entity/Magazine.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Doctrine\Common\Collections\ArrayCollection;
1616
use Doctrine\Common\Collections\Collection;
1717
use Doctrine\Common\Collections\Criteria;
18+
use Doctrine\DBAL\Types\Types;
1819
use Doctrine\ORM\Mapping\Column;
1920
use Doctrine\ORM\Mapping\Entity;
2021
use Doctrine\ORM\Mapping\GeneratedValue;
@@ -87,7 +88,7 @@ class Magazine implements VisibilityInterface, ActivityPubActorInterface, ApiRes
8788
public ?\DateTime $lastOriginUpdate = null;
8889
#[Column(type: 'datetimetz', nullable: true)]
8990
public ?\DateTime $markedForDeletionAt = null;
90-
#[Column(type: 'json', nullable: true, options: ['jsonb' => true])]
91+
#[Column(type: Types::JSONB, nullable: true)]
9192
public ?array $tags = null;
9293
#[OneToMany(mappedBy: 'magazine', targetEntity: Moderator::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
9394
public Collection $moderators;

src/Entity/MonitoringQuery.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use App\Entity\Traits\CreatedAtTrait;
88
use App\Entity\Traits\MonitoringPerformanceTrait;
9+
use Doctrine\DBAL\Types\Types;
910
use Doctrine\ORM\Mapping\Column;
1011
use Doctrine\ORM\Mapping\Entity;
1112
use Doctrine\ORM\Mapping\GeneratedValue;
@@ -26,7 +27,7 @@ class MonitoringQuery
2627
#[Column(type: 'integer')]
2728
private int $id;
2829

29-
#[Column(type: 'json', nullable: true, options: ['jsonb' => true])]
30+
#[Column(type: Types::JSONB, nullable: true)]
3031
public ?array $parameters = null;
3132

3233
#[ManyToOne(targetEntity: MonitoringExecutionContext::class, inversedBy: 'queries')]

src/Entity/Post.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Doctrine\Common\Collections\ArrayCollection;
2222
use Doctrine\Common\Collections\Collection;
2323
use Doctrine\Common\Collections\Criteria;
24+
use Doctrine\DBAL\Types\Types;
2425
use Doctrine\ORM\Mapping\Column;
2526
use Doctrine\ORM\Mapping\Entity;
2627
use Doctrine\ORM\Mapping\GeneratedValue;
@@ -82,7 +83,7 @@ class Post implements VotableInterface, CommentInterface, VisibilityInterface, R
8283
public ?\DateTime $lastActive;
8384
#[Column(type: 'string', nullable: true)]
8485
public ?string $ip = null;
85-
#[Column(type: 'json', nullable: true, options: ['jsonb' => true])]
86+
#[Column(type: Types::JSONB, nullable: true)]
8687
public ?array $mentions = null;
8788
#[OneToMany(mappedBy: 'post', targetEntity: PostComment::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
8889
public Collection $comments;

src/Entity/PostComment.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Doctrine\Common\Collections\ArrayCollection;
2222
use Doctrine\Common\Collections\Collection;
2323
use Doctrine\Common\Collections\Criteria;
24+
use Doctrine\DBAL\Types\Types;
2425
use Doctrine\ORM\Mapping\Column;
2526
use Doctrine\ORM\Mapping\Entity;
2627
use Doctrine\ORM\Mapping\GeneratedValue;
@@ -75,7 +76,7 @@ class PostComment implements VotableInterface, VisibilityInterface, ReportInterf
7576
public ?\DateTime $lastActive;
7677
#[Column(type: 'string', nullable: true)]
7778
public ?string $ip = null;
78-
#[Column(type: 'json', nullable: true, options: ['jsonb' => true])]
79+
#[Column(type: Types::JSONB, nullable: true)]
7980
public ?array $mentions = null;
8081
#[Column(type: 'boolean', nullable: false)]
8182
public bool $isAdult = false;

src/Entity/Settings.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace App\Entity;
66

77
use App\Repository\SettingsRepository;
8+
use Doctrine\DBAL\Types\Types;
89
use Doctrine\ORM\Mapping\Cache;
910
use Doctrine\ORM\Mapping\Column;
1011
use Doctrine\ORM\Mapping\Entity;
@@ -19,7 +20,7 @@ class Settings
1920
public string $name;
2021
#[Column(type: 'string', nullable: true)]
2122
public ?string $value = null;
22-
#[Column(type: 'json', nullable: true, options: ['jsonb' => true])]
23+
#[Column(type: Types::JSONB, nullable: true)]
2324
public ?array $json = null;
2425
#[Id]
2526
#[GeneratedValue]

src/Entity/User.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Doctrine\Common\Collections\Collection;
2020
use Doctrine\Common\Collections\Criteria;
2121
use Doctrine\Common\Collections\Order;
22+
use Doctrine\DBAL\Types\Types;
2223
use Doctrine\ORM\Mapping\Column;
2324
use Doctrine\ORM\Mapping\Entity;
2425
use Doctrine\ORM\Mapping\GeneratedValue;
@@ -102,7 +103,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, Visibil
102103
public string $email;
103104
#[Column(type: 'string', unique: true, nullable: false)]
104105
public string $username;
105-
#[Column(type: 'json', nullable: false, options: ['jsonb' => true])]
106+
#[Column(type: Types::JSONB, nullable: false)]
106107
public array $roles = [];
107108
#[Column(type: 'integer', nullable: false)]
108109
public int $followersCount = 0;
@@ -122,7 +123,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, Visibil
122123
public ?\DateTime $lastActive = null;
123124
#[Column(type: 'datetimetz', nullable: true)]
124125
public ?\DateTime $markedForDeletionAt = null;
125-
#[Column(type: 'json', nullable: true, options: ['jsonb' => true])]
126+
#[Column(type: Types::JSONB, nullable: true)]
126127
public ?array $fields = null;
127128
#[Column(type: 'string', nullable: true)]
128129
public ?string $oauthAzureId = null;
@@ -146,7 +147,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, Visibil
146147
public ?string $oauthAuthentikId = null;
147148
#[Column(type: 'boolean', nullable: false, options: ['default' => true])]
148149
public bool $hideAdult = true;
149-
#[Column(type: 'json', nullable: false, options: ['jsonb' => true, 'default' => '[]'])]
150+
#[Column(type: Types::JSONB, nullable: false, options: ['default' => '[]'])]
150151
public array $preferredLanguages = [];
151152
#[Column(type: 'array', nullable: true)]
152153
public ?array $featuredMagazines = null;
@@ -252,7 +253,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface, Visibil
252253
private string $password;
253254
#[Column(type: 'string', nullable: true)]
254255
private ?string $totpSecret = null;
255-
#[Column(type: 'json', nullable: false, options: ['jsonb' => true, 'default' => '[]'])]
256+
#[Column(type: Types::JSONB, nullable: false, options: ['default' => '[]'])]
256257
private array $totpBackupCodes = [];
257258
#[OneToMany(mappedBy: 'user', targetEntity: OAuth2UserConsent::class, orphanRemoval: true)]
258259
private Collection $oAuth2UserConsents;

0 commit comments

Comments
 (0)