Home › Forums › General Issues › Duplicate MetaKeys for Boolean in ACF_LITE › Reply To: Duplicate MetaKeys for Boolean in ACF_LITE
my last post got me wondering why there wasn’t an auto_incrementing field. that seemed highly unusual; in fact, according to this…wp_postmeta should not have any 0’s in the meta_id field since it is supposed to be an auto-incrementing field. i lost my indexes somewhere.
https://codex.wordpress.org/Database_Description#Table:_wp_postmeta
and, adding the indexes back fixes it! here are the queries i used if it helps anyone that somehow lost their indexes as well.
alter table wp_postmeta change column meta_id id integer unsigned, add column meta_id integer unsigned primary key auto_increment first;
update wp_postmeta set meta_id = meta_id + 9000; -- more than the number of rows in the table
update wp_postmeta set meta_id = id where id <> 0;
alter table wp_postmeta drop column id;
alter table wp_postmeta add index (meta_key), add index (post_id);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.