Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
adding the schema.php
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 06/23/09 08:27 
Your PRIMARY KEY definitions do not look correct, plus you really do not want to call them "number" (since "number" is an SQL reserved word). You definition should be something like this:


Code

$tbl = "CREATE TABLE {$jamroom_db['rt_carriers']} (
  rt_number INT(14) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  rt_extension VARCHAR(255) NOT NULL DEFAULT '',
  rt_name VARCHAR(255) NOT NULL DEFAULT ''
)";
dbVerifyTable($jamroom_db['rt_carriers'],$tbl);


There's no need to redefine the PRIMARY KEY as an index, since you are doing that on the column create. Also note how I added in "rt_" to the beginning of your column names - this ensures the column name will be unique in the event you have to JOIN it with a table that may not be under your control.

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
jamesd116



Joined: 05 Jun 2006
Posts: 1559
Location: Rochester Pa

Posted: 06/23/09 11:37 

smith.kyle:
Does your quota_rtCreator_access column get added to the Quota table?

Yes its adding it in I deleted it and ran it again just to double check and it does


bigguy:
Your PRIMARY KEY definitions do not look correct, plus you really do not want to call them "number" (since "number" is an SQL reserved word). You definition should be something like this:


Code

$tbl = "CREATE TABLE {$jamroom_db['rt_carriers']} (
  rt_number INT(14) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  rt_extension VARCHAR(255) NOT NULL DEFAULT '',
  rt_name VARCHAR(255) NOT NULL DEFAULT ''
)";
dbVerifyTable($jamroom_db['rt_carriers'],$tbl);


There's no need to redefine the PRIMARY KEY as an index, since you are doing that on the column create. Also note how I added in "rt_" to the beginning of your column names - this ensures the column name will be unique in the event you have to JOIN it with a table that may not be under your control.

Hope this helps!

- Brian

Thanks for the advise Brian I have done all you said the reason I used number is the script I am pulling from was using it so i figured it would be easier to use what was there because i really wanted to name them ****_id
I reran the script after the changes still nothing I am not sure why this is I have started and ran multiple modules on here without the problem. other than schema and i think its the include is there any other pages that affect this.


_________________
One day the court system will learn that a childs mother is not the only option...... Question is will it be too late by that time...
Back to top
jamesd116



Joined: 05 Jun 2006
Posts: 1559
Location: Rochester Pa

Posted: 11/14/09 14:56 
This is for my own purposes for later review
1) I need to remember not to put the comma after the final db field
2) Varchars do not use unsigned
3) INDEX probably not needed


_________________
One day the court system will learn that a childs mother is not the only option...... Question is will it be too late by that time...
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

< Previous12
 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.