Just a small amendment to the previous e-mail I have just realised that in the 2nd question, the logical solution would be in every commit consider present scripts as applied... which basically means that inveniocfg --create-tables should always mark all upgrade scripts as applied (this seems not to happen) I misunderstand something or this is a bug ?
Piotr ________________________________________ From: Piotr Praczyk Sent: 15 November 2012 21:37 To: project-invenio-devel (Invenio developers mailing-list); inspire-...@slac.stanford.edu Subject: Upgrader script Hello I have several questions concerning the Upgrader mechanism introduced to Invenio. First of all, could someone who knows the topic better, review my upgrate module ? It can be seen under: http://invenio-software.org/repo/personal/invenio-ppraczyk/commit/?h=bibdocfile-squashed-ultimate-rebased&id=be09d38416fe5adc0898f40e94fe80118dedd70e The questions (about what I don't understand after reading the documentation .... in inveniocfg_upgrader.py) : 1) Modules are supposed to be standalone, not depending too much on imports from Invenio "unless it is absolutely necessary". - which imports can be considered necessary ? Upgrade scripts cannot be ammended in the future (according to the doc), making this work seemingly an impossible task. For instance (example from this upgrade) if I need to import some configuration variables which have got renamed in one of the commits (in this example together with moving bibdocfile from websubmit to bibdocfile module). If we decide to further rename those varaibles, we have to ammend all upgrade scripts, otherwise it will clearly fail. Is there a list of safe imports ? 2) How can I mark that a certain commit introduces given changes ? Afetr I have installed the commit and created database using invenioconfig script, intuitively I would expect everything being up to date and not requiring upgrades. In reality, the upgrader suggests a series of actions (which cause warnings because indeed they seem to be already applied). The dependency system seems to be related not to commits but previously run scripts. Is there any mechanism allowing to mark that a given commit gives Invenio in the state as after running of a given script ? For example running bibdocfile model upgrade should not happen if database was created using newer commit from the repository. I have not managed to find something like this in the code :( Piotr