sentinel icon indicating copy to clipboard operation
sentinel copied to clipboard

[4.0] Add Foreign Keys

Open stijntilleman opened this issue 9 years ago • 9 comments

Hi,

I just notices there are no database relationships defined in the migrations and .sql files provided with sentinel.

Wouldn't it be better to add these relationships by default?

stijntilleman avatar Feb 12 '16 10:02 stijntilleman

If you mean foreign keys, we currently don't have any plans to add these.

If that's not it, please elaborate what you mean by relations on the .sql files.

brunogaspar avatar Feb 12 '16 10:02 brunogaspar

I mean foreign keys indeed.

Is there any reason why you won't implement them?

stijntilleman avatar Feb 12 '16 10:02 stijntilleman

https://github.com/cartalyst/sentinel/issues/40 which comes from https://github.com/cartalyst/sentry/pull/106

I honestly don't really mind having them, but i would prefer avoid adding them now (to the current version) and prefer that you add them on your end with a migration, like @bencorlett suggested.

What we can do though, is to add FK's to Sentinel 3 and i can mark this "issue" as a proposal and pretty much target it to Sentinel 3.

Thoughts?

brunogaspar avatar Feb 12 '16 10:02 brunogaspar

I will add them via a migration for the time being.

For Sentinel 3 I would propose to add them to ensure readability when creating large database models, with the sentinel migration (out of the box).

cheers.

stijntilleman avatar Feb 12 '16 11:02 stijntilleman

Awesome.

I've renamed the title and added a label to it.

brunogaspar avatar Feb 12 '16 11:02 brunogaspar

We'll be adding FK's on the next version.

brunogaspar avatar Feb 17 '16 11:02 brunogaspar

Nice. For now, i'm adding they within a new migration file.

ghost avatar Mar 03 '16 04:03 ghost

@ricardovigatti can you give me - a newbie here - a brief idea of what is a migration file here and how can I use it?

odahcam avatar Aug 11 '17 04:08 odahcam

@odahcam, i've been using Sentinel within Laravel. From they docs:

Migrations are like version control for your database, allowing your team to easily modify and share the application's database schema.

https://laravel.com/docs/5.4/migrations

ghost avatar Aug 11 '17 12:08 ghost