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);