[Show Table of Contents]

§I'm a Developer, How do I make new - Required - Database Updates?

  • It's extremely simple
  • When you add your .SQL file, you still will add it as traditionally to our regular path

§Increment Binary Database Version in the Source

  • You need to increment a define in the source that dictates what database version the source SHOULD be running at
    • Located in common/version.h:
        • ​Add a revision number to this define

§Add the New Update to the Database Update Manifest

9058|2014_11_17_example_update_file.sql|SHOW TABLES LIKE 'character_mercenaries'|empty|
  • This example would then have users run 2014_11_17_example_update_file.sql when they don't have the 'character_mercenaries' table because of the empty condition
    • In otherwords, the manifest condition is simply, if the result of the following query 'SHOW TABLES LIKE 'character_mercenaries'' returns no results (empty) then the update system would trigger that as a needed update for the user
  • You only need to check one condition of the update that you are performing, if your SQL file performs several updates, only check for one condition that a database wouldn't have with your update before it is applied, in this case it is looking for a table that never existed before.

That's it! You're done! Everything else takes care of it

§Other Manifest Examples:

§Example 1 (Missing):
9056|2014_11_08_RaidMembers.sql|SHOW COLUMNS FROM `raid_members` LIKE 'groupid'|missing|unsigned
  • This entry is looking for what the column looks like in raid_members and to see if it is an unsigned integer
    • The match type is missing, so I'm looking to see if the word 'unsigned' is missing from the table. In this case if unsigned was missing, we need to run this update because that is what the update did.

2014_11_08_RaidMembers.sql would run:

ALTER TABLE `raid_members` CHANGE COLUMN `groupid` `groupid` INT(4) UNSIGNED NOT NULL DEFAULT '0' AFTER `charid`;
§Example 2 (Contains):
9055|2014_10_30_special_abilities_null.sql|SHOW COLUMNS FROM `npc_types` LIKE 'special_abilities'|contains|NO
  • This entry is looking for what the column looks like in npc_types, column 'special_abilities' to see if it contains the word 'NO', which if you look at the SQL result at the given time before this update is applied.
    • You will see the data about column regarding NULL, defined as NO. Which means the field can't be null, we want it to be able to be null because it causes issues with later MySQL versions, which is why this update was made.

2014_10_30_special_abilities_null.sql would run:

ALTER TABLE `merc_stats` MODIFY COLUMN `special_abilities`  text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL;
ALTER TABLE `npc_types` MODIFY COLUMN `special_abilities`  text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL;
§Example 3 (Empty):
9054|2014_10_19_raid_group_mentor.sql|SHOW COLUMNS FROM `raid_leaders` LIKE 'mentoree'|empty|
  • This entry is looking to see if the 'mentoree' column exists in 'raid_leaders', because we add a new column in this update, that is appropriate to check
    • Because we're looking for an empty result, if the database does not contain this field, this match would work and mark the update as needed

2014_10_19_raid_group_mentor.sql would run:

ALTER TABLE `raid_leaders` ADD `mentoree` VARCHAR(64) NOT NULL;
ALTER TABLE `raid_leaders` ADD `mentor_percent` INT(4) DEFAULT 0 NOT NULL;

§How the Database Update Manifest Works

  • The manifest is simply a text file pulled down by the upgrade script and used to perform checks necessary against the database
    • The | 'pipe' character is the delimiter
      • 1st argument - Revision number
      • 2nd argument - SQL File to Run
      • 3rd argument - SQL Query Condition to run against database (Match)
      • 4th argument - Match Type
        • contains = If query results contains text from 4th value
        • match = If query results matches text from 4th value
        • missing = If query result is missing text from 4th value
        • empty = If the query results in no results
        • not_empty = If the query is not empty

§How the Upgrade Process Works

  • Most of the work is done by eqemu_update.pl script, this script is cross platform and is ran by World
  • If eqemu_update.pl is not present in the server directory, it will first pull it down remotely from the Github repository (Or attempt to if internet connection is present):
  • eqemu_update.pl is designed to be ran standalone and from World everytime world boots up
    • The script is responsible for creating the local database 'db_version' table that maintains a single 'version' column with the local database version number
    • It is also responsible for updating that version field as updates are applied
    • It contains a prompt menu that requires user input for select options

§When World Boots Up

  • It will run eqemu_update.pl
    • If the binary version matches the local database version:
      • ​World will continue to bootup with no interruption.
        • This means that you will never need to mess with 'updating' until you actually update your source with changes that require database schema changes.
    • If the binary version is greater than the reported local database version:
      • ​World will interrupt bootup and prompt the database upgrade menu that resembles the following:
      • When you select 3, it will proceed with checking the manifest against your local database to see which updates need to be ran...
