Skip to content

Only include plugin tables (with files) in diff. #879

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

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from

Conversation

dereuromark
Copy link
Member

Resolves #325

I gave claude.ai the following instructions

Can you make a fix out of https://github.com/cakephp/migrations/issues/325 proposal?

@ADmad What do you think?

In general this should probably be a flag/option of sorts, as this could be useful in both directions, and also for app (to exclude plugin ones?)

Comment on lines +215 to +234
$connection->execute('CREATE TABLE IF NOT EXISTS articles (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255)
)');

// Create a table that does NOT have a Table class in the TestBlog plugin
$connection->execute('CREATE TABLE IF NOT EXISTS orphan_table (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255)
)');

// Create plugin migration history table
$connection->execute('CREATE TABLE IF NOT EXISTS test_blog_phinxlog (
version BIGINT NOT NULL,
migration_name VARCHAR(100) DEFAULT NULL,
start_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
end_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
breakpoint TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (version)
)');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This SQL isn't going to work across platforms. You'll either need to generalize it quite a bit, or make this test conditional for MySQL.

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

Successfully merging this pull request may close these issues.

Incorrect behavior when using "migration_diff" with "--plugin" option.
2 participants