Closed ob1201 closed 6 years ago
Maybe you migrations just do not fully reflect the state of your mapping configuration. What is the output of the doctrine:schema:update --dump-sql
command?
@xabbuh
bin/console doctrine:schema:update --dump-sql
The following SQL statements will be executed:
ALTER TABLE fos_user_user CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL;
ALTER TABLE page__block CHANGE parent_id parent_id INT DEFAULT NULL, CHANGE page_id page_id INT DEFAULT NULL, CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE enabled enabled TINYINT(1) DEFAULT NULL, CHANGE position position INT DEFAULT NULL;
ALTER TABLE page__snapshot CHANGE site_id site_id INT DEFAULT NULL, CHANGE page_id page_id INT DEFAULT NULL, CHANGE page_alias page_alias VARCHAR(255) DEFAULT NULL, CHANGE type type VARCHAR(255) DEFAULT NULL, CHANGE parent_id parent_id INT DEFAULT NULL, CHANGE target_id target_id INT DEFAULT NULL, CHANGE content content LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)', CHANGE publication_date_start publication_date_start DATETIME DEFAULT NULL, CHANGE publication_date_end publication_date_end DATETIME DEFAULT NULL;
ALTER TABLE page__page CHANGE site_id site_id INT DEFAULT NULL, CHANGE parent_id parent_id INT DEFAULT NULL, CHANGE target_id target_id INT DEFAULT NULL, CHANGE page_alias page_alias VARCHAR(255) DEFAULT NULL, CHANGE type type VARCHAR(255) DEFAULT NULL, CHANGE request_method request_method VARCHAR(255) DEFAULT NULL, CHANGE title title VARCHAR(255) DEFAULT NULL, CHANGE meta_keyword meta_keyword VARCHAR(255) DEFAULT NULL, CHANGE meta_description meta_description VARCHAR(255) DEFAULT NULL;
ALTER TABLE page__site CHANGE relative_path relative_path VARCHAR(255) DEFAULT NULL, CHANGE enabled_from enabled_from DATETIME DEFAULT NULL, CHANGE enabled_to enabled_to DATETIME DEFAULT NULL, CHANGE locale locale VARCHAR(7) DEFAULT NULL, CHANGE title title VARCHAR(64) DEFAULT NULL, CHANGE meta_keywords meta_keywords VARCHAR(255) DEFAULT NULL, CHANGE meta_description meta_description VARCHAR(255) DEFAULT NULL;
ALTER TABLE notification__message CHANGE restart_count restart_count INT DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL, CHANGE started_at started_at DATETIME DEFAULT NULL, CHANGE completed_at completed_at DATETIME DEFAULT NULL;
ALTER TABLE media__gallery_media CHANGE gallery_id gallery_id INT DEFAULT NULL, CHANGE media_id media_id INT DEFAULT NULL;
ALTER TABLE media__media CHANGE provider_metadata provider_metadata LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)', CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL, CHANGE length length NUMERIC(10, 0) DEFAULT NULL, CHANGE content_type content_type VARCHAR(255) DEFAULT NULL, CHANGE content_size content_size INT DEFAULT NULL, CHANGE copyright copyright VARCHAR(255) DEFAULT NULL, CHANGE author_name author_name VARCHAR(255) DEFAULT NULL, CHANGE context context VARCHAR(64) DEFAULT NULL, CHANGE cdn_is_flushable cdn_is_flushable TINYINT(1) DEFAULT NULL, CHANGE cdn_flush_identifier cdn_flush_identifier VARCHAR(64) DEFAULT NULL, CHANGE cdn_flush_at cdn_flush_at DATETIME DEFAULT NULL, CHANGE cdn_status cdn_status INT DEFAULT NULL;
bin/console doctrine:schema:update --force
Updating database schema...
8 queries were executed
[OK] Database schema updated successfully!
bin/console doctrine:schema:update --dump-sql
The following SQL statements will be executed:
ALTER TABLE fos_user_user CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE last_login last_login DATETIME DEFAULT NULL, CHANGE confirmation_token confirmation_token VARCHAR(180) DEFAULT NULL, CHANGE password_requested_at password_requested_at DATETIME DEFAULT NULL, CHANGE date_of_birth date_of_birth DATETIME DEFAULT NULL, CHANGE firstname firstname VARCHAR(64) DEFAULT NULL, CHANGE lastname lastname VARCHAR(64) DEFAULT NULL, CHANGE website website VARCHAR(64) DEFAULT NULL, CHANGE biography biography VARCHAR(1000) DEFAULT NULL, CHANGE gender gender VARCHAR(1) DEFAULT NULL, CHANGE locale locale VARCHAR(8) DEFAULT NULL, CHANGE timezone timezone VARCHAR(64) DEFAULT NULL, CHANGE phone phone VARCHAR(64) DEFAULT NULL, CHANGE facebook_uid facebook_uid VARCHAR(255) DEFAULT NULL, CHANGE facebook_name facebook_name VARCHAR(255) DEFAULT NULL, CHANGE facebook_data facebook_data LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)', CHANGE twitter_uid twitter_uid VARCHAR(255) DEFAULT NULL, CHANGE twitter_name twitter_name VARCHAR(255) DEFAULT NULL, CHANGE twitter_data twitter_data LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)', CHANGE gplus_uid gplus_uid VARCHAR(255) DEFAULT NULL, CHANGE gplus_name gplus_name VARCHAR(255) DEFAULT NULL, CHANGE gplus_data gplus_data LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)', CHANGE token token VARCHAR(255) DEFAULT NULL, CHANGE two_step_code two_step_code VARCHAR(255) DEFAULT NULL;
ALTER TABLE page__block CHANGE parent_id parent_id INT DEFAULT NULL, CHANGE page_id page_id INT DEFAULT NULL, CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE enabled enabled TINYINT(1) DEFAULT NULL, CHANGE position position INT DEFAULT NULL;
ALTER TABLE page__snapshot CHANGE site_id site_id INT DEFAULT NULL, CHANGE page_id page_id INT DEFAULT NULL, CHANGE page_alias page_alias VARCHAR(255) DEFAULT NULL, CHANGE type type VARCHAR(255) DEFAULT NULL, CHANGE parent_id parent_id INT DEFAULT NULL, CHANGE target_id target_id INT DEFAULT NULL, CHANGE content content LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)', CHANGE publication_date_start publication_date_start DATETIME DEFAULT NULL, CHANGE publication_date_end publication_date_end DATETIME DEFAULT NULL;
ALTER TABLE page__page CHANGE site_id site_id INT DEFAULT NULL, CHANGE parent_id parent_id INT DEFAULT NULL, CHANGE target_id target_id INT DEFAULT NULL, CHANGE page_alias page_alias VARCHAR(255) DEFAULT NULL, CHANGE type type VARCHAR(255) DEFAULT NULL, CHANGE request_method request_method VARCHAR(255) DEFAULT NULL, CHANGE title title VARCHAR(255) DEFAULT NULL, CHANGE meta_keyword meta_keyword VARCHAR(255) DEFAULT NULL, CHANGE meta_description meta_description VARCHAR(255) DEFAULT NULL;
ALTER TABLE page__site CHANGE relative_path relative_path VARCHAR(255) DEFAULT NULL, CHANGE enabled_from enabled_from DATETIME DEFAULT NULL, CHANGE enabled_to enabled_to DATETIME DEFAULT NULL, CHANGE locale locale VARCHAR(7) DEFAULT NULL, CHANGE title title VARCHAR(64) DEFAULT NULL, CHANGE meta_keywords meta_keywords VARCHAR(255) DEFAULT NULL, CHANGE meta_description meta_description VARCHAR(255) DEFAULT NULL;
ALTER TABLE notification__message CHANGE restart_count restart_count INT DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL, CHANGE started_at started_at DATETIME DEFAULT NULL, CHANGE completed_at completed_at DATETIME DEFAULT NULL;
ALTER TABLE media__gallery_media CHANGE gallery_id gallery_id INT DEFAULT NULL, CHANGE media_id media_id INT DEFAULT NULL;
ALTER TABLE media__media CHANGE provider_metadata provider_metadata LONGTEXT DEFAULT NULL COMMENT '(DC2Type:json)', CHANGE width width INT DEFAULT NULL, CHANGE height height INT DEFAULT NULL, CHANGE length length NUMERIC(10, 0) DEFAULT NULL, CHANGE content_type content_type VARCHAR(255) DEFAULT NULL, CHANGE content_size content_size INT DEFAULT NULL, CHANGE copyright copyright VARCHAR(255) DEFAULT NULL, CHANGE author_name author_name VARCHAR(255) DEFAULT NULL, CHANGE context context VARCHAR(64) DEFAULT NULL, CHANGE cdn_is_flushable cdn_is_flushable TINYINT(1) DEFAULT NULL, CHANGE cdn_flush_identifier cdn_flush_identifier VARCHAR(64) DEFAULT NULL, CHANGE cdn_flush_at cdn_flush_at DATETIME DEFAULT NULL, CHANGE cdn_status cdn_status INT DEFAULT NULL;
Most likely related: https://github.com/doctrine/dbal/pull/2825
@ocramius
thx
fwiw,
composer require doctrine/dbal:dev-master
does not fix the issue
Apparently not possible to continue to comment there either
Ocramius locked as resolved and limited conversation to collaborators on Jan 5
what add'l info needed, and where to add it?
@Ocramius leave comment please
DB type and versions would help here. An isolated test case for the ORM test suite would be best
@Ocramius 10.2.10-MariaDB
Yeah, so it won't work, as we don't support MariaDB 10 yet.
This will need https://github.com/doctrine/dbal/pull/2825 and maybe more tests around it.
Closing as this this does not sound like a doctrine bundle issue and should also be fixed by https://github.com/doctrine/dbal/pull/2825
[SOLVED] Try to comment server version in doctrine.yaml
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
#server_version: '5.7' # Otherwise schema validation will fail
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci
url: '%env(resolve:DATABASE_URL)%'
For a Symfony4 install with
create DBs
init
no errors
show
schema:validate fails
dev.log