Database Management Menu (Please Select):
        1) Backup Database - (Saves to Backups folder)
                Ideal to perform before performing updates
        2) Backup Database Compressed - (Saves to Backups folder)
                Ideal to perform before performing updates
        3) Check for pending Database updates
                Stages updates for automatic upgrade...
        0) Exit

> 3
Reading manifest...

Missing DB Update 9057 '2014_11_13_spells_new_updates.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_11_13_spells_new_updates.sql
        Saved:  db_update/2014_11_13_spells_new_updates.sql
Missing DB Update 9056 '2014_11_08_RaidMembers.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_11_08_RaidMembers.sql
        Saved:  db_update/2014_11_08_RaidMembers.sql
DB up to date with: 9055 '2014_10_30_special_abilities_null.sql'
DB up to date with: 9054 '2014_10_19_raid_group_mentor.sql'
Missing DB Update 9053 '2014_10_18_group_mentor.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_10_18_group_mentor.sql
        Saved:  db_update/2014_10_18_group_mentor.sql
DB up to date with: 9052 '2014_10_13_RaidLeadership.sql'
Missing DB Update 9051 '2014_10_11_RaidMOTD.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_10_11_RaidMOTD.sql
        Saved:  db_update/2014_10_11_RaidMOTD.sql
Missing DB Update 9050 '2014_09_20_ban_messages.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_09_20_ban_messages.sql
        Saved:  db_update/2014_09_20_ban_messages.sql
Missing DB Update 9048 '2014_09_09_attack_delay.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_09_09_attack_delay.sql
        Saved:  db_update/2014_09_09_attack_delay.sql
DB up to date with: 9046 '2014_08_23_player_events_and_player_aa_rate_hourly.sql'
DB up to date with: 9045 '2014_08_23_Complete_QueryServ_Table_Structures.sql'
Missing DB Update 9044 '2014_08_20_merchantlist_probability.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_08_20_merchantlist_probability.sql
        Saved:  db_update/2014_08_20_merchantlist_probability.sql
Missing DB Update 9043 '2014_08_18_spells_new_update.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_08_18_spells_new_update.sql
        Saved:  db_update/2014_08_18_spells_new_update.sql
Missing DB Update 9042 '2014_08_12_NPC_raid_targets.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_08_12_NPC_raid_targets.sql
        Saved:  db_update/2014_08_12_NPC_raid_targets.sql
Missing DB Update 9041 '2014_08_02_spells_new.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_08_02_spells_new.sql
        Saved:  db_update/2014_08_02_spells_new.sql
Missing DB Update 9040 '2014_07_10_npc_spells.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_07_10_npc_spells.sql
        Saved:  db_update/2014_07_10_npc_spells.sql
Missing DB Update 9039 '2014_07_04_AA_Updates.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_07_04_AA_Updates.sql
        Saved:  db_update/2014_07_04_AA_Updates.sql
Missing DB Update 9038 '2014_06_25_AA_Updates.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_06_25_AA_Updates.sql
        Saved:  db_update/2014_06_25_AA_Updates.sql
Missing DB Update 9036 '2014_05_04_SlowMitigationFix.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_05_04_SlowMitigationFix.sql
        Saved:  db_update/2014_05_04_SlowMitigationFix.sql
Missing DB Update 9035 '2014_04_27_AISpellEffects.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_04_27_AISpellEffects.sql
        Saved:  db_update/2014_04_27_AISpellEffects.sql
Missing DB Update 9034 '2014_04_25_spawn_events.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_04_25_spawn_events.sql
        Saved:  db_update/2014_04_25_spawn_events.sql
Missing DB Update 9032 '2014_04_12_SlowMitigation.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_04_12_SlowMitigation.sql
        Saved:  db_update/2014_04_12_SlowMitigation.sql
Missing DB Update 9031 '2014_04_10_No_Target_With_Hotkey.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_04_10_No_Target_With_Hotkey.sql
        Saved:  db_update/2014_04_10_No_Target_With_Hotkey.sql
Missing DB Update 9030 '2014_04_04_PhysicalResist.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_04_04_PhysicalResist.sql
        Saved:  db_update/2014_04_04_PhysicalResist.sql
Missing DB Update 9029 '2014_02_26_virulentvenomAA.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_02_26_virulentvenomAA.sql
        Saved:  db_update/2014_02_26_virulentvenomAA.sql
