statamic / eloquent-driver

Provides support for storing your Statamic data in a database, rather than flat files.
https://statamic.dev/tips/storing-content-in-a-database
MIT License
104 stars 72 forks source link

Split entries in separate tables #169

Closed goellner closed 1 year ago

goellner commented 1 year ago

Is there any way to split entries in the db into different tables? currently they are all stored in the entries table and it makes it super hard to write a migration from another cms/stack.

example:

old project: two db tables: recipes and ingredients

recipe tables has a pivot table ingredient_recipe where i store multiple ingredients per recipe.

I would set recipes and ingredients up as statamic collections, then link to multiple ingredients on the recipe entry

I have to write a huge mapping file, since i can't have a recipe with id 1 and an ingredient with ingredient 1, but thats what the old stack used.

do yo think it makes sense to split the entries table into multiple tables. so every collection has its own table in the db? e.g. collection_recipes and collection_ingredients

jackmcdade commented 1 year ago

You could fork this package and make changes to support it, but that’s not the goal of this particular driver. We wanted something “one-size-fits-most”, instead of “every-site-needs-extra-config”.

ryanmitchell commented 1 year ago

If you want relationships and seperate tables then I would suggest using Duncan's runway add-on: https://runway.duncanmcclean.com