Foreign_subscription.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. // This file is part of GNU social - https://www.gnu.org/software/social
  3. //
  4. // GNU social is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Affero General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // GNU social is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Affero General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Affero General Public License
  15. // along with GNU social. If not, see <http://www.gnu.org/licenses/>.
  16. /**
  17. * Table Definition for foreign_subscription
  18. */
  19. defined('GNUSOCIAL') || die();
  20. class Foreign_subscription extends Managed_DataObject
  21. {
  22. ###START_AUTOCODE
  23. /* the code below is auto generated do not remove the above tag */
  24. public $__table = 'foreign_subscription'; // table name
  25. public $service; // int(4) primary_key not_null
  26. public $subscriber; // int(4) primary_key not_null
  27. public $subscribed; // int(4) primary_key not_null
  28. public $created; // datetime()
  29. /* the code above is auto generated do not remove the tag below */
  30. ###END_AUTOCODE
  31. public static function schemaDef()
  32. {
  33. return array(
  34. 'fields' => array(
  35. 'service' => array('type' => 'int', 'not null' => true, 'description' => 'service where relationship happens'),
  36. 'subscriber' => array('type' => 'int', 'size' => 'big', 'not null' => true, 'description' => 'subscriber on foreign service'),
  37. 'subscribed' => array('type' => 'int', 'size' => 'big', 'not null' => true, 'description' => 'subscribed user'),
  38. 'created' => array('type' => 'datetime', 'description' => 'date this record was created'),
  39. ),
  40. 'primary key' => array('service', 'subscriber', 'subscribed'),
  41. 'foreign keys' => array(
  42. 'foreign_subscription_service_fkey' => array('foreign_service', array('service' => 'id')),
  43. 'foreign_subscription_subscriber_service_fkey' => array('foreign_user', array('subscriber' => 'id', 'service' => 'service')),
  44. 'foreign_subscription_subscribed_service_fkey' => array('foreign_user', array('subscribed' => 'id', 'service' => 'service')),
  45. ),
  46. 'indexes' => array(
  47. 'foreign_subscription_subscriber_service_idx' => array('subscriber', 'service'),
  48. 'foreign_subscription_subscribed_service_idx' => array('subscribed', 'service'),
  49. 'foreign_subscription_service_subscribed_idx' => array('service', 'subscribed'),
  50. ),
  51. );
  52. }
  53. }