These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

API - Transaction and journal ids

Author
Selaria Unbertable
Bellator in Capsulam
#1 - 2013-11-19 15:16:10 UTC
Hello,

My question regards the API calls for transactions and journal entries for multiple characters/corporations.
I have three tables where I store the data: one for each character journal entries and transactions and one for corporation journal entries. I would like to store data for more than one character/corporation in each table, so the question at hand is:

Do the transactionIDs/refIDs of those overlap for different characters or corporations? Do they get renumbered from time to time?
As I am currently using them as primary keys, that could be an issue in the long run.

Thanks for your answers.

Regards
Drailen
Doomheim
#2 - 2013-11-19 16:06:55 UTC
The transactionID/refID is not unique to each character/corporation. As an example, a character transferring isk to another one will have the same refID in both character's journal API.

There was some discussion on it a few years ago and I think the only thing that has changed since then is that the refID is now a 64-bit integer (so recycling refIDs shouldn't be much of a problem now). It gives some good examples of different primary key combinations to use.

http://www.eve-search.com/thread/764508-0/page/1

Selaria Unbertable
Bellator in Capsulam
#3 - 2013-11-20 10:47:24 UTC
Thanks for the clarification. I assumed that the ids would not really be unique, and already added another primary key to my tables.
Hel O'Ween
Men On A Mission
#4 - 2013-11-20 16:34:57 UTC
Selaria Unbertable wrote:

I have three tables where I store the data: one for each character journal entries and transactions and one for corporation journal entries. I would like to store data for more than one character/corporation in each table, so the question at hand is:


Why not use just two tables? Column-wise there isn't any difference between corporation and character data, so a single table for journal entries, with a flagging column for char/corp and a single table for transactions, again with a flag for char/corp does the job quite well for me.

EVEWalletAware - an offline wallet manager.

Selaria Unbertable
Bellator in Capsulam
#5 - 2013-11-20 16:42:35 UTC
Hel O'Ween wrote:
Selaria Unbertable wrote:

I have three tables where I store the data: one for each character journal entries and transactions and one for corporation journal entries. I would like to store data for more than one character/corporation in each table, so the question at hand is:


Why not use just two tables? Column-wise there isn't any difference between corporation and character data, so a single table for journal entries, with a flagging column for char/corp and a single table for transactions, again with a flag for char/corp does the job quite well for me.


Already using different tables for journal and transactions ;)
One for the characters' journals, one for the corp's journal, and one for the characters' transactions.
I find using different tables for corporation/character data better due to foreign key constraints and queries with joins. Though you are right, the tables are equal in all but one column for the corp resp. character id.

But as I am still developing, I might give your suggestion a try.