Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration strategy for the new 'contributor' relation between GLPi Plugins Users and GLPi Plugins #40

Open
ghost opened this issue Dec 4, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Dec 4, 2015

Slowly migrating to the future,
Authors will now be GLPi Plugins users, here is information I wrote for this refactoring :
Mind that at the same time, the project is moving to Laravel, see #39

First part, transformation of the data model,

Modification of the web app according to that

Having only 'contributors' ; no more 'authors'
meaning that the 'author' table is going to dissappear.

List of angular controllers involving data from author table (You know what i mean)

authors.js
author.js
author_plugins.js

List of PHP controllers involving data from/related to author table

Author

  • /claimauthorship ($claim_authorship)
    User
  • /user/plugins ($user_plugins)
  • /user ($profile_view)

Procedure

  • grab the production database for reference
  • for each author, create a user, that's the actual model (could be renamed to 'contributor' not sure it's very usefull though)
    • that user musn't be able to log in
      • the simple unix way to ensure that, do nothing,
        if there's no hash in the password field,
        no login will be possible, if there's no username,
        no login will be possible.
  • now, switch the author page to 'user public page'
  • switch the 'authors' page to 'contributors'
  • switch the 'author plugins' page to 'user contributed plugins page'

In terms of relation, it means

  • that the plugin_contributor table is going to be created
  • that the plugin_author table is going to be deleted

Suggestions

I suggest that the replacement strategy take place
in that order :

  • adding the new table, endpoint, behaviour
  • work on the frontend to ensure everything turn fine
  • delete the old table, endpoint, behaviour

Second part, transformation of the "claim an authorship"

feature to allow community migration on the new system

Once a registered user claims his authorship on known plugins.

We receive a request on the GLPi mailbox, saying that user X
claims being user Y.

If we accept the request, we are going to copy the realname
of the known author in the realname field of the asking author,
we are going to replace the user_id of the known author by the
one of the requesting author, for every plugin_contributor entry.
We can finally delete the user table entry corresponding to the
known original author.

@ghost ghost changed the title Migration strategy for the new 'contributor' relation between [GLPi Plugins](http://plugins.glpi-project.org) Users and GLPi Plugins Migration strategy for the new 'contributor' relation between GLPi Plugins Users and GLPi Plugins Dec 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants