Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

What about foreign keys?

Post Reply
jcramos
Posts: 1
Joined: Mon Aug 10, 2009 6:29 pm

What about foreign keys?

Unread post by jcramos »

In your nuBuilder Documentation > Naming Conventions > Primary Key, you say that the PK "shoud be a varchar(15)".
How can i keep my own PK's and their referential integrity?
Can I use InnoDB tables or only MyISAM?

Thanks for the program. I also think that's not necessary reinvent the wheel.
steven
Posts: 218
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 1 time

Re: What about foreign keys?

Unread post by steven »

jcramos,

At the moment its only MyISAM.

We have designed nuBuilder to take care of Primary Keys by automatically using unique id strings (using PHP's uniqid() function).

This obviously is the same for the Foreign Keys.

We chose not to use Auto IDs 1,2,3 etc because it would make it harder to port later to any other database, if that were ever required.

The important part is, as you referred to, these fields need to be varchar(15) or bigger.

If you currently have PKs and FKs in any string format, nuBuilder will work with what you've got and just create uniqid() strings for new records.

If you are using numbers you will need to convert them to strings and cleverly prefix them with zeros (if you want them to remain properly ordered).

I hope this helps.

Let us know how you go!
If you like nuBuilder, how about leaving a nice review on SourceForge?
Post Reply