-
Notifications
You must be signed in to change notification settings - Fork 60
How to port an extra column ("fields") from "strapi_permission" to "admin_permissions" #19
Comments
In your database, write a query that either drops the fields column in v3 or adds a fields column in v4 |
Indeed, this looks like a customization that won't be covered by these scripts as it looks like you modified your admin permissions that we don't have normally. If you aren't actively using this, you should drop it. |
With no new information I'll go ahead and mark this issue as closed |
Reopening because @PaulBratslavsky just hit the same issue and is sending me over his test project and test database. |
The "fields" column was renamed to "properties" it seems as part of the i18n feature (v3.6.0) back in April 2021. Any project created before this date will have this issue as the "fields" column was not removed as part of the data migration to the "properties" column. |
@martincapek this is one of those edge cases 😓 we prob should just add a quick check to ignore this one. |
This -should- be fixed in #30 marking as closed unless someone hits the issue again. |
Hello i'm getting this error even with this MR merged
|
Also getting this error:
|
@VincentDugard / @andresfelipe9619 / @LilyLauben from what I can see that column is no longer required. Can you please do the following:
The PR I mentioned should take care of this but to not hold you all back I want to see if manually cleaning would resolve the issue. |
After removing |
@derrickmehaffy Thanks for the response. |
That sounds like you have some corruption in your permissions table, some permissions without roles they are linked to. The script won't be able to handle that. |
Or sorry some users without roles or users with roles that don't exist anymore. |
@derrickmehaffy Thanks for the response, I will take a look tonight and let you know |
I was talking to another user that the issue was around the relation they had with users-permissions wasn't migrated properly at the code level, can you check your users-permissions schema file to see if the other side of the relation was correctly added? |
Hi everyone, I had this same issue and I deleted the fields column, but now after deleting it I get this error:
Any idea how to debug this? Just to see where the issue is actually happening. Also I wasn't able to set session_replication_role to replica; since both the v3 and V4 databases are running on Heroku, could this issue have something to do with that? I get this error:
@derrickmehaffy I know the second part of my issue is unrelated here but do you have any idea how that could be sorted? I've commented out |
@LilyLauben Is your database hosted on Heroku by any chance? |
Hi @derrickmehaffy, looks like, after the latest merge, the conditions column in the admin_permissions table throws invalid input syntax for type JSON which I mentioned above, changing it back to |
@derrickmehaffy Still facing the issues, this is my schema: Also, as pointed out from @MotaZor94, I've had to stringify |
@derrickmehaffy These are my tables for strapi-permissions generated from v4, seems like Thanks! |
Thanks @MotaZor94 , I've reverted the commit for now until we can dive deeper |
Are you working on the same database? These migration scripts expect that you have two different databases, one for v3 and one for v4 |
@derrickmehaffy No, I'm working with different database, the screenshot was for the v4 after running the api in develop mode with an empty db |
Those I can't seem to reproduce that logic during a test migration currently. |
@derrickmehaffy I can share my database for you to reproduce it if you want |
That would be great. Are you on our community Discord? If so PM me directly: |
I believe this issue is related to strapi/codemods#48. If someone could check with this fix and double check your code-base to ensure you have the proper collectionName set on users-permissions. |
Bug report
Required System information
Describe the bug
I have an extra column on v3's
strapi_permission
table. At the moment I'm not sure if it's being used by the lib or the project. What would be the best way to port it to v4.I get this error when trying to migrate SQL data, v3 to v4:
Steps to reproduce the behavior
1.Follow the instruction from README file
2. See errors
Expected behavior
Not to have this error because afaik there isn't any
fields
column in v4'sadmin_permissions
table.Screenshots
n/a
Code snippets
Longer stack:
Additional context
n/a
The text was updated successfully, but these errors were encountered: