Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
DBUtil | modify_fields | Change name to column
  • Hi, everyone.

    I need change the name of an column into specific table.

    How can i do it usig DBUtil?

    Thanks
  • HarroHarro
    Accepted Answer
    \DBUtil::modify_fields('table', array(
        'old-name' => array('name' => 'new-name'),
    ));

    It might be that you need to repeat a few other values too, I can't recall from memory if some are required.
  • One more question:

    How to set a attribute:

    'BINARY','UNSIGNED','UNSIGNED ZEROFILL','on update CURRENT_TIMESTAMP'

    with this DBUtil.
    Thanks
  • HarroHarro
    Accepted Answer
    Binary is a column type, just like all others.

    array(
        'unsigned' => true,
    ),

    The others are not supported as they are specific to MySQL while the current DB layer has to be generic enough to work on other platforms too.

    Both the ORM and Model_Crud have built-in support for adding timestamps on both insert and update.

Howdy, Stranger!

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

In this Discussion