smellyrat / drydock

Automatically exported from code.google.com/p/drydock
0 stars 0 forks source link

Merge threads and replies in database into one table #72

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am debugging SQLite right now (this bug is not appearing in MySQL), and
given the thread:
INSERT INTO test_threads VALUES ('2', '3', '1', NULL, NULL, NULL, NULL, 'AM
I HUMAN OR MACHINE', '1246790125', '1152623935', '0', '0', '1246790220',
NULL, '1', NULL, '0', NULL, '292a62ee3dc37333ec5d4836c002c7b1');, a reply
will either work or it will not, depending on the thread id and the view.

Here's a db dump of what works in board view but not thread view:
INSERT INTO test_replies VALUES ('2', '4', '1', '2', NULL, NULL, NULL,
'MACHINE', '1246790133', '1152623935', NULL, NULL, '0', NULL, '1', NULL,
NULL, NULL, '722ca7d10d249595e9c622703f3752b7');

And then in the thread view but not board overall:
INSERT INTO test_replies VALUES ('2', '4', '1', '3', NULL, NULL, NULL,
'MACHINE', '1246790133', '1152623935', NULL, NULL, '0', NULL, '1', NULL,
NULL, NULL, '722ca7d10d249595e9c622703f3752b7');

The difference is the 4th value.  It looks like one of them is pulling the
OP's id (2) and the other is the gid (3).  This leads me to several ideas.

1) fix this bug so that it will pull the correct id (which I think should
be the gid, because we should be querying board in the sql as well,
correct?  If not, we should do that in the future)
2) in the future, merge these two tables (they have the exact same
structure, threads have the 'thread' field left blank, whereas replies do
not, kind of like res vs resto on futaba) - the only problem would be
handling the ID field (which I'm not sure we would be using if we looked up
posts by their board, so we could drop it)
3) a script to upgrade to 032 (or whatever, if we merge them at all) to
merge _threads and _replies into _posts

The only problem I can see with this is that someone may end up with a
highly successful drydock installation (I doubt it) and have some issue
with merging, or once they're merged there may be performance issues.

Original issue reported on code.google.com by TaQS...@gmail.com on 7 Jul 2009 at 9:15

GoogleCodeExporter commented 9 years ago
Anyway so I fixed the bug and now I will reclassify this as a future to do.

I think merging these two tables is a good idea, but maybe I am wrong.

Original comment by TaQS...@gmail.com on 7 Jul 2009 at 9:59