File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace DoctrineMigrations ;
6+
7+ use Doctrine \DBAL \Schema \Schema ;
8+ use Doctrine \Migrations \AbstractMigration ;
9+
10+ final class Version20250715195941 extends AbstractMigration
11+ {
12+ public function getDescription (): string
13+ {
14+ return 'Add last modified columns ' ;
15+ }
16+
17+ public function up (Schema $ schema ): void
18+ {
19+ $ this ->addSql (<<<'SQL'
20+ ALTER TABLE access_token ADD last_modified_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL
21+ SQL);
22+ }
23+
24+ public function down (Schema $ schema ): void
25+ {
26+ $ this ->addSql (<<<'SQL'
27+ ALTER TABLE access_token DROP last_modified_at
28+ SQL);
29+ }
30+ }
Original file line number Diff line number Diff line change 66use Doctrine \ORM \Mapping as ORM ;
77
88#[ORM \Entity(repositoryClass: AccessTokenRepository::class)]
9- class AccessToken
9+ class AccessToken extends TrackedEntity
1010{
1111 #[ORM \Column]
1212 #[ORM \GeneratedValue]
@@ -22,17 +22,13 @@ class AccessToken
2222 #[ORM \Column]
2323 private ?string $ token = null ;
2424
25- #[ORM \Column]
26- private readonly \DateTimeImmutable $ createdAt ;
27-
2825 #[ORM \Column(nullable: true )]
2926 private ?\DateTimeImmutable $ expiresAt = null ;
3027
3128 private ?string $ plainToken = null ;
3229
3330 public function __construct ()
3431 {
35- $ this ->createdAt = new \DateTimeImmutable ();
3632 $ this ->plainToken = uniqid ('dirigent- ' );
3733 }
3834
You can’t perform that action at this time.
0 commit comments