Schema_version.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 schema_version
  18. */
  19. defined('GNUSOCIAL') || die();
  20. class Schema_version extends Managed_DataObject
  21. {
  22. ###START_AUTOCODE
  23. /* the code below is auto generated do not remove the above tag */
  24. public $__table = 'schema_version'; // table name
  25. public $table_name; // varchar(64) primary_key not_null
  26. public $checksum; // varchar(128) not_null
  27. public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
  28. /* the code above is auto generated do not remove the tag below */
  29. ###END_AUTOCODE
  30. public static function schemaDef()
  31. {
  32. return array(
  33. 'description' => 'To avoid checking database structure all the time, we store a checksum of the expected schema info for each table here. If it has not changed since the last time we checked the table, we can leave it as is.',
  34. 'fields' => array(
  35. 'table_name' => array('type' => 'varchar', 'length' => '64', 'not null' => true, 'description' => 'Table name'),
  36. 'checksum' => array('type' => 'varchar', 'length' => '128', 'not null' => true, 'description' => 'Checksum of schema array; a mismatch indicates we should check the table more thoroughly.'),
  37. 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
  38. ),
  39. 'primary key' => array('table_name'),
  40. );
  41. }
  42. }