As of revision ac4dc7f, database updates located in sql/updates will now update automatically.

Of course if you enable it in oregoncore.conf:

  • set DatabaseUpdater.Enable to 1

  • set DatabaseUpdater.PathToUpdates properly

If you have already applied some updates you have two options:

  • either continue applying them manually

  • or reinstall your database:

  • run create_mysql.sql

  • run realmd.sql on realmd database

  • run characters.sql on characters database

  • run world.sql on world daabase

  • run oregon_database.sql (from zip) on world database

  • run the core, updates will be applied automatically

  • or... run this on "realmd" and "characters" databases:

CREATE TABLE IF NOT EXISTS version ( db_revision INT UNSIGNED NOT NULL DEFAULT 0 ) engine = InnoDB;
INSERT INTO version VALUES (0);

  and this on world database:

ALTER TABLE version ADD COLUMN db_revision INT UNSIGNED NOT NULL DEFAULT 0 AFTER core_revision

  next you have to update the db_revision column to value of your latest applied sql updates,
  so this goes on all three databases:

UPDATE version SET db_revision = <latest-revision-you-applied-for-this-database-from-sql-updates>

  Note: the revision of update is its starting number. For example 1603_spell_affect.sql - revision is 1603

Example:

Let's say my latest applied updates are these:

  • for realmd it is sql/updates/realmd/1617_refer_a_friend.sql

  • for characters it is sql/updates/characters/2657_groups.sql

  • for world it is 2702_raf_commands.sql

  I run first two sql queries on realmd and characters databases,
  then I run the third query on world database.

  Next I update the db_revision field:

  • for realmd: UPDATE version SET db_revision = 1617

  • for characters: UPDATE version SET db_revision = 2657

  • for world: UPDATE version SET db_revision = 2702

  That's All, from this point core will automatically apply new updates,
  as the development comes forward.

  Note: oregoncore.conf.dist got updated, don't forget to use the new version


Enjoy.

"A little hard-work never killed anyone important." - Abe

looking forward to use this system, thanks for all the great work!!

is this system backported from TrinityCore auto updater or is this made from scratch?

i think backported from TC Desteny.

Made from scratch. Trinitys behaves differently in a number of ways, the most standout one being it calculates hashes of files and works out which files have been ran by looking for hashes it doesn't recognize. Here we use the revision number, which is appended to the start of each SQL update, and then a simple check amongst a DB value.

Made from scratch. This was 70% done even before Trinity came with it.

"A little hard-work never killed anyone important." - Abe

well done guys!!!

Working great, only one problem, if start with a empty database the 1949_ip2nation.sql dont work

2015-06-01 23:21:17 SQL ERROR: Commands out of sync; you can't run this command now
2015-06-01 23:21:17 Cannot turn multi-statements on: Commands out of sync; you can't run this command now

Very weird, I tested this on "from-scratch" database several times as well as migrating from an existing database. Did you follow the sql/readme ?Also make sure you're on the latest revision and you don't have any junk files in the updates directories.

"A little hard-work never killed anyone important." - Abe

Maybe its because query too big? prevent DB import?

Yes i followed the readme exactly, i dont think the query is to big, because if i execute the script via sqlyog it workd and returns the nothing to do result.

but maybe our mysql server setup cause this script returns a select. Normaly this scrpts return nothing... But there is a generated select query added for revision table select. This returns a result. Cause of this we have multiple results. This is the error message. To reproduce add a simple select in a update file.

Should be fixed now in https://bitbucket.org/oregon/oregoncore … 1d24d8629a

"A little hard-work never killed anyone important." - Abe

works perfectly now smile nice work

14 (edited by satlock 2016-10-03 17:21:22)

I have manually applied the updates in the source's sql/updates folder. which would be the easiest way to determine wether i have missed one, other than "reading" them and looking up the data in the db to see if it is updated?

And the latest sql update i have for world is "2016_05_14_haramad_teleport", which revision would that be?

Updates applied are stored in `updates` table of each database. You can check the revision with git history or github, just navigate to the file and check the commit that has created it.

"A little hard-work never killed anyone important." - Abe

nice work!