Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

v3 to v4 script fails when the U&P plugin is not installed #33

Open
fdel-car opened this issue Aug 8, 2022 · 3 comments
Open

v3 to v4 script fails when the U&P plugin is not installed #33

fdel-car opened this issue Aug 8, 2022 · 3 comments
Labels
issue: bug Issue reporting a bug issue: enhancement Issue suggesting an enhancement to an existing feature severity: medium If it breaks the basic use of the product but can be worked around source: v3-SQL to v4-SQL status: confirmed Confirmed by a Strapi Team member or multiple community members

Comments

@fdel-car
Copy link

fdel-car commented Aug 8, 2022

Bug report

Required System information

  • Node.js version: 16.13.0
  • NPM version: 8.13.2
  • Source Strapi version: 3.6.8
  • Target Strapi version: 4.1.9
  • Source Database: PostgreSQL 12.9
  • Target Database: PostgreSQL 12.9
  • Operating system: WSL2 / Ubuntu 20.04
  • Which script are you running: v3-sql-v4-sql

Describe the bug

If the U&P plugin is missing from the target project, the script will crash.

error: delete from "up_permissions_role_links" - relation "up_permissions_role_links" does not exist

Steps to reproduce the behavior

Pretty straightforward, just try a migration, targeting a project without U&P installed.

Expected behavior

I would expect a warning message explaining that the U&P plugin is probably not installed, and the users' permissions were not migrated. Apart from that everything should work nonetheless.

Or you can choose to stop there and tell the user to add U&P to his/her app but then it implies that U&P is not really a plugin as it's required.

@derrickmehaffy derrickmehaffy added issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: v3-SQL to v4-SQL status: confirmed Confirmed by a Strapi Team member or multiple community members labels Aug 12, 2022
@derrickmehaffy derrickmehaffy moved this to To be reviewed in v3 to v4 Migration Project Aug 12, 2022
@derrickmehaffy
Copy link
Member

derrickmehaffy commented Aug 12, 2022

We would likely need to add a special exception here or possibly just build an optional addtional custom migration that would just ignore/delete these during the migration.

@martincapek What are your thoughts here?


for context, in v3 the users-permissions plugin was required, in v4 it's optional and is currently installed by default but in the near future it won't be. I think the main issue here is that the scripts are not "code aware" to see if the plugin is installed on the v4 project since it only looks at the database? Should we just have some .env config options to disable syncing certain build in features like users-permissions, etc?

@derrickmehaffy derrickmehaffy added the issue: enhancement Issue suggesting an enhancement to an existing feature label Aug 12, 2022
@derrickmehaffy derrickmehaffy moved this from To be reviewed to Not enough information in v3 to v4 Migration Project Aug 12, 2022
@martincapek
Copy link
Collaborator

We can add env variable to disable migration of DISABLE_UP_MIGRATION

@derrickmehaffy derrickmehaffy moved this from Not enough information to Reviewed in v3 to v4 Migration Project Oct 27, 2022
@martincapek
Copy link
Collaborator

Hi, should be fixed in #74

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue: bug Issue reporting a bug issue: enhancement Issue suggesting an enhancement to an existing feature severity: medium If it breaks the basic use of the product but can be worked around source: v3-SQL to v4-SQL status: confirmed Confirmed by a Strapi Team member or multiple community members
Projects
Development

No branches or pull requests

4 participants