Search code examples
fuelphpfuelphp-orm

Fuelphp: convert standard ORM model to model_temporal


Using fuelphp, is there a way to modify an existing \ORM\Model to convert it to \ORM\Model_Temporal? I started looking into creating a migration, which needs to 1) add the necessary columns to my table (not difficult); 2) update the primary key to include the new columns as part of a compound primary key (difficult). The problem I am having is that I don't see a method in the DBUtil that performs this operation.

What is the right way to do this?


Solution

  • Currently DBUtil does not include a way to alter primary keys because the method of doing so differs between DB systems and DBUtil is not actually that aware what DBMS you are using.

    To do this you will have to construct the query manually in your migration and use DB::query() to execute it.