Skip to content

Commit e03e748

Browse files
committed
fix: telescope entities should be same as native migrations
1 parent 0bfbedb commit e03e748

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

src/Bridge/Telescope/Entities/TelescopeEntryTags.php renamed to src/Bridge/Telescope/Entities/TelescopeEntriesTags.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99
use Cycle\Annotated\Annotation\ForeignKey;
1010
use Cycle\Annotated\Annotation\Table\Index;
1111

12-
#[Index(columns: ['entry_uuid', 'tag'])]
12+
#[Index(columns: ['entry_uuid', 'tag'], unique: true)]
1313
#[Index(columns: ['tag'])]
1414
#[ForeignKey(target: TelescopeEntry::class, innerKey: 'entry_uuid', outerKey: 'uuid', action: 'CASCADE')]
15-
#[Entity(table: 'telescope_entry_tags')]
16-
class TelescopeEntryTags
15+
#[Entity(table: 'telescope_entries_tags')]
16+
class TelescopeEntriesTags
1717
{
18-
#[Column(type: 'uuid', primary: true)]
18+
#[Column(type: 'primary')]
19+
public int $id;
20+
21+
#[Column(type: 'uuid')]
1922
public string $entryUuid;
2023

2124
#[Column(type: 'string')]

src/Bridge/Telescope/Entities/TelescopeEntry.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@
66

77
use Cycle\Annotated\Annotation\Column;
88
use Cycle\Annotated\Annotation\Entity;
9+
use Cycle\Annotated\Annotation\ForeignKey;
910
use Cycle\Annotated\Annotation\Table\Index;
1011
use DateTimeImmutable;
1112

12-
#[Index(columns: ['batch_id'])]
13-
#[Index(columns: ['family_hash'])]
14-
#[Index(columns: ['created_at'])]
15-
#[Index(columns: ['type', 'should_display_on_index'])]
13+
#[Index(columns: ['uuid'], unique: true, name: 'telescope_entries_uuid_unique')]
14+
#[Index(columns: ['batch_id'], name: 'telescope_entries_batch_id_index')]
15+
#[Index(columns: ['family_hash'], name: 'telescope_entries_family_hash_index')]
16+
#[Index(columns: ['created_at'], name: 'telescope_entries_created_at_index')]
17+
#[Index(columns: ['type', 'should_display_on_index'], name: 'telescope_entries_type_should_display_on_index_index')]
1618
#[Entity(table: 'telescope_entries')]
1719
class TelescopeEntry
1820
{
19-
#[Column(type: 'bigInteger', primary: true)]
21+
#[Column(type: 'primary')]
2022
public int $sequence;
2123

22-
#[Column(type: 'uuid', unique: true)]
24+
#[Column(type: 'uuid')]
2325
public string $uuid;
2426

2527
#[Column(type: 'uuid')]

0 commit comments

Comments
 (0)