bp_core_install_activity_streams

Install database tables for the Activity component.

Description

bp_core_install_activity_streams(); 

Usage

  1. if ( !function_exists( 'bp_core_install_activity_streams' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/admin/bp-core-admin-schema.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_core_install_activity_streams(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-core/admin/bp-core-admin-schema.php  
  1. function bp_core_install_activity_streams() { 
  2. $sql = array(); 
  3. $charset_collate = $GLOBALS['wpdb']->get_charset_collate(); 
  4. $bp_prefix = bp_core_get_table_prefix(); 
  5.  
  6. $sql[] = "CREATE TABLE {$bp_prefix}bp_activity ( 
  7. id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,  
  8. user_id bigint(20) NOT NULL,  
  9. component varchar(75) NOT NULL,  
  10. type varchar(75) NOT NULL,  
  11. action text NOT NULL,  
  12. content longtext NOT NULL,  
  13. primary_link text NOT NULL,  
  14. item_id bigint(20) NOT NULL,  
  15. secondary_item_id bigint(20) DEFAULT NULL,  
  16. date_recorded datetime NOT NULL,  
  17. hide_sitewide bool DEFAULT 0,  
  18. mptt_left int(11) NOT NULL DEFAULT 0,  
  19. mptt_right int(11) NOT NULL DEFAULT 0,  
  20. is_spam tinyint(1) NOT NULL DEFAULT 0,  
  21. KEY date_recorded (date_recorded),  
  22. KEY user_id (user_id),  
  23. KEY item_id (item_id),  
  24. KEY secondary_item_id (secondary_item_id),  
  25. KEY component (component),  
  26. KEY type (type),  
  27. KEY mptt_left (mptt_left),  
  28. KEY mptt_right (mptt_right),  
  29. KEY hide_sitewide (hide_sitewide),  
  30. KEY is_spam (is_spam) 
  31. ) {$charset_collate};"; 
  32.  
  33. $sql[] = "CREATE TABLE {$bp_prefix}bp_activity_meta ( 
  34. id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,  
  35. activity_id bigint(20) NOT NULL,  
  36. meta_key varchar(255) DEFAULT NULL,  
  37. meta_value longtext DEFAULT NULL,  
  38. KEY activity_id (activity_id),  
  39. KEY meta_key (meta_key(191)) 
  40. ) {$charset_collate};"; 
  41.  
  42. dbDelta( $sql );