@@ -136,6 +136,7 @@ public function up(Schema $schema):void
136136 updated_at timestamp default CURRENT_TIMESTAMP not null,
137137 api_endpoint_id bigint unsigned not null,
138138 scope_id bigint unsigned not null,
139+ primary key (api_endpoint_id, scope_id),
139140 constraint oauth2_api_endpoint_api_scope_api_endpoint_id_foreign
140141 foreign key (api_endpoint_id) references oauth2_api_endpoint (id)
141142 on delete cascade,
@@ -164,6 +165,7 @@ public function up(Schema $schema):void
164165 updated_at timestamp default CURRENT_TIMESTAMP not null,
165166 group_id bigint unsigned not null,
166167 scope_id bigint unsigned not null,
168+ primary key (group_id, scope_id),
167169 constraint oauth2_api_scope_group_scope_group_id_foreign
168170 foreign key (group_id) references oauth2_api_scope_group (id)
169171 on delete cascade,
@@ -248,6 +250,7 @@ public function up(Schema $schema):void
248250 updated_at timestamp default CURRENT_TIMESTAMP not null,
249251 group_id bigint unsigned not null,
250252 user_id bigint unsigned not null,
253+ primary key (group_id, user_id),
251254 constraint oauth2_api_scope_group_users_group_id_foreign
252255 foreign key (group_id) references oauth2_api_scope_group (id)
253256 on delete cascade,
@@ -380,6 +383,7 @@ class_name enum('ClientPublicKey', 'ServerPrivateKey') default 'ClientPublicKey'
380383 updated_at timestamp default CURRENT_TIMESTAMP not null,
381384 oauth2_client_id bigint unsigned not null,
382385 user_id bigint unsigned not null,
386+ primary key (oauth2_client_id, user_id),
383387 constraint oauth2_client_admin_users_oauth2_client_id_foreign
384388 foreign key (oauth2_client_id) references oauth2_client (id)
385389 on delete cascade,
@@ -423,6 +427,7 @@ class_name enum('ClientPublicKey', 'ServerPrivateKey') default 'ClientPublicKey'
423427 updated_at timestamp default CURRENT_TIMESTAMP not null,
424428 client_id bigint unsigned not null,
425429 scope_id bigint unsigned not null,
430+ primary key (client_id, scope_id),
426431 constraint oauth2_client_api_scope_client_id_foreign
427432 foreign key (client_id) references oauth2_client (id)
428433 on delete cascade,
0 commit comments