Unkown column license?
pribeh - May 23, 2009 - 23:32
| Project: | Creative Commons Lite |
| Version: | 6.x-1.2 |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Never seen the following before. Just performed an upgrade on a site from D5 to D6 a few days ago and now whenever I try to post something with a license I get the following message without any license. Sure enough, the license's aren't stickin'.
user warning: Unknown column 'license' in 'field list' query: INSERT INTO creativecommons_lite (nid, license) VALUES (914, 'by') in /var/www/me/mysite/sites/all/modules/creativecommons_lite/creativecommons_lite.module on line 416.
Any help is much appreciated.

#1
Looks like the database schema has changed and there's no update that updates it.
Here's some sql that should fix the database table:
ALTER TABLE creativecommons_lite DROP id;ALTER TABLE creativecommons_lite DROP INDEX nid;
ALTER TABLE creativecommons_lite ADD PRIMARY KEY(nid);
ALTER TABLE creativecommons_lite CHANGE nid nid INT( 10 ) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE creativecommons_lite CHANGE data license VARCHAR( 12 ) NOT NULL DEFAULT '';
Remember - this only needs to be done if you're upgrading from the Drupal 5 version.