Stream Migration - Add Foreign KeyCreated 6 years ago by kiltedup
When you create a stream via
php artisan make:stream, are there any options to add foreign key constraints to the migration that is created? Digging around docs and code and nothing is jumping out at me!
Stream migrations can still run the
down methods (which are run after the properties are handled like
$assignments) so you can add them there.
I would like to build up a few utilities to make it easier to define these and indexes too. Just haven't quite nailed it down in my head yet.
Ah - thats good. I added a separate migration with up/down so good to know I can do it in one place.
Getting the foreign constraints in has been a pain though - more to do with what I've been asked to add rather than the code.
But - noticed that relationship IDs are in table with INT (11) whereas Primary ID's are INT (10) .... is that intentional?
Actually, you could set it after module would be maiden. Inside
You could use for it one of the
anomalynamespace (or even custom). Relations could be assign with few of field types by setting of a model class which is EntityModel extender.
Try to look for working examples under the