Hi, I’m trying to add new field in collection (lets say articles and field is of type number)
it’s not changing existing one, although when I try to change existing field I have the same error.
Locally with sqlite there are no problems.
But when I deploy to DEV, Strapi just wont start and throws admin_permissions error.
I know that changing field requires migration, but what about absolutly new field? Does it require migration also?? If yes - how?
logs:
debug:
Server wasn’t able to start properly.
error: alter table admin_permissions add constraint admin_permissions_created_by_id_fk foreign key (created_by_id) references admin_users (id) on delete SET NULL - Failed to add the foreign key constraint. Missing index for constraint ‘admin_permissions_created_by_id_fk’ in the referenced table ‘admin_users’
Error: alter table admin_permissions add constraint admin_permissions_created_by_id_fk foreign key (created_by_id) references admin_users (id) on delete SET NULL - Failed to add the foreign key constraint. Missing index for constraint ‘admin_permissions_created_by_id_fk’ in the referenced table ‘admin_users’
at Packet.asError (/opt/node_modules/mysql2/lib/packets/packet.js:738:17)
at Query.execute (/opt/node_modules/mysql2/lib/commands/command.js:29:26)
at Connection.handlePacket (/opt/node_modules/mysql2/lib/connection.js:481:34)
at PacketParser.onPacket (/opt/node_modules/mysql2/lib/connection.js:97:12)
at PacketParser.executeStart (/opt/node_modules/mysql2/lib/packet_parser.js:75:16)
at Socket. (/opt/node_modules/mysql2/lib/connection.js:104:25)
at Socket.emit (node:events:513:28)
at Socket.emit (node:domain:489:12)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
This topic has been created from a Discord post (1273295454603313162) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord