Welcome Guest, Not a member yet? Register   Sign In
Using dbforge?
#8

[eluser]Unknown[/eluser]
Not sure when this changed but...

to do this now (CI Version: 2.1.2), the code should be as follows:

Code:
$this->dbforge->add_field(array(
      'id' => array(
          'type' => 'INT',
          'constraint' => 11,
          'auto_increment' => TRUE
        ),
      'date TIMESTAMP DEFAULT CURRENT_TIMESTAMP',
      'name' => array(
        'type' => 'VARCHAR',
        'constraint' => 255,
        'default' => 'John Smith'
      )
));

... with extra fields (id, name) to give context.

So you can pass the whole definition for a field as a string instead of passing an array.
Also - if you just pass the string 'id' it'll auto convert to :

Code:
'id' => array(
  'type' => 'INT',
  'constraint' => 9,
  'auto_increment' => TRUE
)




Messages In This Thread
Using dbforge? - by El Forum - 09-16-2010, 06:01 AM
Using dbforge? - by El Forum - 09-16-2010, 06:41 AM
Using dbforge? - by El Forum - 09-16-2010, 08:00 AM
Using dbforge? - by El Forum - 09-16-2010, 09:42 AM
Using dbforge? - by El Forum - 09-16-2010, 09:55 AM
Using dbforge? - by El Forum - 09-16-2010, 01:48 PM
Using dbforge? - by El Forum - 06-17-2011, 06:03 PM
Using dbforge? - by El Forum - 08-02-2012, 02:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB