b2evolution PHP Cross Reference Blogging Systems

Source: /inc/messaging/model/_messaging.install.php - 99 lines - 3835 bytes - Text - Print

Description: This file is part of b2evolution - {@link http://b2evolution.net/} See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file is part of b2evolution - {@link http://b2evolution.net/}
   4   * See also {@link http://sourceforge.net/projects/evocms/}.
   5   *
   6   * @copyright (c)2009-2014 by Francois PLANQUE - {@link http://fplanque.net/}
   7   * Parts of this file are copyright (c)2009 by The Evo Factory - {@link http://www.evofactory.com/}.
   8   *
   9   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
  10   *
  11   * {@internal Open Source relicensing agreement:
  12   * The Evo Factory grants Francois PLANQUE the right to license
  13   * The Evo Factory's contributions to this file and the b2evolution project
  14   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  15   * }}
  16   *
  17   * @package messaging
  18   *
  19   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  20   * @author efy-maxim: Evo Factory / Maxim.
  21   * @author fplanque: Francois Planque.
  22   *
  23   * @version $Id: _messaging.install.php 6136 2014-03-08 07:59:48Z manuel $
  24   */
  25  if( !defined('EVO_CONFIG_LOADED') ) die( 'Please, do not access this page directly.' );
  26  
  27  
  28  global $db_storage_charset;
  29  
  30  
  31  /**
  32   * The b2evo database scheme.
  33   *
  34   * This gets updated through {@link db_delta()} which generates the queries needed to get
  35   * to this scheme.
  36   *
  37   * Please see {@link db_delta()} for things to take care of.
  38   */
  39  $schema_queries['T_messaging__thread'] = array(
  40          'Creating table for message threads',
  41          "CREATE TABLE T_messaging__thread (
  42              thrd_ID int(10) unsigned NOT NULL auto_increment,
  43              thrd_title varchar(255) NOT NULL,
  44              thrd_datemodified datetime NOT NULL,
  45              PRIMARY KEY thrd_ID (thrd_ID)
  46          ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" );
  47  
  48  $schema_queries['T_messaging__message'] = array(
  49          'Creating table for messages',
  50          "CREATE TABLE T_messaging__message (
  51              msg_ID int(10) unsigned NOT NULL auto_increment,
  52              msg_author_user_ID int(10) unsigned NOT NULL,
  53              msg_datetime datetime NOT NULL,
  54              msg_thread_ID int(10) unsigned NOT NULL,
  55              msg_text text,
  56              PRIMARY KEY msg_ID (msg_ID)
  57          ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" );
  58  
  59  // index on tsta_user_ID field
  60  $schema_queries['T_messaging__threadstatus'] = array(
  61          'Creating table for message threads statuses',
  62          "CREATE TABLE T_messaging__threadstatus (
  63              tsta_thread_ID int(10) unsigned NOT NULL,
  64              tsta_user_ID int(10) unsigned NOT NULL,
  65              tsta_first_unread_msg_ID int(10) unsigned NULL,
  66              tsta_thread_leave_msg_ID int(10) unsigned NULL DEFAULT NULL,
  67              INDEX(tsta_user_ID)
  68          ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" );
  69  
  70  $schema_queries['T_messaging__contact'] = array(
  71          'Creating table for messaging contacts',
  72          "CREATE TABLE T_messaging__contact (
  73              mct_from_user_ID int(10) unsigned NOT NULL,
  74              mct_to_user_ID int(10) unsigned NOT NULL,
  75              mct_blocked tinyint(1) default 0,
  76              mct_last_contact_datetime datetime NOT NULL,
  77              PRIMARY KEY mct_PK (mct_from_user_ID, mct_to_user_ID)
  78          ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" );
  79  
  80  $schema_queries['T_messaging__contact_groups'] = array(
  81          'Creating table for groups of messaging contacts',
  82          "CREATE TABLE T_messaging__contact_groups (
  83              cgr_ID      int(10) unsigned NOT NULL auto_increment,
  84              cgr_user_ID int(10) unsigned NOT NULL,
  85              cgr_name    varchar(50) NOT NULL,
  86              PRIMARY KEY cgr_ID (cgr_ID)
  87          ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" );
  88  
  89  $schema_queries['T_messaging__contact_groupusers'] = array(
  90          'Creating table for group users of messaging contacts',
  91          "CREATE TABLE T_messaging__contact_groupusers (
  92              cgu_user_ID int(10) unsigned NOT NULL,
  93              cgu_cgr_ID  int(10) unsigned NOT NULL,
  94              PRIMARY KEY cgu_PK (cgu_user_ID, cgu_cgr_ID),
  95              FOREIGN KEY (cgu_cgr_ID) REFERENCES T_messaging__contact_groups(cgr_ID)
  96                        ON DELETE CASCADE
  97          ) ENGINE = innodb DEFAULT CHARSET = $db_storage_charset" );
  98  
  99  ?>

title

Description

title

Description

title

Description

title

title

Body