anchor.diff:            installedMinor=$(cat "${seafRoot}/server-setup" | cut -d"-" -f1 | cut -d"." -f2)
             pkgMajor=$(echo "${cfg.seafilePackage.version}" | cut -d"." -f1)
             pkgMinor=$(echo "${cfg.seafilePackage.version}" | cut -d"." -f2)
  -          if [ $installedMajor != $pkgMajor ] || [ $installedMinor != $pkgMinor ]; then
  +
  +          if [[ $installedMajor == $pkgMajor && $installedMinor == $pkgMinor ]]; then
  +             :
  +          elif [[ $installedMajor == 8 && $installedMinor == 0 && $pkgMajor == 9 && $pkgMinor == 0 ]]; then
  +              # Upgrade from 8.0 to 9.0
  +              sqlite3 ${dataDir}/seafile.db ".read ${pkgs.seahub}/scripts/upgrade/sql/9.0.0/sqlite3/seafile.sql"
  +              echo "${cfg.seafilePackage.version}-sqlite" > "${seafRoot}"/server-setup
  +          else
                 echo "Unsupported upgrade" >&2
                 exit 1
             fi
  
positive.code:     }
      MEDIA_ROOT = '${seahubDir}/media/'
      THUMBNAIL_ROOT = '${seahubDir}/thumbnail/'
  
      with open('${seafRoot}/.seahubSecret') as f:
          SECRET_KEY = f.readline().rstrip()
  
negative.code:         after = [ "network.target" ];
          wantedBy = [ "seafile.target" ];
          restartTriggers = [ ccnetConf seafileConf ];
          path = [ pkgs.sqlite ];
          serviceConfig = securityOptions // {
            User = "seafile";
            Group = "seafile";
  