Last active
September 6, 2021 14:07
-
-
Save KaineLabs/792382225e929a1b04e0cf1eec53353d to your computer and use it in GitHub Desktop.
Re-install Media Table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Re-install Media Table. | |
*/ | |
function yzc_reinstall_media_table() { | |
global $wpdb; | |
$sql = array(); | |
$media_table = $wpdb->prefix . 'youzify_media'; | |
$charset_collate = $wpdb->get_charset_collate(); | |
$sql[] = "CREATE TABLE $media_table ( | |
id BIGINT(20) NOT NULL AUTO_INCREMENT, | |
media_id BIGINT(20) NULL, | |
user_id int(11) DEFAULT '0' NOT NULL, | |
src LONGTEXT NULL, | |
data LONGTEXT NULL, | |
item_id int(11) DEFAULT '0' NULL, | |
privacy varchar(10) NOT NULL, | |
source varchar(50) NULL, | |
type varchar(10) DEFAULT 'none' NOT NULL, | |
component varchar(10) DEFAULT 'activity' NOT NULL, | |
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, | |
PRIMARY KEY (id) | |
) $charset_collate;"; | |
// Include Files. | |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); | |
// Build Tables. | |
dbDelta( $sql ); | |
} | |
add_action( 'bp_init', 'yzc_reinstall_media_table' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment