1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?php
- defined('GNUSOCIAL') || die();
- class ModLog extends Managed_DataObject
- {
- public $__table = 'mod_log';
- public $id;
- public $profile_id;
- public $moderator_id;
- public $role;
- public $is_grant;
- public $created;
-
- public static function schemaDef()
- {
- return [
- 'description' => 'Log of moderation events',
- 'fields' => [
- 'id' => [
- 'type' => 'varchar',
- 'length' => 36,
- 'not null' => true,
- 'description' => 'unique event ID',
- ],
- 'profile_id' => [
- 'type' => 'int',
- 'not null' => true,
- 'description' => 'profile getting the role',
- ],
- 'moderator_id' => [
- 'type' => 'int',
- 'description' => 'profile granting or revoking the role',
- ],
- 'role' => [
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => true,
- 'description' => 'role granted or revoked',
- ],
- 'is_grant' => [
- 'type' => 'bool',
- 'default' => true,
- 'description' => 'Was this a grant or revocation of a role',
- ],
- 'created' => [
- 'type' => 'datetime',
- 'not null' => true,
- 'description' => 'date this record was created',
- ],
- ],
- 'primary key' => ['id'],
- 'foreign keys' => [
- 'modlog_profile_id_fkey' => ['profile', ['profile_id' => 'id']],
- 'modlog_moderator_id_fkey' => ['user', ['moderator_id' => 'id']],
- ],
- 'indexes' => [
- 'modlog_profile_id_created_idx' => ['profile_id', 'created'],
- 'modlog_moderator_id_idx' => ['moderator_id'],
- ],
- ];
- }
- }
|