Is it necessary to prefix sub tables with main table names only if you use custom databases, or it is also necessary if you use Database Manager?
I don't think I ever use this naming convention. Eg if I had these tables:
customers > orders > order items
.. if I understand correctly, I would have to have to name the last table something like orders_orderitems. If I wanted to create a query with orders nested within customers, does that mean I would have to name the orders table, customers_orders (and therefore rename the last table customers_orders_orderitems)?
I've probably misunderstood how the new feature works. and perhaps it's not in fact necessary to adopt this naming convention.
(I don't think I ever think about 'sub tables' - perhaps 'child tables' but it's a matter of context.)
You seem to have already the right naming convention which is pretty much standard.
So directly related sub tables like in your case order_items are prefixed with the main table “order”
Plurals or singulars are considered so a match should be found.
That's good as that was one slight problem. Does there have to be a separator - eg would it have to be order_items or would be orderitems work too? (I have projects with both forms - due to inconsistency on my part).
Perhaps there is still a problem, using my example, in that I would need my orders table to be customer_orders (which I would never normally use), and therefore my orderitems table would be customer_order_orderitems.
Anyway, I'm sure it will make more sense when I actually try out the new feature (when the PHP version is available). Also, it's not as it it's a critical feature - just a useful option if appropriate.
The naming convention is according to Laravel’s convention (edit: just the reference naming)
I’m pretty lost what to do, despite the feature looking exciting!
Edit: I probably didn’t set book_id as reference, but rather an integer
Edit 2: it’s simply not working, if I create a subtable, run the migrations, the subtable disappears from the DB manager and acts like the old view instead