add door manager logs

This commit is contained in:
Schneider Roland
2023-02-20 18:45:00 +01:00
parent b40d0ccf05
commit 7c610b50ab
5 changed files with 230 additions and 20 deletions

View File

@@ -0,0 +1,102 @@
<?php
use yii\db\Migration;
/**
* Class m230126_202055_create_table_door_card_pass
*/
class m230209_200020_create_table_door_manager_log extends Migration
{
/**
* {@inheritdoc}
*
* string $request_id
* string $identifier
* string $device
* string $direction
* string $original_direction
* bool $verify_only
* datetime $created_at
* integer $card_id_card
* string $card_number
* integer $virtual_key_id
* integer $key_id_key
* string $key_number
* string $customer_id_customer
* string $customer_name
* string $customer_email
* string $ticket_id_ticket
* string $ticket_usage_count
* string $ticket_usage
* string $ticket_type_name
* string $validation_kind
* bool $error
* string $error_code
* string $error_message
*/
public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
$this->createTable('door_manager_log', [
'id_door_manager_log' => $this->primaryKey(),
'created_at' => $this->datetime(),
'updated_at' => $this->dateTime()->notNull(),
'request_id' => $this->string(50),
'identifier' => $this->string(100),
'device' => $this->string(10),
'direction' => $this->string(10),
'original_direction' => $this->string(10),
'verify_only' => $this->boolean(),
'card_id_card' => $this->integer(),
'card_number' => $this->string(50),
'virtual_key_id' => $this->integer(),
'key_id_key' => $this->integer(),
'key_number' => $this->string(),
'customer_id_customer' => $this->integer(),
'customer_name' => $this->string(),
'customer_email' => $this->string(),
'ticket_id_ticket' => $this->string(),
'ticket_usage_count' => $this->string(),
'ticket_usage' => $this->integer(),
'ticket_type_name' => $this->string(),
'validation_kind' => $this->string(50),
'error' => $this->boolean()->defaultValue(false),
'error_code' => $this->string(50),
'error_message' => $this->string(),
],
$tableOptions
);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
echo "m230126_202055_create_table_door_card_pass cannot be reverted.\n";
return false;
}
/*
// Use up()/down() to run migration code without a transaction.
public function up()
{
}
public function down()
{
echo "m230126_202055_create_table_door_card_pass cannot be reverted.\n";
return false;
}
*/
}