.dev/tests/unit/db/fixtures/class_db_ddl_parser_mysql_test_tbl_city.php

Summary

Maintainability
D
2 days
Test Coverage
<?php
return [
    'name' => 'city',
    'fields' => [
        'city_id' => [
            'name' => 'city_id',
            'type' => 'smallint',
            'length' => 5,
            'decimals' => NULL,
            'unsigned' => true,
            'nullable' => false,
            'default' => NULL,
            'charset' => NULL,
            'collate' => NULL,
            'auto_inc' => true,
            'primary' => true,
            'unique' => false,
            'values' => NULL,
            'raw' => '`city_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT',
        ],
        'city' => [
            'name' => 'city',
            'type' => 'varchar',
            'length' => 50,
            'decimals' => NULL,
            'unsigned' => NULL,
            'nullable' => false,
            'default' => NULL,
            'charset' => NULL,
            'collate' => NULL,
            'auto_inc' => false,
            'primary' => false,
            'unique' => false,
            'values' => NULL,
            'raw' => '`city` varchar(50) NOT NULL',
        ],
        'country_id' => [
            'name' => 'country_id',
            'type' => 'smallint',
            'length' => 5,
            'decimals' => NULL,
            'unsigned' => true,
            'nullable' => false,
            'default' => NULL,
            'charset' => NULL,
            'collate' => NULL,
            'auto_inc' => false,
            'primary' => false,
            'unique' => false,
            'values' => NULL,
            'raw' => '`country_id` smallint(5) unsigned NOT NULL',
        ],
        'last_update' => [
            'name' => 'last_update',
            'type' => 'timestamp',
            'length' => NULL,
            'decimals' => NULL,
            'unsigned' => NULL,
            'nullable' => false,
            'default' => 'CURRENT_TIMESTAMP',
            'charset' => NULL,
            'collate' => NULL,
            'auto_inc' => false,
            'primary' => false,
            'unique' => false,
            'values' => NULL,
            'on_update' => 'ON UPDATE CURRENT_TIMESTAMP',
            'raw' => '`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
        ],
    ],
    'indexes' => [
        'PRIMARY' => [
            'name' => 'PRIMARY',
            'type' => 'primary',
            'columns' => [
                'city_id' => 'city_id',
            ],
            'raw' => 'PRIMARY KEY (`city_id`)',
        ],
        'idx_fk_country_id' => [
            'name' => 'idx_fk_country_id',
            'type' => 'index',
            'columns' => [
                'country_id' => 'country_id',
            ],
            'raw' => 'KEY `idx_fk_country_id` (`country_id`)',
        ],
    ],
    'foreign_keys' => [
        'fk_city_country' => [
            'name' => 'fk_city_country',
            'columns' => [
                'country_id' => 'country_id',
            ],
            'ref_table' => 'country',
            'ref_columns' => [
                'country_id' => 'country_id',
            ],
            'on_update' => 'CASCADE',
            'on_delete' => NULL,
            'raw' => 'CONSTRAINT `fk_city_country` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`) ON UPDATE CASCADE',
        ],
    ],
    'options' => [
        'engine' => 'InnoDB',
        'charset' => 'utf8',
    ],
];