Foreign Key - Cuba

Hi community,

I am using the cuba-cli.
When I create a ManyToOne relation, I need to set up the columns in the mysql script.
But how do I set up the foreign key?
In the tutorial, it was not shown, how I will write it for the foreign key?
Or does the CLI will do it for me?
If yes, how?

Thanks a lot

Hi!

You should set up the columns manually. CUBA CLI doesn’t provide such functionality.
You can read about foreign keys in mysql here.

Ok,

so in fact, I does not need the mysql scripts in cuba?
Because, I can add them all manually in mysql, instead of these scripts?

Or what is the sense of this scripts in cuba?

Thanks

When I said to set up columns manually I meant to write scripts by hands, as CUBA CLI can not wirte them for you.

Okay,

I see,

thanks :slight_smile: