OK i made some changed to the code as follows....
UP:
  create_table:
    users:
      username:
            type: varchar
            length: 100
            index: true
      password:
            type: varchar
            length: 100

  query:
    users: INSERT INTO users SET username = 'admin' and password=
'admin'


DOWN:
  query:
    users: DELETE FROM users WHERE username = 'admin' and password=
'admin'
  drop_table: users


It has successfully created the users table and the collumns i
require, including two additional ones i dont require(created,
modified)....
yet no data was inserted....where am i going wrong?

On Sep 29, 12:00 pm, forrestgump <[EMAIL PROTECTED]> wrote:
> Can someone tell me what is wrong with the following YAML code ? \
>
> UP:
>   create_table:
>     users:
>       id:
>             type: integer
>             length: 11
>             primary: true
>             autoincrement: true
>       username:
>             type: varchar
>             length: 100
>             index: true
>       password:
>             type: varchar
>             length: 100
>
>   query:
>     users: INSERT INTO users SET username = 'admin' and password=
> 'admin'
>
> DOWN:
>   drop_table: users
>   query:
>     users: DELETE FROM users WHERE username = 'admin' and password=
> 'admin'
>
> what i want it to do is, create a table users with fields
> [id,username,password] and then insert data into it
> [0,admin,admin]....wht YAML is doing for me is...
> it create a table users with fields [id,created,modified] and another
> table autoincrement with fields  [id,username,password] , and nothing
> gets inserted....
>
> I would really appreciate some help ive been stuck on this since 2
> days....im writing a short tutorial on cakephp migrations that i wish
> to share....and this will really help...
>
> Forrestgump
> (yes i know very original nick name :) )
--~--~---------~--~----~------------~-------~--~----~
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