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

How Do I Create (Drop) Tables For Custom Models In The Database? #72

Open
phylogram opened this issue Aug 17, 2020 · 1 comment
Open

Comments

@phylogram
Copy link

phylogram commented Aug 17, 2020

When I create new tables, I usually would create them with a register_activation_hook hook and callback and drop them with register_deactivation_hook … How can I make sure the tables for custom models are going to be created at activation and dropped with the deactivation of my plugin?

Thanks for this repository by the way! Really made things more flexible, then the usual WP_Query search!

@tareq1988
Copy link
Owner

I guess you've to create the tables with WPDB class, or you can run through the ORM. Basically this library builds the query via Eloquent and runs via $wpdb. Using ORM is always slower. This library doesn't act like Laravel migrations. So you should create the tables usually you do.

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