Missing DB Update 9028 '2014_02_26_roambox_update.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_02_26_roambox_update.sql
        Saved:  db_update/2014_02_26_roambox_update.sql
Missing DB Update 9027 '2014_02_20_buff_update.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_02_20_buff_update.sql
        Saved:  db_update/2014_02_20_buff_update.sql
Missing DB Update 9026 '2014_02_13_spells_new_update.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_02_13_spells_new_update.sql
        Saved:  db_update/2014_02_13_spells_new_update.sql
DB up to date with: 9025 '2014_02_13_Rename_instance_lockout_tables.sql'
DB up to date with: 9024 '2014_02_02_SpellCriticalsAA.sql'
Missing DB Update 9023 '2014_01_27_CritcalMendAA.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_27_CritcalMendAA.sql
        Saved:  db_update/2014_01_27_CritcalMendAA.sql
Missing DB Update 9022 '2014_01_20_Weather.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_20_Weather.sql
        Saved:  db_update/2014_01_20_Weather.sql
Missing DB Update 9021 '2014_01_20_SpellCastingReinforcement.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_20_SpellCastingReinforcement.sql
        Saved:  db_update/2014_01_20_SpellCastingReinforcement.sql
Missing DB Update 9020 '2014_01_20_Not_Extendable.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_20_Not_Extendable.sql
        Saved:  db_update/2014_01_20_Not_Extendable.sql
Missing DB Update 9019 '2014_01_20_MezMastery.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_20_MezMastery.sql
        Saved:  db_update/2014_01_20_MezMastery.sql
Missing DB Update 9018 '2014_01_09_PreservePetSize.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_09_PreservePetSize.sql
        Saved:  db_update/2014_01_09_PreservePetSize.sql
Missing DB Update 9017 '2014_01_08_SpellsNewAdditions.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_08_SpellsNewAdditions.sql
        Saved:  db_update/2014_01_08_SpellsNewAdditions.sql
Missing DB Update 9016 '2014_01_04_SongModCapAAs.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2014_01_04_SongModCapAAs.sql
        Saved:  db_update/2014_01_04_SongModCapAAs.sql
Missing DB Update 9015 '2013_12_26_MerchantList_Class_Required.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2013_12_26_MerchantList_Class_Required.sql
        Saved:  db_update/2013_12_26_MerchantList_Class_Required.sql
Missing DB Update 9014 '2013_11_18_AssistRadius.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2013_11_18_AssistRadius.sql
        Saved:  db_update/2013_11_18_AssistRadius.sql
Missing DB Update 9013 '2013_11_13_Instrument_Singing_Mastery.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2013_11_13_Instrument_Singing_Mastery.sql
        Saved:  db_update/2013_11_13_Instrument_Singing_Mastery.sql
DB up to date with: 9012 '2013_11_07_BaseData.sql'
Missing DB Update 9011 '2013_10_31_Recipe_disabling.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2013_10_31_Recipe_disabling.sql
        Saved:  db_update/2013_10_31_Recipe_disabling.sql
DB up to date with: 9009 '2013_10_12_Merc_Special_Abilities.sql'
Missing DB Update 9008 '2013_07_11_NPC_Special_Abilities.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2013_07_11_NPC_Special_Abilities.sql
        Saved:  db_update/2013_07_11_NPC_Special_Abilities.sql
DB up to date with: 9007 '2013_05_05_Item_Tick.sql'
DB up to date with: 9006 '2013_05_05_Account_Flags.sql'
Missing DB Update 9005 '2013_04_08_Salvage.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2013_04_08_Salvage.sql
        Saved:  db_update/2013_04_08_Salvage.sql
Missing DB Update 9004 '2013_04_04_NaturesBounty.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2013_04_04_NaturesBounty.sql
        Saved:  db_update/2013_04_04_NaturesBounty.sql
DB up to date with: 9002 '2013_03_1_Merc_Rules_and_Equipment.sql'
DB up to date with: 9001 '2013_02_25_Impr_HT_LT.sql'
Missing DB Update 9000 '2013_02_18_Merc_Rules_and_Tables.sql'
        URL:    https://raw.githubusercontent.com/EQEmu/Server/master/utils/sql/git/required/2013_02_18_Merc_Rules_and_Tables.sql
        Saved:  db_update/2013_02_18_Merc_Rules_and_Tables.sql
DB up to date with: 8000 'mercs.sql'

