Page 1 of 1

[SOLVED] Foreign key different than 'id'

PostPosted: Fri Oct 11, 2013 9:34 am
by Ever
Hello QxOrm Community,

I wonder is there way to change default foreign key name from 'id' to another one.

For example,

Code: Select all
t.relationManyToOne(& class_name::pointer_name, "foreign_key_name");

Re: Foreign key different than 'id'

PostPosted: Fri Oct 11, 2013 2:47 pm
by qxorm
Hi,

I wonder is there way to change default foreign key name from 'id' to another one.

There is no default foreign key name !
You can name it as you want.
What is your problem exactly ?

Re: Foreign key different than 'id'

PostPosted: Sun Oct 13, 2013 5:45 pm
by Ever
Problem was with primary key.
Database is MySql and primary key needed to be set to Auto Increment.
Now works.

Re: [SOLVED] Foreign key different than 'id'

PostPosted: Mon Oct 14, 2013 7:07 am
by qxorm
Now works.

Great !