chiark / gitweb /
where-vessels: icons for lock state too
[ypp-sc-tools.db-test.git] / yarrg / devel-notes
1
2 ceb's example route:
3   alpha,byrne,papaya,turtle,jorvik,luthien
4
5 example mixed arbitrage/trade
6   xi,heph
7
8 ========================================
9
10 To remedy bug fixed in 01c14767c024ac56686dbbfcd88d9f3a0b4b1574,
11 did this:
12
13 sqlite> begin;
14 sqlite> insert or ignore into stalls select null, buy.islandid, stalls.stallname from buy, stalls using (stallid);
15 sqlite> insert or ignore into stalls select null, sell.islandid, stalls.stallname from sell, stalls using (stallid);
16 sqlite> update buy set stallid = (select stallid from stalls where stalls.islandid == buy.islandid and stalls.stallname == (select stallname from stalls as bad where buy.stallid == bad.stallid));
17 sqlite> update sell set stallid = (select stallid from stalls where stalls.islandid == sell.islandid and stalls.stallname == (select stallname from stalls as bad where sell.stallid == bad.stallid));
18 sqlite> commit;
19
20 And to check that it worked:
21
22 sqlite> select * from buy offers, stalls using (stallid) where offers.islandid != stalls.islandid group by offers.islandid;
23 sqlite> select * from sell offers, stalls using (stallid) where offers.islandid != stalls.islandid group by offers.islandid;
24 sqlite>