Answer the question
In order to leave comments, you need to log in
Why does not add a table to the database after migration?
In symphony, I created entities, difila and migrated them, as a result, tables were created in the database, but for some reason with the last entity it gives such an error, the entity and repository were created, but the table was not.
[notice] Migrating up to DoctrineMigrations\Version20200628105302
[error] Migration DoctrineMigrations\Version20200628093518 failed during Execution. Error: "An exception occurred while executing 'ALTER TABLE comment ADD is_published TINYINT(1) NOT N
ULL':
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'is_published'"
In AbstractMySQLDriver.php line 65:
An exception occurred while executing 'ALTER TABLE comment ADD is_published TINYINT(1) NOT NULL':
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'is_published'
In PDOConnection.php line 43:
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'is_published'
In PDOConnection.php line 41:
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'is_published'
doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration CONFIGURATION] [--db-config
uration DB-CONFIGURATION] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<version>
]
php bin/console doctrine:migrations:diff
, and then php bin/console doctrine:migrations:migrate
. As a result, such an error here, changed the data types of the columns indicated in the error to just INT, the error was not corrected.
Answer the question
In order to leave comments, you need to log in
Error in Version20200628093518 migration
It fails because its instructions describe adding a field that is already in the database...
[error] Migration DoctrineMigrations\Version20200628093518 failed during...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question