Hi,

I really like the idea of the schema shell tool. I am looking to use
it on a rather big project that we are about to embark on, this would
be really useful. I am just messing around with it to see how to do
things and have run into a problem.

I have this table:

----------
create table users (
        id serial primary key,
        name varchar(200) not null,
        email varchar(200) not null,
        username varchar(20) not null,
        password varchar(200) not null,
        nickname varchar(20)
);
----------

I ran:

----------
cake schema generate
----------

and i got this schema.php:

----------
<?php
/* SVN FILE: $Id$ */
/* App schema generated on: 2008-07-04 16:07:50 : 1215184070*/
class AppSchema extends CakeSchema {
        var $name = 'App';

        function before($event = array()) {
                return true;
        }

        function after($event = array()) {
        }

        var $users = array(
                        'id' => array('type'=>'integer', 'null' => false, 
'default' =>
NULL, 'length' => 11, 'key' => 'primary'),
                        'name' => array('type'=>'string', 'null' => false, 
'length' =>
200),
                        'email' => array('type'=>'string', 'null' => false, 
'length' =>
200),
                        'username' => array('type'=>'string', 'null' => false, 
'length' =>
20),
                        'password' => array('type'=>'string', 'null' => false, 
'length' =>
200),
                        'nickname' => array('type'=>'string', 'null' => true, 
'length' =>
20),
                        'indexes' => array('0' => array())
                );
}
?>
----------

Then I go to the DB and drop the nickname column and then try and run:

----------
cake schema run update
----------

and I get this:

----------
Welcome to CakePHP v1.2.0.7296 RC2 Console
---------------------------------------------------------------
App : app
Path: /home/ziad/public_html/newmts/app
---------------------------------------------------------------
Cake Schema Shell
---------------------------------------------------------------
Comparing Database to Schema...
PHP Warning:  array_diff_assoc(): Argument #2 is not an array in /home/
ziad/public_html/newmts/cake/libs/model/schema.php on line 396

Warning: array_diff_assoc(): Argument #2 is not an array in /home/ziad/
public_html/newmts/cake/libs/model/schema.php on line 396

The following statements will run.


Are you sure you want to alter the tables? (y/n)
[n] > y

Updating Database...
users is up to date.
End update.
----------

Nothing changes in the database! I except the users table to have the
nickname column added but it doesn't.

Anybody have this problem? Any ideas how to fix this? I'd really like
to use this feature of Cake 1.2.

Thanks in advance.

p.s. I have Cake 1.2 RC2 and PostgreSQL 8.2
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to