.dev/tests/functional/db/migrator_fixtures/test_create_full.class.expected

Summary

Maintainability
Test Coverage
<?php

load('db_migrator', 'framework', 'classes/db/');
class db_migration_%MIGRATION_NUMBER% extends yf_db_migrator {

    /**
    */
    protected function up() {
        $utils = $this->db->utils();
        $utils->create_table('test_create_full_1', [
            'fields' => [
                'id' => [
                    'name' => 'id',
                    'type' => 'int',
                    'length' => 10,
                    'nullable' => false,
                ],
            ],
            'indexes' => [
                'PRIMARY' => [
                    'name' => 'PRIMARY',
                    'type' => 'primary',
                    'columns' => [
                        'id' => 'id',
                    ],
                ],
            ],
            'foreign_keys' => [
                'fkey_prepare_sample_data' => [
                    'name' => 'fkey_prepare_sample_data',
                    'columns' => [
                        'id' => 'id',
                    ],
                    'ref_table' => 'test_create_full_2',
                    'ref_columns' => [
                        'id' => 'id',
                    ],
                    'on_update' => 'RESTRICT',
                    'on_delete' => 'RESTRICT',
                ],
            ],
            'options' => [
                'engine' => 'InnoDB',
                'charset' => 'utf8',
            ],
        ]);
        $utils->create_table('test_create_full_2', [
            'fields' => [
                'id' => [
                    'name' => 'id',
                    'type' => 'int',
                    'length' => 10,
                    'nullable' => false,
                ],
            ],
            'indexes' => [
                'PRIMARY' => [
                    'name' => 'PRIMARY',
                    'type' => 'primary',
                    'columns' => [
                        'id' => 'id',
                    ],
                ],
            ],
            'options' => [
                'engine' => 'InnoDB',
                'charset' => 'utf8',
            ],
        ]);
    }

    /**
    */
    protected function down() {
        $utils = $this->db->utils();
        $utils->drop_table('test_create_full_1');
        $utils->drop_table('test_create_full_2');
    }
}