CREATE TABLE {table_prefix}CB_SUBJECT_META
(
    SUBJECT_ID  VARCHAR(128) NOT NULL,
    META_ID     VARCHAR(32)  NOT NULL,
    META_VALUE  VARCHAR(1024),

    UPDATE_TIME TIMESTAMP     DEFAULT CURRENT_TIMESTAMP NOT NULL,

    PRIMARY KEY (SUBJECT_ID, META_ID),
    FOREIGN KEY (SUBJECT_ID) REFERENCES {table_prefix}CB_AUTH_SUBJECT(SUBJECT_ID) ON DELETE CASCADE
);

INSERT INTO {table_prefix}CB_SUBJECT_META (SUBJECT_ID, META_ID, META_VALUE)
SELECT USER_ID, META_ID, META_VALUE FROM {table_prefix}CB_USER_META;

DROP TABLE {table_prefix}CB_USER_META;
