Replies: 2 comments 1 reply
|
What does your model look like for the district table? Look at the section Breaking the Convention which may give you the answer. |
0 replies
|
Hi Peter, But, is it the right way? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi all
How can i make a reference column to a table with no auto-increment (column) id but with a string column for primary key?
This is the table with the string primary key (abbreviation):
t = createTable(name = 'districts', id=false); t.primaryKey(name = 'abbreviation', type='string', null=false, limit='2'); t.string(columnNames='distrName', null=false, limit='128'); t.integer(columnNames="codRegion", null=false, limit='2'); t.timestamps(); t.create(); addIndex(table = "districts", columnNames = "abbreviation", unique = true);In another table, how can i set a reference column to 'abbreviation' on 'district' table?
Thanks
All reactions