fuel / oil

Fuel PHP Framework - Fuel v1.x Oil command-line package
http://fuelphp.com/docs/packages/oil/intro.html
106 stars 67 forks source link

Added support for generating nestedset and temporal model #220

Closed sagikazarmark closed 10 years ago

sagikazarmark commented 10 years ago

There are some questions left, so before merging those should be answered.

Temporal and nestedset need their own primary keys, which is currently not supported by the current implementation of MIGRATION. I can imagine an option :primary_key[1] to add that property to the array of primary_keys. And this could be done for :key[1] as well for nestedset, but that is optional.

Timestamps: in temporal and nestedset using created_at and updated_at timestamps make no sense. The default value of no-timestamp option could be true when using temporal and nestedset so these timestamps would be excluded from the model by default.

I also made some modifications, eg. it seemed to be logical moving model creation out of no-timestamp option check. The soft-delete model was there so first time I placed nestedset and temporal there, but I think soft-delete is out of no-timestamp's scope, so now there can be a soft model generated even if you use no-timestamp option.

I also decided to change some things in order. Now the "key" fields (except deleted_at) is placed after the id.

sagikazarmark commented 10 years ago

I also would like to add the new models and some undocumented features (eg :unsigned in a migration) to the docs

sagikazarmark commented 10 years ago

What about this?

WanWizard commented 10 years ago

Is this still valid? If so, any docs to go with this?

sagikazarmark commented 10 years ago

I do think it is valid. I have not add any docs (yet). There are also some questions in my first comments. Those need to be discussed first.