Database Management Menu (Please Select):
        1) Backup Database - (Saves to Backups folder)
                Ideal to perform before performing updates
        2) Backup Database Compressed - (Saves to Backups folder)
                Ideal to perform before performing updates
        3) Run pending updates... (39)
        0) Exit
  • It will then give you the amount of pending updates, which gives you one more chance to backup your database before running them
    • Select 3) To run pending updates...

Running Update: 9000 - 2013_02_18_Merc_Rules_and_Tables.sql
Running Update: 9004 - 2013_04_04_NaturesBounty.sql
Running Update: 9005 - 2013_04_08_Salvage.sql
Running Update: 9008 - 2013_07_11_NPC_Special_Abilities.sql
Running Update: 9011 - 2013_10_31_Recipe_disabling.sql
Running Update: 9013 - 2013_11_13_Instrument_Singing_Mastery.sql
Running Update: 9014 - 2013_11_18_AssistRadius.sql
Running Update: 9015 - 2013_12_26_MerchantList_Class_Required.sql
Running Update: 9016 - 2014_01_04_SongModCapAAs.sql
Running Update: 9017 - 2014_01_08_SpellsNewAdditions.sql
Running Update: 9018 - 2014_01_09_PreservePetSize.sql
Running Update: 9019 - 2014_01_20_MezMastery.sql
Running Update: 9020 - 2014_01_20_Not_Extendable.sql
Running Update: 9021 - 2014_01_20_SpellCastingReinforcement.sql
Running Update: 9022 - 2014_01_20_Weather.sql
Running Update: 9023 - 2014_01_27_CritcalMendAA.sql
Running Update: 9026 - 2014_02_13_spells_new_update.sql
Running Update: 9027 - 2014_02_20_buff_update.sql
Running Update: 9028 - 2014_02_26_roambox_update.sql
Running Update: 9029 - 2014_02_26_virulentvenomAA.sql
Running Update: 9030 - 2014_04_04_PhysicalResist.sql
Running Update: 9031 - 2014_04_10_No_Target_With_Hotkey.sql
Running Update: 9032 - 2014_04_12_SlowMitigation.sql
Running Update: 9034 - 2014_04_25_spawn_events.sql
Running Update: 9035 - 2014_04_27_AISpellEffects.sql
Running Update: 9036 - 2014_05_04_SlowMitigationFix.sql
Running Update: 9038 - 2014_06_25_AA_Updates.sql
Running Update: 9039 - 2014_07_04_AA_Updates.sql
Running Update: 9040 - 2014_07_10_npc_spells.sql
Running Update: 9041 - 2014_08_02_spells_new.sql
Running Update: 9042 - 2014_08_12_NPC_raid_targets.sql
Running Update: 9043 - 2014_08_18_spells_new_update.sql
Running Update: 9044 - 2014_08_20_merchantlist_probability.sql
Running Update: 9048 - 2014_09_09_attack_delay.sql
Running Update: 9050 - 2014_09_20_ban_messages.sql
Running Update: 9051 - 2014_10_11_RaidMOTD.sql
Running Update: 9053 - 2014_10_18_group_mentor.sql
Running Update: 9056 - 2014_11_08_RaidMembers.sql
Running Update: 9057 - 2014_11_13_spells_new_updates.sql
Reading manifest...

