Database not installed
Josiah@missions... - January 9, 2008 - 17:10
| Project: | OG Files |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I tried to use this on a brand new install and found that the database table was not created when I installed, causing several sql errors to be tossed up. I also don't see anything in the code that suggests exactly what the table should look like.

#1
oh, I found where this gets built, and see a comment that you know it isn't working. Maybe a comment could be made on the project page to let people know until its fixed? You could also mention that the SQL command "CREATE TABLE og_files (gid INT NOT NULL, data TEXT NOT NULL);" will take care of it until then. I did that and things seem to be functioning as expected.
function og_files_install() {
//seems to be not working
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {og_files} (
gid INT NOT NULL,
data TEXT NOT NULL
);"
);
break;
}
}
#2
The way it is done in this module is wrong. The og_files_install function should be in a og_files.install file, not in the module file itself.
#3
Josiah:
I tried to break out the install function to its own install file with the modification as you documented but I still get the same problem about the table not existing. what might I be doing wrong?
Here is what I put in og_files.install
<?php
function og_files_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE og_files (gid INT NOT NULL, data TEXT NOT NULL);");
break;
}
}
#4
Please read http://drupal.org/node/212572 and especially take a look to http://drupal.org/node/212572#comment-730037 for a patched version of module.
#5
Fixed with http://drupal.org/cvs?commit=116697
#6
Automatically closed -- issue fixed for two weeks with no activity.