Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing only table comments does not work. #11

Open
novaoki opened this issue Mar 18, 2017 · 4 comments
Open

Changing only table comments does not work. #11

novaoki opened this issue Mar 18, 2017 · 4 comments
Assignees
Labels

Comments

@novaoki
Copy link

novaoki commented Mar 18, 2017

Hi.

Changing only table comments does not work.
The alter statement is output, but there is no value.

Execution result.

ALTER TABLE target_table
;

Is not it supposed to change table comments?

Thank you.

@camcima
Copy link
Owner

camcima commented Nov 2, 2017

Hi @novaoki , I've included a new test with PR #19 that shows that changing only the comment will create the correct ALTER TABLE script. Can you please post an example where it doesn't work?

@camcima camcima self-assigned this Nov 2, 2017
@novaoki
Copy link
Author

novaoki commented Nov 7, 2017

Hi @camcima.
Thank you for your reply.
A little time has passed, so memory is vague.
I will verify it so please take some time.

@novaoki
Copy link
Author

novaoki commented Dec 10, 2017

Hi @camcima.
I'm sorry that it takes time to verify.
"php -mysql-diff migrate" correctly output alter statements.

However, the content was not displayed in "php -mysql-diff diff".

► table "assign" has a different schema

Diff completed!

Verified in sql below.
a.sql

CREATE TABLE IF NOT EXISTS assign (
user_id BIGINT UNSIGNED NOT NULL COMMENT 'ユーザID',
update_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最終更新日時',
create_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '登録日時',
PRIMARY KEY user_id)
ENGINE = InnoDB
COMMENT = 'アサイン情報1';

b.sql

CREATE TABLE IF NOT EXISTS assign (
user_id BIGINT UNSIGNED NOT NULL COMMENT 'ユーザID',
update_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最終更新日時',
create_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '登録日時',
PRIMARY KEY user_id)
ENGINE = InnoDB
COMMENT = 'アサイン情報';

Thanks.

@kentasaito
Copy link

Hi.

I met similar case on PHP MySQL Diff 1.2.1 (installed from composer).

from.schema

CREATE TABLE admin (
admin_id int(11) COMMENT 'Administrator ID'
);

to.schema

CREATE TABLE admin (
admin_id int(11) COMMENT 'タ'
);

When column comment included some non-ascii charactor, the command returns like below:

FROM from.schema
TO to.schema

▼ table "admin" is in the FROM database but not in the TO database

I guess it happens with charactor has 3rd byte(UTF-8) as 0xbf (i.e. 'タ'[E382BF] or 'み'[E381BF], etc).
I wonder, preg_match 'u'(PCRE_UTF8) pattern modifier fix this, but I'm not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants