Menu

#105 Ensure database is changed at each install

0.7.2
open
nobody
2017-08-31
2017-08-31
No

So far, mathmaker creates a copy of mathmaker.db-dist (as mathmaker.db) if mathmaker.db-dist is newer than mathmaker.db. This is not enough, in some cases it does not ensure the replacement of the old version by the newer one.
Possible solutions:

1°) Include the version number in a dedicated field in the database

  • replace the time condition to trigger the copy by a check of this version number
  • the script toolbox/build_db.py create the copy at the end of its process
  • inclusion of the version number in the database should be made by setup.py

2°) Looks better: include the version number in the name of the database, like mathmaker-0.7.2dev1.db

  • the script toolbox/build_db.py create the copy including version number in the name, at the end of its process
  • mathmaker will only check if there's a file with the matching version in the name (no time condition), if not it will create the copy (and delete older versions).

3°) Even better: use a post-install script to create the copy right after install. Check it works also for upgrades.

Discussion

  • Nicolas Hainaux

    Nicolas Hainaux - 2017-08-31
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,6 +1,13 @@
     So far, mathmaker creates a copy of mathmaker.db-dist (as mathmaker.db) if mathmaker.db-dist is newer than mathmaker.db. This is not enough, in some cases it does not ensure the replacement of the old version by the newer one.
    -Possible solution:
    +Possible solutions:
    
    -- include the version number in a dedicated field in the database; use it as additional condition triggering the copy of mathmaker.db-dist to mathmaker.db
    -- let the script `toolbox/build_db.py` create the copy at the end of its process, this will allow to withdraw the time condition to trigger the copy
    +1°) Include the version number in a dedicated field in the database
    +
    +-  replace the time condition to trigger the copy by a check of this version number
    +- the script `toolbox/build_db.py` create the copy at the end of its process
     - inclusion of the version number in the database should be made by setup.py
    +
    +2°) Looks better:  include the version number in the name of the database, like mathmaker-0.7.2dev1.db
    +
    +- the script `toolbox/build_db.py` create the copy including version number in the name, at the end of its process
    +- mathmaker will only check if there's a file with the matching version in the name (no time condition), if not it will create the copy (and delete older versions).
    
     
  • Nicolas Hainaux

    Nicolas Hainaux - 2017-08-31
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -11,3 +11,5 @@
    
     - the script `toolbox/build_db.py` create the copy including version number in the name, at the end of its process
     - mathmaker will only check if there's a file with the matching version in the name (no time condition), if not it will create the copy (and delete older versions).
    +
    +3°) Even better: use a post-install script to create the copy right after install. Check it works also for upgrades.
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.