SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard Zaggs's Avatar
    Join Date
    Feb 2005
    Posts
    1,045
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy need some help with scope of a project

    Hi guys,
    I am creating a new upgrade file for one of my scripts so that users can upgrade from previous versions.

    Once they run this script, it will go through a number of processes.

    1. Firstly it creates a db backup file on the server
    2. Now it drops any "temporary" tables that are in the db. These may exist if a previous upgrade failed.
    3. Now it will create temporary tables.
    4. Now I want to transfer existing data from their old tables to the temporary tables. Some of the field names/table names have changed.
    5. Once we have transferred all data to the new tables, we delete the old tables (ie: "banners"), then rename the temporary tables (ie: rename "temp_banners" to "banners")

    The upgrade is now complete.

    However, my problem lies with number 4. If the user is upgrading from a specific version then it will work as my mysql queries are specific for that version. However, lets say that the user had a problem with upgrade and the script missed out one table, then they would have to go back and run the script again. But this time some of the new tables have already been created and therefore the mysql queries which are used to upgrade from the older version will not work as some of the column names have already been changed to the new ones.

    Thats where my problem lies. Is there a way around this or maybe there is a better way of performing this type of upgrade??

  2. #2
    SitePoint Wizard Zaggs's Avatar
    Join Date
    Feb 2005
    Posts
    1,045
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any ideas?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •