#6147: Using console script to update a Postgres database fails with syntax
error
-----------------------------+----------------------------------------------
Reporter: chrisbdaemon | Type: Bug
Status: new | Priority: Medium
Milestone: 1.2.x.x | Component: PostgreSQL
Version: 1.2 Final | Severity: Normal
Keywords: | Php_version: PHP 5
Cake_version: 1.2.1.8004 |
-----------------------------+----------------------------------------------
There seems to be a problem in schema updating for postgresql that causes
postgres to throw a syntax error.
Here is the column details (from the perspective of a database dump):
{{{
"id" int4 not null
}}}
and here is the entry in the CakePHP generated schema file:
{{{
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL,
'length' => 11, 'key' => 'primary'),
'indexes' => array('PRIMARY' => array('unique' => true, 'column' => 'id'))
}}}
When I run 'schema run update' on the console script it attempts to
execute this query:
{{{
ALTER TABLE "tablename"
ALTER COLUMN "id" TYPE serial NOT NULL,
ADD PRIMARY KEY (id);
}}}
Which makes PostgreSQL complain about a syntax error near "NOT"
--
Ticket URL: <https://trac.cakephp.org/ticket/6147>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---