SimplePortal
Support => Install and Upgrade => Topic started by: tclong on November 27, 2010, 05:37:59 PM
-
How do I fix this. I updated to SMF 2.0 RC4 tried to reinstall 2.3.2 and then tried 2.3.3 I did not uninstall 2.3.2 before upgrading to SMF 2.0 RC4. Please let me know what I need to adjust to get this reinstalled. -- Thanks for your time.
Database Error Invalid default value for 'approved'
File: D:\hshome\timlong\myspacecoast.com\forums\Packages\temp\install2.php
Line: 501
-
This is a very odd error. line 501 of install2.php is adding columns to the simpleportal tables, as needed.
if (!isset($column['deprecated_name']) || !$smcFunc['db_change_column']($smf_db_prefix . $table, $column['deprecated_name'], $column))
$smcFunc['db_add_column']($smf_db_prefix . $table, $column); //line 501
When the error occurs, it appears that it is trying to add, if necessary, column 'approved' to the sp_articles table. In this install2, no default value is given for the field, so the SMF function used (smf_db_add_column, found in DbPackages-mysql.php), should find that the column already exists on the database and wind up trying to update it. I think the SQL query ought to turn out like: ALTER TABLE smf2test_sp_articles CHANGE COLUMN `approved` `approved` tinyint(2) NOT NULL default '0'
MySQL converts '0' to 0, and everybody is happy.
That's what is supposed to happen.
It would seem that something else is actually happening.
To figure out what is wrong, we probably need to know the actual SQL query. Would you be able to make the necessary changes to the correct files and report the actual SQL query?
-
Thanks for your time in this. Tell me where to find and what to change and I will be happy to give it a try.
Tim
-
This may get a little complicated.
What version of SimplePortal did you have installed before you did the upgrade?
-
2.3.2
-
OK. For going from 2.3.2 to 2.3.3, install2.php should not actually be necessary.
I had thought about how to find and solve the install2.php problem, but I think, in this case, it would be more pragmatic to ignore the problem. Much easier.
One user described the process very well at:
Easiest solution to that issue is to open up SimplePortal_2.3.2.zip and remove these lines of code from package-info.xml:
<!-- Install scripts -->
<database>install2.php</database>
To do that either extract the files to your computer, edit that one and recreate the archive, or edit it directly from 7zip (right-click -> Edit, make the changes and hit CTRL+S, then click yes when prompted to update the archive)
-
Thanks -- That installed 2.3.2 and then had the same error when I tried to upgrade to 2.3.3. I did the same thing to 2.3.3 and it installed. I guess I will have to do that each time I upgrade from now on.
Keep this thread so I can find it when I upgrade next hehehehe. Thanks again for all your help. I appreciate it.
-
Your problem should not be happening, so the workaround should not be necessary.
One of these days, the problem will get solved, and the workaround will no longer be necessary.
Thanks for providing information that might contribute to the solution.
You should be able to find the topic (and an earlier one) again by searching on invalid approved.
-
A question-- what database storage medium are you using? MySQL? SQLite? postgreSQL?
-
MySQL
-
Hi Guys,
I have the exact same problem upgrading from 2.3.1 to 2.3.3. Will the workaround above work for this too? Or do I need to install 2.3.2 first?
Using SMF 2.0 RC4
Thanks,
Majoga
-
Thanks, the fix worked for me as well.