I just changed my schema for a symfony project I'm working on (added a table and a few columns) and ran the following two commands:
php symfony doc:generate-migrations-diff
php symfony doc:migrate
Previously this has worked without any problems, but this time it freaked out. I accidently gave two tables the same name, which it reasonably failed on, but now that I fixed my schema file it still won't work. It produces the following errors:
The following errors occurred:
- SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'media_images' already exists. Failing Query: "CREATE TABLE media_images (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(255), start_date DATE, end_date DATE, website VARCHAR(255), location TEXT, description TEXT, PRIMARY KEY(id)) ENGINE = INNODB"
- SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'company_type'. Failing Query: "ALTER TABLE bio ADD company_type VARCHAR(255)"
- SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'company'. Failing Query: "ALTER TABLE bio ADD company VARCHAR(255)"
- SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'company_type'. Failing Query: "ALTER TABLE bio ADD company_type VARCHAR(255)"
- SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'company'. Failing Query: "ALTER TABLE bio ADD company VARCHAR(255)"
- SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'media_events' already exists. Failing Query: "CREATE TABLE media_events (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(255), start_date DATE, end_date DATE, website VARCHAR(255), location TEXT, description TEXT, PRIMARY KEY(id)) ENGINE = INNODB"
- SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'company_type'. Failing Query: "ALTER TABLE bio ADD company_type VARCHAR(255)"
- SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'company'. Failing Query: "ALTER TABLE bio ADD company VARCHAR(255)"
- SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'media_events' already exists. Failing Query: "CREATE TABLE media_events (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(255), start_date DATE, end_date DATE, website VARCHAR(255), location TEXT, description TEXT, PRIMARY KEY(id)) ENGINE = INNODB"
- SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'company_type'. Failing Query: "ALTER TABLE bio ADD company_type VARCHAR(255)"
- SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'company'. Failing Query: "ALTER TABLE bio ADD company VARCHAR(255)"
Mostly this is confusing because it is reporting the same error multiple times. I have deleted the /tmp/doctrine_schema_[random_number].yml files and tried again, no luck. I also brought up the mysql console and manually deleted the tables and columns it is complaining about but it still generated the same error.
Any ideas?