arch-8.x-1.x-dev/modules/logger/arch_logger.install
modules/logger/arch_logger.install
<?php
/**
* @file
* Install, update and uninstall functions for the arch module.
*/
/**
* Implements hook_schema().
*/
function arch_logger_schema() {
$schema['arch_log'] = [
'description' => 'Records of arch logger module.',
'fields' => [
'lid' => [
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
],
'uid' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
],
'oid' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
],
'status' => [
'type' => 'varchar',
'length' => 50,
'not null' => TRUE,
'default' => '',
],
'message' => [
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
],
'data' => [
'type' => 'text',
'serialize' => TRUE,
'default' => NULL,
],
'created' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
],
],
'primary key' => ['lid'],
'indexes' => [
'log_uid' => ['uid'],
'log_oid' => ['oid'],
],
'foreign keys' => [
'affected_order' => [
'table' => 'arch_order',
'columns' => ['oid' => 'oid'],
],
'affected_user' => [
'table' => 'users',
'columns' => ['uid' => 'uid'],
],
],
];
return $schema;
}
