>trade.py buildcache -f
*** INTERNAL ERROR: UNIQUE constraint failed: System.name
CSV File: data\System.csv:1117
SQL Query: INSERT INTO System (name,pos_x,pos_y,pos_z,added_id,modified) VALUES(?,?,?,?,(SELECT Added.added_id FROM Added WHERE Added.name = ?),?)
Params: ['Aiabiko', '-82.0625', '1.625', '-14.4375', 'Gamma-Inferred', '2014-11-22 13:56:23']
Downloaded the latest version. Downloaded the very small databases and files from maddavo's site. Tried many thinks to add some data to where I've been plonked in the Gamma. Usually the same error. Error below.
Code:>trade.py buildcache -f *** INTERNAL ERROR: UNIQUE constraint failed: System.name CSV File: data\System.csv:1117 SQL Query: INSERT INTO System (name,pos_x,pos_y,pos_z,added_id,modified) VALUES(?,?,?,?,(SELECT Added.added_id FROM Added WHERE Added.name = ?),?) Params: ['Aiabiko', '-82.0625', '1.625', '-14.4375', 'Gamma-Inferred', '2014-11-22 13:56:23']
Have checked the .prices file and the .csv files, there are no duplicated lines/sections.
As an aside, interesting that there is hardly any data, but there is data for the system where I have been put.
>trade.py update "Tokubei Ring"
*** INTERNAL ERROR: NOT NULL constraint failed: ShipVendor.station_id
CSV File: data\ShipVendor.csv:2
SQL Query: INSERT INTO ShipVendor (ship_id,station_id,cost) VALUES((SELECT Ship.ship_id FROM Ship WHERE Ship.name = ?),(SELECT Station.station_id FROM Station WHERE Station.name = ?),?)
Params: ['Cobra', 'Aulin Enterprise', '0']
So I've tried redownloading all your data maddavo, and now I have this error.
I've just noticed there's a saitek folder. What is that for please?
trade.py run --cr 100 --ly 7.56 --cap 4 --fr Aiabiko --hops 3 --check --x52
Downloaded the latest version. Downloaded the very small databases and files from maddavo's site. Tried many thinks to add some data to where I've been plonked in the Gamma. Usually the same error. Error below.
Code:>trade.py buildcache -f *** INTERNAL ERROR: UNIQUE constraint failed: System.name CSV File: data\System.csv:1117 SQL Query: INSERT INTO System (name,pos_x,pos_y,pos_z,added_id,modified) VALUES(?,?,?,?,(SELECT Added.added_id FROM Added WHERE Added.name = ?),?) Params: ['Aiabiko', '-82.0625', '1.625', '-14.4375', 'Gamma-Inferred', '2014-11-22 13:56:23']
Have checked the .prices file and the .csv files, there are no duplicated lines/sections.
As an aside, interesting that there is hardly any data, but there is data for the system where I have been put.
unq:name,pos_x,pos_y,pos_z,name@Added.added_id,modified
name@System.system_id,unq:name,ls_from_star
Aulin Enterprise isn't in the Station.csv - someone needs to go there and enter some prices. The ShipVendor.csv file refers to some stations that aren't in the Station.csv .
Delete all but the first line in the ShipVendor.csv
td>trade.py update "Virtanen Ring"
trade.py: ERROR: Unrecognized origin station: Virtanen Ring
trade.py update "Virtanen Ring"
*** INTERNAL ERROR: NOT NULL constraint failed: Station.system_id
CSV File: data\Station.csv:27
SQL Query: INSERT INTO Station (system_id,name,ls_from_star) VALUES((SELECT System.system_id FROM System WHERE System.name = ?),?,?)
Params: ['LTT 16764', 'Virtanen Ring', '0']
So how will ShipVendor.csv be updated going forwards?
But I've done as you suggest thanks, and now I get this.
Code:td>trade.py update "Virtanen Ring" trade.py: ERROR: Unrecognized origin station: Virtanen Ring
If add that station to staion.csv and try again, I get:
Code:trade.py update "Virtanen Ring" *** INTERNAL ERROR: NOT NULL constraint failed: Station.system_id CSV File: data\Station.csv:27 SQL Query: INSERT INTO Station (system_id,name,ls_from_star) VALUES((SELECT System.system_id FROM System WHERE System.name = ?),?,?) Params: ['LTT 16764', 'Virtanen Ring', '0']
Looking in the system.csv file, I can see the system is not there, but don't know how to add the LTT 16764 system, as I don't know co-ordinates, so now I'm stuck.
(I did a small test, and added a line to system.csv with some fake co-ordinates, and trade.py would then run). Am I missing something here?
As an aside, after I added the station to station.csv and got that 2nd error, how does the programme know that the station is in the ''LTT 16764" system, when the system isn't in the databases?
So how will ShipVendor.csv be updated going forwards?
But I've done as you suggest thanks, and now I get this.
Code:td>trade.py update "Virtanen Ring" trade.py: ERROR: Unrecognized origin station: Virtanen Ring
If add that station to staion.csv and try again, I get:
Code:trade.py update "Virtanen Ring" *** INTERNAL ERROR: NOT NULL constraint failed: Station.system_id CSV File: data\Station.csv:27 SQL Query: INSERT INTO Station (system_id,name,ls_from_star) VALUES((SELECT System.system_id FROM System WHERE System.name = ?),?,?) Params: ['LTT 16764', 'Virtanen Ring', '0']
Looking in the system.csv file, I can see the system is not there, but don't know how to add the LTT 16764 system, as I don't know co-ordinates, so now I'm stuck.
(I did a small test, and added a line to system.csv with some fake co-ordinates, and trade.py would then run). Am I missing something here?
As an aside, after I added the station to station.csv and got that 2nd error, how does the programme know that the station is in the ''LTT 16764" system, when the system isn't in the databases?
@maddavo: Can you change the first line of your System.csv and Station.csv:
System.csv
Code:unq:name,pos_x,pos_y,pos_z,name@Added.added_id,modified
Station.csv
Code:name@System.system_id,unq:name,ls_from_star
Then TD can do the uniqueness check itself and give better feedback.