Commit graph

14 commits

Author SHA1 Message Date
Eevee 398545a77f Make help message readable for people without a UTF-8 terminal. 2009-07-28 18:31:06 -07:00
Eevee d997e27112 Changed exception syntax to work with Python 2.5. 2009-07-28 08:25:11 -07:00
Eevee 64d3c7d5f1 Fixed csvexport to write in primary key order.
Good news: This no longer relies on InnoDB's default row order.

Bad news: InnoDB in MySQL 5.0 has a bug where it will sort rows
physically according to a secondary index, if there's a composite
primary key and a single-column index and the phase of the moon is
right.  So a couple tables have been, once again, reordered -- but
correctly this time.

Good news: This bug will no longer fuck me up!
2009-07-26 22:19:27 -07:00
Eevee d4077cc71d Added command_ prefix to CLI commands to fix import problems. 2009-07-25 02:43:30 -07:00
Eevee b13ffac247 Pokédex lookup now uses a whoosh index and spell-checker. #15 2009-07-25 01:28:33 -07:00
Eevee 8fb0e550ad Stubbed in a simple lookup command. #15 2009-07-22 23:44:53 -07:00
Eevee 634ef3ed1e Fixed a slew of foriegn key import problems. #29
Curse's type_id was 0, which is bogus; this has been fixed by creating a
real ????? type.
Fourth-gen moves all had zero as a contest effect id, which was also
bogus.
Pokémon 494 and 495 were junk and have been scrapped entirely.
pokemon_form_groups's description column was too short.

pokedex's connect() now takes kwargs passed to sessionmaker().

A more major change: some tables, like pokemon, are self-referential and
contain rows that refer to rows later in the table (for example, Pikachu
evolves from Pichu, which has a higher id).  At the moment such a row is
loaded, the foreign key is thus bogus.  I solved this by turning on
autocommit and wrapping add() in a try block, then attempting to readd
every failed row again after the rest of the table is finished.  Slows
the import down a bit, but makes it work perfectly with foreign key
checks on.
2009-07-03 23:12:13 -04:00
Eevee 15ee3fcccf Fixed csvimport to load in table dependency order. 2009-05-28 21:16:18 -07:00
Eevee 8812dd9654 Fixed table loading under SQLAlchemy 0.5.3.
Apparently the secret property on a singleton hidden in the guts of
SQLAlchemy has been made private recently, so what I wanted to do (get a
list of all ORM classes) is now impossible.  I gave up on trying to find
a real solution and just slapped together something using dir().
2009-05-02 17:44:26 -07:00
Eevee d9a2d96ede Made csvimport somewhat tolerant of load errors.
It used to abruptly abort if a csv file were missing, which wasn't very
nice when I'd just added a new table definition and was trying to reload
everything else.

Now it prints a status per table while loading, and will declare missing
tables to be...  missing.
2009-05-01 06:24:09 -07:00
Eevee 85ee27dedd Fixed CSV import's handling of Boolean columns. 2009-03-25 20:43:09 -04:00
Eevee ac325b620d CSV import now respects NULLability of columns.
Empty strings loaded into NULL columns are changed to NULL instead.
2009-03-08 21:34:48 -04:00
Eevee 20c9c23f51 Fixed some MySQL import problems.
Tables weren't being defined as UTF-8 if that wasn't the server default.

A lot of tables were trying to create erroneous auto_increment columns.

Foreign key checks were pretty much fucking everything up.
2009-03-07 18:54:01 -08:00
Eevee bad044d1d8 Initial commit, with much of the data imported.
Includes a wrapper script 'pokedex' that can, so far, read data from a
db and spit out CSVs or deploy CSVs to a db.
2009-02-05 00:05:42 -08:00