Simple Invoices logo
    • CommentAuthorddd
    • CommentTimeOct 11th 2007 edited
     permalink
    Hi,

    I've just tried to upgrade to latest version and I reveive the following message while pressing "upgrade".


    Dude, what happened to your query?:

    CREATE TABLE `si_system_defaults` ( `id` int(11) NOT NULL auto_increment, `name` varchar(30) NOT NULL, `value` varchar(30) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) )
    Table 'si_system_defaults' already existsTable 'si_system_defaults' already exists

    Please help !

    Thanks
    dd
    • CommentAuthorjustin
    • CommentTimeOct 11th 2007 edited
     permalink
    Hey DD,

    what version are you upgrading from?

    looks like its a problem with sql patch 62 (./include/sql_patches.php)

    $patch['62']['name'] = "Introduce system_defaults table";
    $patch['62']['patch'] = "CREATE TABLE `si_system_defaults` (
    `id` int(11) NOT NULL auto_increment,
    `name` varchar(30) NOT NULL,
    `value` varchar(30) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `name` (`name`)
    ) ";
    $patch['62']['date'] = "20070523"


    once i know what version your upgrading from - i'll look at its db structure and see where the issue is

    Cheers

    Justin
    • CommentAuthorddd
    • CommentTimeOct 12th 2007 edited
     permalink
    Hello Justin,
    The version I'm upgradiing from is Version: 20070305 stable

    and you are right about patch 62 since as of this line :
    SQL patch 62, Introduce system_defaults table has not been applied to the database

    the patches do not go through!

    thanks
    dd
    • CommentAuthorjustin
    • CommentTimeOct 14th 2007 edited
     permalink
    Thanks DD,

    i'll re-download that version and check it out - will let you know tomorrow

    Cheers

    Justin
    • CommentAuthorjustin
    • CommentTimeOct 15th 2007 edited
     permalink
    Thanks DD

    just re-downloaded it and tried the update

    i can confirm the issue - just its not related to patch

    open ./include/language.php and edit line 17

    from
    $language = getDefaultLanguage();
    to
    //$language = getDefaultLanguage();

    then run update again - will be in english

    then change that line 17 back to
    $language = getDefaultLanguage();

    let me know if this work

    Note: backup your db before the update!!!!!!!!!

    Cheers

    Justin
    • CommentAuthorddd
    • CommentTimeOct 15th 2007 edited
     permalink
    Thanks for the reesponse,

    Istill got the error message. After I've disabled the $language = getDefaultLanguage();
    I also have errors related to the lanquage file.
    Well could it be related to French language ?
    thanks
    dd

    Warning: include(./lang//lang.php) [function.include]: failed to open stream: Aucun fichier ou répertoire de ce type in /opt/lampp/htdocs/invoices2/include/language.php on line 34

    Warning: include() [function.include]: Failed opening './lang//lang.php' for inclusion (include_path='.:/opt/lampp/lib/php:./include') in /opt/lampp/htdocs/invoices2/include/language.php on line 34
    Dude, what happened to your query?:

    CREATE TABLE `si_system_defaults` ( `id` int(11) NOT NULL auto_increment, `name` varchar(30) NOT NULL, `value` varchar(30) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) )
    Table 'si_system_defaults' already existsTable 'si_system_defaults' already exists
    • CommentAuthorjustin
    • CommentTimeOct 15th 2007 edited
     permalink
    Hey DD,

    one more thing to try

    replace the $language = getDefaultLanguage(); with
    /*if upgrading from old version then getDefaultLang wont work during install*/
    if(checkTableExists('si_system_defaults') == true)
    {
    $language = getDefaultLanguage();
    }
    if(checkTableExists('si_system_defaults') == false)
    {
    $language = "en-gb";
    }


    and retest

    note: it'll be in English

    Question: Does it show the upgrade screen (with error at top and normal stuff below) on the page or is just the error shown?

    Cheers

    Justin
    • CommentAuthorddd
    • CommentTimeOct 16th 2007 edited
     permalink
    Hello,
    still have the same error message.

    when I go to URL http://127.0.0.1/invoices2/

    I have the upgrade screen with the "update" button and when I click on this one I got the error message about the system default table already existing.

    I've tried to start with a new database but then I can't import my old data of course. (something about "Unknown column 'si_biller.b_name' in 'field list'")

    cheers
    dd
    • CommentAuthorjustin
    • CommentTimeOct 16th 2007 edited
     permalink
    Thanks

    One more question:

    What is the number of the first patch that say "has not been applied"?

    ie: SQL patch 138, Add custom field order has not been applied to the database

    if its up to 62 just might need to drop the si_system_defaults

    Cheers

    Justin
    • CommentAuthorddd
    • CommentTimeOct 17th 2007 edited
     permalink
    It works !

    I've renamed the table si_system_defaults then I had an error with table si_log which I renamed as well and then the patches have been all applied !

    thanks a lot

    dd
    • CommentAuthorjustin
    • CommentTimeOct 17th 2007 edited
     permalink
    Hey dd,

    great to hear it works now!!

    has anyone else had this problem?

    Cheers

    Justin
  1.  permalink
    I was running into the same issues and then I commented out the line in language.php. That allowed me to load up the invoice patching system and patch the database. So far, everything seems to be working fine.

    My suggestion to others is to not try to modify the database to make the error go away; that will not fix the issue at all.

    Thanks for the help justin.
    • CommentAuthorjustin
    • CommentTimeOct 28th 2007 edited
     permalink
    Thanks Kaffeine,

    i try and do a new release of Simple invoices with that fix included asap

    Cheers

    Justin