Hi There,
I'm creating a custom model following the instructions here.
Everything is working fine except Step 2: Create a custom table for the model, as the table does not get created in the DB and no data is saved!
Here's the code I'm using to create the table:
// Step 2: Create a custom table for the model.
add_action('init', function () {
MetaBox\CustomTable\API::create(
'wp_provider_plans', // Table name.
[ // Table columns (without ID).
'provider' => 'BIGINT(20) UNSIGNED [0]',
'service' => 'VARCHAR(255)',
'price' => 'FLOAT',
],
['provider'], // List of index keys.
true // Must be true for models.
);
});
How to solve this problem?