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.
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
Procedure
In terms of relation, it means
Suggestions
I suggest that the replacement strategy take place in that order :
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.