I've recently had a lot of trouble, self-inflicted I will admit, with my Drupal 7 website and as a result have had to restore my database from a backup several times. In doing so, the structure of most of the tables does not seem to have restored quite correctly for some reason and I'm getting a lot of errors to say that there are no default values for fields (that are always primary keys). The solution to this has been to make the field auto increment, but is there a way to do this without looking at the structure of each table one by one.
Is there some kind of script that looks at the structure of the tables and repairs them automatically as my website is considerably large and has many tables so going through them by hand would be a lengthy process.
Thanks in advance
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database:
name` -- -- -------------------------------------------------------- -- -- Table structure for tableactions
-- CREATE TABLE IF NOT EXISTSactions
(aid
varchar(255) NOT NULL DEFAULT '0' COMMENT 'Primary Key: Unique actions ID.',type
varchar(32) NOT NULL DEFAULT '' C`.SQL
format