Neth
BETA Tester
I'm just posting the code here, the original post is here : http://www.trinitycore.org/f/topic/43-windowslinux-combine-sql-updates/
Windows :
Copy/paste the below source into a new Notepad++ file and save it as "gather updates.bat" (without quotes of course, and whatever you'd like to call it)
Drop it into your main Trinity\ source directory.
After each TrinityCore update that you do, double-click this .bat file to merge the new .SQL queries into 3 organized .SQL files to easily import them into your auth/characters/world databases.
Linux:
cd into your source/sql/updates directory and choose one of these options:
credits goes to Gregarious from TrinityCore
Windows :
Copy/paste the below source into a new Notepad++ file and save it as "gather updates.bat" (without quotes of course, and whatever you'd like to call it)
Drop it into your main Trinity\ source directory.
After each TrinityCore update that you do, double-click this .bat file to merge the new .SQL queries into 3 organized .SQL files to easily import them into your auth/characters/world databases.
Code:
@echo off
setlocal EnableDelayedExpansion
set WorldUpdates=All_World_Updates.sql
set CharactersUpdates=All_Characters_Updates.sql
set AuthUpdates=All_Auth_Updates.sql
if exist %CharactersUpdates% del %CharactersUpdates%
if exist %AuthUpdates% del %AuthUpdates%
if exist %WorldUpdates% del %WorldUpdates%
for %%a in (sql\updates\world\*.sql) do (
echo /* >>%WorldUpdates%
echo * %%a >>%WorldUpdates%
echo */ >>%WorldUpdates%
copy/b %WorldUpdates%+"%%a" %WorldUpdates%
echo. >>%WorldUpdates%
echo. >>%WorldUpdates%)
for %%a in (sql\updates\characters\*.sql) do (
echo /* >>%CharactersUpdates%
echo * %%a >>%CharactersUpdates%
echo */ >>%CharactersUpdates%
copy/b %CharactersUpdates%+"%%a" %CharactersUpdates%
echo. >>%CharactersUpdates%
echo. >>%CharactersUpdates%)
for %%a in (sql\updates\auth\*.sql) do (
echo /* >>%AuthUpdates%
echo * %%a >>%AuthUpdates%
echo */ >>%AuthUpdates%
copy/b %AuthUpdates%+"%%a" %AuthUpdates%
echo. >>%AuthUpdates%
echo. >>%AuthUpdates%)
Linux:
cd into your source/sql/updates directory and choose one of these options:
Code:
cat world/*.sql > all_world_updates.sql
cat characters/*.sql > all_characters_updates.sql
credits goes to Gregarious from TrinityCore