Meta keys are not unique, a post can have multiple meta with the same key by design. Additionally, you should not be modifying WP core tables in your plugin, this is bad practice and can lead to data loss on WP updates.
In particular, the various meta APIs have a 3rd parameter:
get_post_meta( int $post_id, string $key = '', bool $single = false )
If $single
is set to false
then an array of all key/value pairs is returned. This way you can store multiple values without resorting to serialised arrays. This is also why there are separate update_post_meta
and add_post_meta
functions.
The same is true of term/comment/user/site meta etc