[SOLVED] Foreign key different than 'id'

Forum for posting problems using QxOrm library

[SOLVED] Foreign key different than 'id'

Postby Ever » Fri Oct 11, 2013 9:34 am

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");
Last edited by Ever on Sun Oct 13, 2013 5:45 pm, edited 1 time in total.
Ever
 
Posts: 2
Joined: Fri Oct 11, 2013 9:29 am

Re: Foreign key different than 'id'

Postby qxorm » Fri Oct 11, 2013 2:47 pm

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 ?
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Foreign key different than 'id'

Postby Ever » Sun Oct 13, 2013 5:45 pm

Problem was with primary key.
Database is MySql and primary key needed to be set to Auto Increment.
Now works.
Ever
 
Posts: 2
Joined: Fri Oct 11, 2013 9:29 am

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

Postby qxorm » Mon Oct 14, 2013 7:07 am

Now works.

Great !
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 15 guests