Skip to content

Commit 34d0c3c

Browse files
committed
chore(migrations): fixed tables without PK on initial migration
1 parent 0d6b7e3 commit 34d0c3c

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

database/migrations/Version20190604015804.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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,

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
extra_hosts:
99
- "host.docker.internal:host-gateway"
1010
image: idp-app
11+
pull_policy: never
1112
container_name: idp-app
1213
restart: unless-stopped
1314
working_dir: /var/www/
@@ -35,7 +36,7 @@ services:
3536
db:
3637
image: mysql:8.0
3738
container_name: idp-db-local
38-
command: --default-authentication-plugin=mysql_native_password
39+
command: --default-authentication-plugin=mysql_native_password --sql-require-primary-key=ON
3940
restart: unless-stopped
4041
ports:
4142
- "30780:3306"

0 commit comments

Comments
 (0)