当我使用PostgreSQL数据库运行doctrine:build-schema
时,我发生了一件奇怪的事情。当然,它应该可以工作,但我得到了这个:
jason@ve:~/salon$ ./symfony doctrine:build-schema
>> doctrine generating yaml schema from database
SQLSTATE[42P01]: Undefined table: 7 ERROR: missing FROM-clause entry for table "t"
LINE 6: ... t.typtype ...
^. Failing Query: "
SELECT
ordinal_position as attnum,
column_name as field,
udt_name as type,
data_type as complete_type,
t.typtype AS typtype,
is_nullable as isnotnull,
column_default as default,
(
SELECT 't'
FROM pg_index, pg_attribute a, pg_class c, pg_type t
WHERE c.relname = table_name AND a.attname = column_name
AND a.attnum > 0 AND a.attrelid = c.oid AND a.atttypid = t.oid
AND c.oid = pg_index.indrelid AND a.attnum = ANY (pg_index.indkey)
AND pg_index.indisprimary = 't'
AND format_type(a.atttypid, a.atttypmod) NOT LIKE 'information_schema%'
) as pri,
character_maximum_length as length
FROM information_schema.COLUMNS
WHERE table_name = 'salon'
ORDER BY ordinal_position"
知道为什么会这样吗?
糟糕的部分是,即使我可以修复SQL查询,真正的问题是symfony / Doctrine没有按预期工作。 Doctrine声称支持PostgreSQL,似乎其他人使用PostgreSQL build-schema
没有问题,所以这很奇怪。
我正在使用symfony 1.4.8和Doctrine 1.2。
答案 0 :(得分:2)
t.typtype
条款在那里没有任何意义。在这方面,查询被打破了。你应该向作者报告。
答案 1 :(得分:1)