Re: Trying to understand DOL Database
PostPosted: Fri Jul 19, 2013 4:42 pm
OK I made a quick and dirty script to convert Dol Pub DB to current SVN DolServer
I'll clean it up and post it if it's useful...
that brought up some questions too
I think some Secondary Key or Old Primary key are still in there and should be deprecated
- crafteditem.crafteditem_id : changed to a unique constraint but is not primary key, and not used to reference anything (it's just a duplicated primary for me...)
- dbhouse.price : not there anymore
- dbhouse.OwnerIDs : not there anymore, dbhouse.OwnerID still here, and in pub db there was data in OwnerIDs and none in OwnerID, maybe I even made something wrong, as being an empty player database these should be empty in database release ?
house_hookpointoffset : deprecated table ? I copied some data to househookpointoffset (replacement ?) that didn't looked like duplicate... (I used "HouseModel, HookpointID" as a primary key)
itemtemplate.itemTemplate_ID : deprecated Field ? Unique constraint, not referenced by anything, not Primary...
keepcomponent.Height : gone... maybe moved to keephookpoint ? I looked in codebase there doesn't seems to be much Height data from DB in keepcomponent code (I saw a query for keephookpoint.Height but maybe it was overwritten farther depending on keep level...)
language : table deprecated in favor of other language tables ?
staterequipment.FreeItem_ID : it was a primary key moved to StarterEquipment_ID which was used as "splittable" field for items i think, there was some fields without data, by watching records I've seen some rows had the "splittable" in the Class field or in the StarterEquipment_ID field... I wrote a query to copy everything from StarterEquipment_ID to Class where Class is empty, then changed FreeItem_ID to StarterEquipment_ID
Above all this there are much "PackageID" fields who aren't created by DolServer, I think they look more like "comments" than any "ID" thing...
For all field that moved to unique constraints I changed value for incremental Integer then moved the field to Auto_increment to prevent duplicate key on further inserts... I'm pretty sure they can simply be deleted, but haven't tested yet...
I'll clean it up and post it if it's useful...
that brought up some questions too

I think some Secondary Key or Old Primary key are still in there and should be deprecated
- crafteditem.crafteditem_id : changed to a unique constraint but is not primary key, and not used to reference anything (it's just a duplicated primary for me...)
- dbhouse.price : not there anymore
- dbhouse.OwnerIDs : not there anymore, dbhouse.OwnerID still here, and in pub db there was data in OwnerIDs and none in OwnerID, maybe I even made something wrong, as being an empty player database these should be empty in database release ?
house_hookpointoffset : deprecated table ? I copied some data to househookpointoffset (replacement ?) that didn't looked like duplicate... (I used "HouseModel, HookpointID" as a primary key)
itemtemplate.itemTemplate_ID : deprecated Field ? Unique constraint, not referenced by anything, not Primary...
keepcomponent.Height : gone... maybe moved to keephookpoint ? I looked in codebase there doesn't seems to be much Height data from DB in keepcomponent code (I saw a query for keephookpoint.Height but maybe it was overwritten farther depending on keep level...)
language : table deprecated in favor of other language tables ?
staterequipment.FreeItem_ID : it was a primary key moved to StarterEquipment_ID which was used as "splittable" field for items i think, there was some fields without data, by watching records I've seen some rows had the "splittable" in the Class field or in the StarterEquipment_ID field... I wrote a query to copy everything from StarterEquipment_ID to Class where Class is empty, then changed FreeItem_ID to StarterEquipment_ID
Above all this there are much "PackageID" fields who aren't created by DolServer, I think they look more like "comments" than any "ID" thing...
For all field that moved to unique constraints I changed value for incremental Integer then moved the field to Auto_increment to prevent duplicate key on further inserts... I'm pretty sure they can simply be deleted, but haven't tested yet...