DB up to date with: 9057 '2014_11_13_spells_new_updates.sql'
DB up to date with: 9056 '2014_11_08_RaidMembers.sql'
DB up to date with: 9055 '2014_10_30_special_abilities_null.sql'
DB up to date with: 9054 '2014_10_19_raid_group_mentor.sql'
DB up to date with: 9053 '2014_10_18_group_mentor.sql'
DB up to date with: 9052 '2014_10_13_RaidLeadership.sql'
DB up to date with: 9051 '2014_10_11_RaidMOTD.sql'
DB up to date with: 9050 '2014_09_20_ban_messages.sql'
DB up to date with: 9048 '2014_09_09_attack_delay.sql'
DB up to date with: 9046 '2014_08_23_player_events_and_player_aa_rate_hourly.sql'
DB up to date with: 9045 '2014_08_23_Complete_QueryServ_Table_Structures.sql'
DB up to date with: 9044 '2014_08_20_merchantlist_probability.sql'
DB up to date with: 9043 '2014_08_18_spells_new_update.sql'
DB up to date with: 9042 '2014_08_12_NPC_raid_targets.sql'
DB up to date with: 9041 '2014_08_02_spells_new.sql'
DB up to date with: 9040 '2014_07_10_npc_spells.sql'
DB up to date with: 9039 '2014_07_04_AA_Updates.sql'
DB up to date with: 9038 '2014_06_25_AA_Updates.sql'
DB up to date with: 9036 '2014_05_04_SlowMitigationFix.sql'
DB up to date with: 9035 '2014_04_27_AISpellEffects.sql'
DB up to date with: 9034 '2014_04_25_spawn_events.sql'
DB up to date with: 9032 '2014_04_12_SlowMitigation.sql'
DB up to date with: 9031 '2014_04_10_No_Target_With_Hotkey.sql'
DB up to date with: 9030 '2014_04_04_PhysicalResist.sql'
DB up to date with: 9029 '2014_02_26_virulentvenomAA.sql'
DB up to date with: 9028 '2014_02_26_roambox_update.sql'
DB up to date with: 9027 '2014_02_20_buff_update.sql'
DB up to date with: 9026 '2014_02_13_spells_new_update.sql'
DB up to date with: 9025 '2014_02_13_Rename_instance_lockout_tables.sql'
DB up to date with: 9024 '2014_02_02_SpellCriticalsAA.sql'
DB up to date with: 9023 '2014_01_27_CritcalMendAA.sql'
DB up to date with: 9022 '2014_01_20_Weather.sql'
DB up to date with: 9021 '2014_01_20_SpellCastingReinforcement.sql'
DB up to date with: 9020 '2014_01_20_Not_Extendable.sql'
DB up to date with: 9019 '2014_01_20_MezMastery.sql'
DB up to date with: 9018 '2014_01_09_PreservePetSize.sql'
DB up to date with: 9017 '2014_01_08_SpellsNewAdditions.sql'
DB up to date with: 9016 '2014_01_04_SongModCapAAs.sql'
DB up to date with: 9015 '2013_12_26_MerchantList_Class_Required.sql'
DB up to date with: 9014 '2013_11_18_AssistRadius.sql'
DB up to date with: 9013 '2013_11_13_Instrument_Singing_Mastery.sql'
DB up to date with: 9012 '2013_11_07_BaseData.sql'
DB up to date with: 9011 '2013_10_31_Recipe_disabling.sql'
DB up to date with: 9009 '2013_10_12_Merc_Special_Abilities.sql'
DB up to date with: 9008 '2013_07_11_NPC_Special_Abilities.sql'
DB up to date with: 9007 '2013_05_05_Item_Tick.sql'
DB up to date with: 9006 '2013_05_05_Account_Flags.sql'
DB up to date with: 9005 '2013_04_08_Salvage.sql'
DB up to date with: 9004 '2013_04_04_NaturesBounty.sql'
DB up to date with: 9002 '2013_03_1_Merc_Rules_and_Equipment.sql'
DB up to date with: 9001 '2013_02_25_Impr_HT_LT.sql'
DB up to date with: 9000 '2013_02_18_Merc_Rules_and_Tables.sql'
DB up to date with: 8000 'mercs.sql'

§Script Updates

  • If it so happens that the eqemu_update.pl script needs to be updated or code is changed to it, there is a self updating routine to the upgrade script!!! (Update inception)

In the source, there is a line where the version is passed to the script, then the script will see if the number is greater than its local version, if it is greater than the scripts local version it will update itself. This also means that you need to update the scripts variable $current_version otherwise the sript will repeat download itself each time world boots up.


bool Database::CheckDatabaseConversions() {

	/* Fetch Automatic Upgrade Script */
	if (!std::ifstream("eqemu_update.pl")){
		std::cout << "Pulling down automatic database upgrade script..." << std::endl;
#ifdef _WIN32
		system("perl -MLWP::UserAgent -e \"require LWP::UserAgent;  my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; my $response = $ua->get('https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/eqemu_update.pl'); if ($response->is_success){ open(FILE, '> eqemu_update.pl'); print FILE $response->decoded_content; close(FILE); }\"");
		system("wget --no-check-certificate -O eqemu_update.pl https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/eqemu_update.pl");

		Automatic (Database) Upgrade Script
		Script: eqemu_update.pl V 1 - the number that world passes to the script will
		force the script to check for a newer version to update itself with
		eqemu_update.pl ran_from_world - won't bring up a menu if your database versions match
		eqemu_update.pl - ran standalone will bring up a menu prompt

	/* Check for a new version of this script, the arg passed
	would have to be higher than the copy they have downloaded
	locally and they will re fetch */
	system("perl eqemu_update.pl V 2"); 

	/* Run Automatic Database Upgrade Script */
	system("perl eqemu_update.pl ran_from_world");

	return true;

§Example of script updating itself: