@@ -60,10 +60,9 @@ protected function createTables(): void
60
60
61
61
protected function createIndexes (): void
62
62
{
63
- $ this ->createIndex (null , '{{%supertableblocks}} ' , ['ownerId ' ], false );
63
+ $ this ->createIndex (null , '{{%supertableblocks}} ' , ['primaryOwnerId ' ], false );
64
64
$ this ->createIndex (null , '{{%supertableblocks}} ' , ['fieldId ' ], false );
65
65
$ this ->createIndex (null , '{{%supertableblocks}} ' , ['typeId ' ], false );
66
- $ this ->createIndex (null , '{{%supertableblocks}} ' , ['sortOrder ' ], false );
67
66
$ this ->createIndex (null , '{{%supertableblocktypes}} ' , ['fieldId ' ], false );
68
67
$ this ->createIndex (null , '{{%supertableblocktypes}} ' , ['fieldLayoutId ' ], false );
69
68
}
@@ -72,8 +71,10 @@ protected function addForeignKeys(): void
72
71
{
73
72
$ this ->addForeignKey (null , '{{%supertableblocks}} ' , ['fieldId ' ], '{{%fields}} ' , ['id ' ], 'CASCADE ' , null );
74
73
$ this ->addForeignKey (null , '{{%supertableblocks}} ' , ['id ' ], '{{%elements}} ' , ['id ' ], 'CASCADE ' , null );
75
- $ this ->addForeignKey (null , '{{%supertableblocks}} ' , ['ownerId ' ], '{{%elements}} ' , ['id ' ], 'CASCADE ' , null );
74
+ $ this ->addForeignKey (null , '{{%supertableblocks}} ' , ['primaryOwnerId ' ], '{{%elements}} ' , ['id ' ], 'CASCADE ' , null );
76
75
$ this ->addForeignKey (null , '{{%supertableblocks}} ' , ['typeId ' ], '{{%supertableblocktypes}} ' , ['id ' ], 'CASCADE ' , null );
76
+ $ this ->addForeignKey (null , '{{%supertableblocks_owners}} ' , ['blockId ' ], '{{%supertableblocks}} ' , ['id ' ], 'CASCADE ' , null );
77
+ $ this ->addForeignKey (null , '{{%supertableblocks_owners}} ' , ['ownerId ' ], '{{%elements}} ' , ['id ' ], 'CASCADE ' , null );
77
78
$ this ->addForeignKey (null , '{{%supertableblocktypes}} ' , ['fieldId ' ], '{{%fields}} ' , ['id ' ], 'CASCADE ' , null );
78
79
$ this ->addForeignKey (null , '{{%supertableblocktypes}} ' , ['fieldLayoutId ' ], '{{%fieldlayouts}} ' , ['id ' ], 'SET NULL ' , null );
79
80
}
0 commit comments