PDA

View Full Version : Tradeskill Table


krich
11-07-2003, 05:09 AM
While I was pulling together the Tradeskill database I snarfed from a major EQ Tradeskill website, I noticed an apparent issue in the tradeskillrecipe table. The table currently looks as such:

+--------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-------------+------+-----+---------+----------------+
| id | int(11) | | PRI | NULL | auto_increment |
| tradeskill | smallint(6) | | | 0 | |
| skillneeded | smallint(6) | | | 0 | |
| trivial | smallint(6) | | | 0 | |
| product | smallint(6) | | UNI | 0 | |
| product2 | smallint(6) | | | 0 | |
| failproduct | smallint(6) | | | 0 | |
| productcount | smallint(6) | | | 0 | |
| i1 | smallint(6) | | | 0 | |
| i2 | smallint(6) | | | 0 | |
| i3 | smallint(6) | | | 0 | |
| i4 | smallint(6) | | | 0 | |
| i5 | smallint(6) | | | 0 | |
| i6 | smallint(6) | | | 0 | |
| i7 | smallint(6) | | | 0 | |
| i8 | smallint(6) | | | 0 | |
| i9 | smallint(6) | | | 0 | |
| i10 | smallint(6) | | | 0 | |
| notes | text | YES | | NULL | |
+--------------+-------------+------+-----+---------+----------------+


The product row is tagged as unique. This presents an issue where there is more than one recipe for the same product. For example both of these recipes result in a Small Piece of Ore:

tarnished dagger + water flask
tarnished axe + water flask

Currently when the database is sourced, the first duplicate recipe is accepted and the rest of the duplicates generate errors.

Was this column created as unique for a reason? If not, could that be changed that so that multiple recipes for the same item could be created?

Regards,

krich

Lurker_005
11-13-2003, 03:33 PM
I don't know why it would be unique, and don't remeber any discusion about it. But there have been so many changes and I havn't been keeping track of anything for months...

Just try changing the default and see if things work... :D

Lurker_005
11-13-2003, 03:43 PM
I don't know why it would be unique, and don't remeber any discusion about it. But there have been so many changes and I havn't been keeping track of anything for months...

Just try changing the default and see if things work... :D

mattmeck
11-13-2003, 04:53 PM
THis was an issue in 4.4 that i ran into trying to do custom recipe's. it wouldnt let me have several diferent recipes that made the same thing.

Trumpcard
11-13-2003, 05:08 PM
I'll pull it out of the default db.sql

I keep thinking that Drawde asked me to put it in there for a reason, but I can't remember to save my life...

krich
11-13-2003, 05:57 PM
Thanks Trumpcard.

I'm not a mysql guru by any means, but if there's some way of making the series of ingredients unique, that would be a good thing. So like making a unique key out of (i1, i2, i3, i4, i5, i6, i7, i8, i9, i10) would be great. Not sure if it checks linearly for uniqueness or if it checks all combinations...anyone?

Regards,

krich

Merth
11-14-2003, 06:02 AM
A unique constraint over those fields would be fine with me. The fields are not nullable, which means you won't run into null != null.

killspree
11-14-2003, 07:28 AM
Unique keys for the ingredients would be a bad idea too unless I'm missing something. There are tons of recipes that take flask of water.

Trumpcard
11-14-2003, 08:00 AM
Not unique on a single field, unique on a subset of fields..

Say, item 1 + item2 + item 3 would need to be unique

mattmeck
11-14-2003, 08:06 AM
Unless changes were made with 5.0 it is already like that. In 4.4 item 1 + item 2 + items 3 = item 4, you cant use that combinations of items 1,2,3 again but you also cant have items 5,6,7 = 4 ether.

krich
11-14-2003, 12:52 PM
Unless changes were made with 5.0 it is already like that. In 4.4 item 1 + item 2 + items 3 = item 4, you cant use that combinations of items 1,2,3 again but you also cant have items 5,6,7 = 4 ether.

Actually, in 044, you could have 1+2+3=4 and 1+2+3=10 in the database. There was nothing preventing you from doing that. The combine will fail with an error because the code will check to see if two recipes come up when it tries to do the combine. This is why I requested a compound unique key be set up for all ingredients.

Also, you absolutely can (and must) have 1+2+3=4 and 5+6+7=4. Consider turning tarnished weapons into a small chunk of ore. I don't remember the exact recipes, but you could take basically any tarnished weapon plus a water flask and combine them in a forge to result in a small chunk of ore. Also, consider how many ways there are to make Celestial Essence. This is why the product column cannot be unique and this is why I requested it not be unique.

Regards,

krich