Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Another approach I've seen used is to map the hash of your schema to an upgrade script (which would be an empty script for the latest version):

    while(true) {
      string current_version = <sha1 of the dictionary table contents>
      if (!upgrade_scripts.containsKey(current_version)) {
        complain_loudly()
        exit(1)
      } else {
        string script = upgrade_scripts[current_version]
        if (script.empty())
          break
        else
          execute(script)
      }
    }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: