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.
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!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.