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

Automatically migrating cpt when isn't yet + Change name of migrating tables? #2

Open
DjodyKort opened this issue May 11, 2023 · 2 comments

Comments

@DjodyKort
Copy link

I must say this actually is an incredible plugin.

Small question, is there a way to change the name of the tables when you migrate them?

And I wanted to build a plugin myself to check if a table is migrated and if not then migrate it for me. Right now I already have a way to check if a custom post type is migrated or not. Just use the name of the custom post type and look up if a database table with "wp_cpt_"+tableName exists.

And if not then it just migrates the custom post type. But the problem is I don't think I can do it through my plugin right? What would you think is the best way?

Cheers,
Djody :)

@caspahouzer
Copy link
Owner

Hey @DjodyKort
thanks for the flowers.

IMHO an automatic migration is very unsafe as the user won't get informed or something unwanted happens there.

If I would make some integration, I would make a checkbox called "Automatic migration of new post types" and there the plugin will compare the post types within the cpt_tables:tables_enabled options array with the existing wp_cpt_* tables.

But again: I personally would be annoyyed, if there are tables created when it's not wished by me.

If you found a solution to make it nice and clean, you can add this to cpt-tables by a PR. You're always welcome

@DjodyKort
Copy link
Author

Thank you for the advice! I have looked into the plugin some more and I found a little bug that confused me a bit. Let me describe it real quick:

So when you try putting meta_data into a migrated cpt it doesnt appear within the post's frontend for some reason. I feel like this is just a minor bug and isn't that big of a problem probably because I think it still is connected via the backend.

At least I think so.

Also I still am not too comfortable with Wordpress plugin development so I'm still learning and don't think I'm able to actually create a clean PR.

Anyways I wanted to thank you for your work, you truely made a plugin that is helpful for loads of people including me. Although I'm not sure if I am gonna seperate all the posts yet.

Cheers,
Djody :)

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

No branches or pull requests

2 participants