Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Creating indexes for fields in database
  • I've had a look through the Docs and as much as possible through the Core, but I can't find anywhere that allows me to add indexes for fields. For example, when using create_table() http://fuelphp.com/docs/classes/database/dbutil.html there's no way to add indexes other than the primary key. There doesn't appear to be a way to add them after either. For example:
    \DBUtil::create_table('news', array(
     'id'   => array(
      'type'    => 'int',
      'constraint'  => 5,
      'auto_increment' => true,
      'unsigned'   => true
     ),
     'title'   => array('type' => 'varchar', 'constraint' => 100),
     'body'   => array('type' => 'text'),
     'datetime'  => array('type' => 'datetime')
    ), array('id'), false, 'MyISAM', 'utf8_unicode_ci');
    

    Ideally datetime should have an index too.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!