From: lucktard <ntogden@gmail.com>
Date: Wed, 30 Sep 2009 12:16:06 -0500
Subject: [PATCH] Detect and import capped 6 max hands on FullTilt
and
From b35d23aba38935406cf1522ae07a49cd441318b3 Mon Sep 17 00:00:00 2001
From: lucktard <ntogden@gmail.com>
Date: Wed, 30 Sep 2009 12:21:34 -0500
Subject: [PATCH] Detect deep 6 max tables for HUD on FT
Conflicts:
pyfpdb/Database.py
Resolve by reverting to sqlcoder's version; it uses the nice insert in
fillDefaultData for each case now and having the DB backends separate
might be good for the foreseeable future.
Database.py : fillDefaultData()
Remove manual 'id' from INSERT command. In database schema,
TourneyTypes.id is a primary key and thus autoincrement. In postgres,
autoincrements are implemented as sequences - inserting a value
"manually" bypasses the sequence generation, which resulted in a
remarkably weird error.
Namely, upon the first hand to import, the insert fails due to primary
key violation. The default value from an unused sequence is 1, but a
row with such an id already exists.
The solution is to create the single row of default data values with
unspecified TourneyTypes.id, hence allowing postgres to generate the
correct id from the sequence. This way the import works again.
Database.py : fillDefaultData()
Sql-coder had fixed the default data insert, and in the process changed
the default type ID. Since his works in general case, I can remove my
modifications.
* Database.py : fillDefaultData()
PostgreSQL has a rather annoying (mis)feature when dealing with boolean
data types: raw 1/0 input as integer is not automatically cast to
boolean values. Instead, one must use one of several other ways of
signifying true/false.
http://www.postgresql.org/docs/8.4/static/datatype-boolean.html
documents the available and understood formatting.
Fix by special-casing PostgreSQL and making all boolean values fed as
strings, '1' for true and '0' for false.
PostgreSQL does not have an UNSIGNED specifier in its language.
Mysql's "TINYINT UNSIGNED" is postgreSQL's "SMALLINT" which is a bit
inconvenient but apart from annoying, not a problem.