• Resolved eveslage

    (@eveslage)


    Hi,

    I saw this was an issue already.i want to migrate to a clustered database, but the aws_index table doesn’t contain a primary key and non of the columns is an obvious choice. Can you fix this issue?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    Yes, it is something that can be done in the next plugin releases.
    For now please use following code

    add_action( 'aws_create_index_table', 'my_aws_create_index_table' );
    function my_aws_create_index_table() {
        global $wpdb;
        $table_name = $wpdb->prefix . AWS_INDEX_TABLE_NAME;
        $wpdb->query("
            ALTER TABLE {$table_name}
            ADD COLUMN <code>key</code> int(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT FIRST;
        ");
    }

    You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.

    Also, after adding this code, you need to re-index the plugin table.

    Regards

    Thread Starter eveslage

    (@eveslage)

    thanks for the answer. I had to change “key” -> “id_pk”, because I got an sql error message in the log. with the new column name, I didn’t get the error message, but also not an additional column.

    I added this column directly in the database and it worked. I did the same trick with the aws_cache table.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘please add primary key to aws_index table’ is closed to new replies.