Feature #12598 » askit-table-keys.php
1 |
<?php
|
---|---|
2 |
|
3 |
global $wpdb; |
4 |
|
5 |
$cr_tables = $wpdb->get_col( "SHOW TABLES LIKE '%etcomment_rating%'" ); |
6 |
foreach ( $cr_tables as $cr_table ) { |
7 |
$query = "ALTER TABLE {$cr_table} ADD COLUMN etcommentrating_id bigint(20) unsigned NOT NULL auto_increment PRIMARY KEY"; |
8 |
$wpdb->query( $query ); |
9 |
}
|
10 |
|
11 |
$ra_tables = $wpdb->get_col( "SHOW TABLES LIKE '%etright_answer%'" ); |
12 |
foreach ( $ra_tables as $ra_table ) { |
13 |
$query = "ALTER TABLE {$ra_table} ADD COLUMN etrightanswer_id bigint(20) unsigned NOT NULL auto_increment PRIMARY KEY"; |
14 |
$wpdb->query( $query ); |
15 |
}
|