// AccessType
$this->createTable('{{%AccessType}}', [
    'access_type_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'name' => Schema::TYPE_STRING . "(45) NOT NULL",
    'PRIMARY KEY (access_type_id)',
], $this->tableOptions);

// AdminUser
$this->createTable('{{%AdminUser}}', [
    'admin_user_id' => Schema::TYPE_INTEGER . "(10) UNSIGNED NOT NULL AUTO_INCREMENT",
    'member_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'name' => Schema::TYPE_STRING . "(32) NOT NULL",
    'lastname' => Schema::TYPE_STRING . "(255) NOT NULL",
    'created' => Schema::TYPE_TIMESTAMP . " NULL",
    'created_by' => Schema::TYPE_STRING . "(40) NULL",
    'updated' => Schema::TYPE_TIMESTAMP . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(40) NULL",
    'PRIMARY KEY (admin_user_id)',
], $this->tableOptions);

// Application
$this->createTable('{{%Application}}', [
    'application_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(45) NOT NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// ApplicationAccess
$this->createTable('{{%ApplicationAccess}}', [
    'application_access_id' => Schema::TYPE_PK,
    'user_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'application_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'access_type_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// ApplicationParameter
$this->createTable('{{%ApplicationParameter}}', [
    'application_parameter_id' => Schema::TYPE_PK,
    'application_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'key' => Schema::TYPE_STRING . "(45) NOT NULL",
    'value' => Schema::TYPE_STRING . "(45) NOT NULL",
    'code' => Schema::TYPE_STRING . "(150) NULL",
], $this->tableOptions);

// ApplicationResource
$this->createTable('{{%ApplicationResource}}', [
    'application_resource_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(45) NULL",
    'path' => Schema::TYPE_STRING . "(250) NULL",
    'type' => Schema::TYPE_STRING . "(45) NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
    'application_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'mimetype' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'resource_code' => Schema::TYPE_STRING . "(150) NULL",
], $this->tableOptions);

// ApplicationVersion
$this->createTable('{{%ApplicationVersion}}', [
    'application_version_id' => Schema::TYPE_PK,
    'application_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'is_current' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '0'",
    'html' => Schema::TYPE_TEXT . " NOT NULL",
    'source' => Schema::TYPE_TEXT . " NOT NULL",
    'css' => Schema::TYPE_TEXT . " NOT NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
    'name' => Schema::TYPE_TEXT . " NOT NULL",
], $this->tableOptions);

// DisplayArea
$this->createTable('{{%DisplayArea}}', [
    'display_area_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(45) NULL",
    'order' => Schema::TYPE_INTEGER . "(11) NOT NULL DEFAULT '1'",
    'layout_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
], $this->tableOptions);

// DisplayChannel
$this->createTable('{{%DisplayChannel}}', [
    'display_channel_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(45) NULL",
    'ubox_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// DisplayLayout
$this->createTable('{{%DisplayLayout}}', [
    'display_layout_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(45) NULL",
    'number_areas' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// DisplayProgram
$this->createTable('{{%DisplayProgram}}', [
    'display_program_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(45) NULL",
    'display_channel_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'installation_id' => Schema::TYPE_INTEGER . "(11) NULL",
    'from_time' => Schema::TYPE_DATETIME . " NULL",
    'to_time' => Schema::TYPE_DATETIME . " NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// DisplayScreenSize
$this->createTable('{{%DisplayScreenSize}}', [
    'display_screen_size_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(45) NOT NULL",
    'width' => Schema::TYPE_DOUBLE . " NULL",
    'height' => Schema::TYPE_DOUBLE . " NULL",
], $this->tableOptions);

// Installation
$this->createTable('{{%Installation}}', [
    'installation_id' => Schema::TYPE_PK,
    'ubox_id' => Schema::TYPE_INTEGER . "(11) NULL",
    'market_application_id' => Schema::TYPE_INTEGER . "(11) NULL",
    'shared_application_id' => Schema::TYPE_INTEGER . "(11) NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// InstallationParameter
$this->createTable('{{%InstallationParameter}}', [
    'installation_parameter_id' => Schema::TYPE_PK,
    'installation_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'application_parameter_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'key' => Schema::TYPE_STRING . "(45) NOT NULL",
    'value' => Schema::TYPE_STRING . "(45) NOT NULL",
    'code' => Schema::TYPE_STRING . "(150) NULL",
], $this->tableOptions);

// MarketApplication
$this->createTable('{{%MarketApplication}}', [
    'mp_application_id' => Schema::TYPE_PK,
    'application_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'mp_status_application_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// MarketApplicationVersion
$this->createTable('{{%MarketApplicationVersion}}', [
    'market_application_version_id' => Schema::TYPE_PK,
    'market_application_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// MarketStatusApplication
$this->createTable('{{%MarketStatusApplication}}', [
    'market_status_application_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(45) NULL",
    'description' => Schema::TYPE_STRING . "(100) NULL",
], $this->tableOptions);

// Place
$this->createTable('{{%Place}}', [
    'place_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(150) NOT NULL",
    'is_active' => Schema::TYPE_INTEGER . "(1) NOT NULL DEFAULT '0'",
    'address' => Schema::TYPE_STRING . "(250) NULL",
    'city' => Schema::TYPE_STRING . "(100) NULL",
    'postal_code' => Schema::TYPE_STRING . "(10) NULL",
    'province' => Schema::TYPE_STRING . "(100) NULL",
    'country' => Schema::TYPE_STRING . "(100) NULL",
    'latitude' => Schema::TYPE_STRING . "(45) NULL",
    'longitude' => Schema::TYPE_STRING . "(45) NULL",
    'x_max' => Schema::TYPE_DOUBLE . " NULL",
    'x_min' => Schema::TYPE_DOUBLE . " NULL",
    'z_max' => Schema::TYPE_DOUBLE . " NULL",
    'z_min' => Schema::TYPE_DOUBLE . " NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// SharedApplication
$this->createTable('{{%SharedApplication}}', [
    'shared_application_id' => Schema::TYPE_PK,
    'application_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'user_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// Ubox
$this->createTable('{{%Ubox}}', [
    'ubox_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(100) NOT NULL",
    'ubox_type_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'ubox_config_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'place_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'ubox_status_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'serial_no' => Schema::TYPE_STRING . "(100) NULL",
    'hardware_code' => Schema::TYPE_STRING . "(100) NULL",
    'remote_access_notes' => Schema::TYPE_TEXT . " NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// UboxConfig
$this->createTable('{{%UboxConfig}}', [
    'ubox_config_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(50) NULL",
    'app_ulibrary_url' => Schema::TYPE_STRING . "(250) NULL",
    'app_ulolaing_gif_url' => Schema::TYPE_STRING . "(250) NULL",
    'app_uloading_page_url' => Schema::TYPE_STRING . "(250) NULL",
    'app_ulogo_url' => Schema::TYPE_STRING . "(250) NULL",
    'app_uupdate_library_url' => Schema::TYPE_STRING . "(250) NULL",
    'app_folder' => Schema::TYPE_STRING . "(250) NULL",
    'browser_path' => Schema::TYPE_STRING . "(250) NULL",
    'api_url' => Schema::TYPE_STRING . "(250) NULL",
    'api_get_html' => Schema::TYPE_STRING . "(250) NULL",
    'api_get_source' => Schema::TYPE_STRING . "(250) NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// UboxProfile
$this->createTable('{{%UboxProfile}}', [
    'ubox_profile_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(45) NULL",
    'is_current' => Schema::TYPE_INTEGER . "(1) NOT NULL DEFAULT '0'",
    'ubox_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'layout_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'display_screen_size_id' => Schema::TYPE_INTEGER . "(11) NULL",
], $this->tableOptions);

// UboxProfileDetail
$this->createTable('{{%UboxProfileDetail}}', [
    'ubox_profile_detail_id' => Schema::TYPE_PK,
    'ubox_profile_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'display_area_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'display_channel_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// UboxStatus
$this->createTable('{{%UboxStatus}}', [
    'ubox_status_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(45) NULL",
    'description' => Schema::TYPE_STRING . "(150) NULL",
], $this->tableOptions);

// UboxType
$this->createTable('{{%UboxType}}', [
    'ubox_type_id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(45) NOT NULL",
], $this->tableOptions);

// User
$this->createTable('{{%User}}', [
    'user_id' => Schema::TYPE_PK,
    'member_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'name' => Schema::TYPE_STRING . "(150) NOT NULL",
    'email' => Schema::TYPE_STRING . "(45) NOT NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
    'phone' => Schema::TYPE_INTEGER . "(15) NULL",
    'lastname' => Schema::TYPE_STRING . "(45) NULL",
    'deleted' => Schema::TYPE_INTEGER . "(1) NULL DEFAULT '0'",
], $this->tableOptions);

// UserPlace
$this->createTable('{{%UserPlace}}', [
    'user_place_id' => Schema::TYPE_PK,
    'user_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'place_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'access_type_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// UserUbox
$this->createTable('{{%UserUbox}}', [
    'user_ubox_id' => Schema::TYPE_PK,
    'user_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'ubox_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'access_type_id' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'created_by' => Schema::TYPE_STRING . "(45) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updated_by' => Schema::TYPE_STRING . "(45) NULL",
], $this->tableOptions);

// auth_assignment
$this->createTable('{{%auth_assignment}}', [
    'item_name' => Schema::TYPE_STRING . "(64) NOT NULL",
    'user_id' => Schema::TYPE_STRING . "(64) NOT NULL",
    'created_at' => Schema::TYPE_INTEGER . "(11) NULL",
    'PRIMARY KEY (item_name, user_id)',
], $this->tableOptions);

// auth_item
$this->createTable('{{%auth_item}}', [
    'name' => Schema::TYPE_STRING . "(64) NOT NULL",
    'type' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'description' => Schema::TYPE_TEXT . " NULL",
    'rule_name' => Schema::TYPE_STRING . "(64) NULL",
    'data' => Schema::TYPE_TEXT . " NULL",
    'created_at' => Schema::TYPE_INTEGER . "(11) NULL",
    'updated_at' => Schema::TYPE_INTEGER . "(11) NULL",
    'PRIMARY KEY (name)',
], $this->tableOptions);

// auth_item_child
$this->createTable('{{%auth_item_child}}', [
    'parent' => Schema::TYPE_STRING . "(64) NOT NULL",
    'child' => Schema::TYPE_STRING . "(64) NOT NULL",
    'PRIMARY KEY (parent, child)',
], $this->tableOptions);

// auth_rule
$this->createTable('{{%auth_rule}}', [
    'name' => Schema::TYPE_STRING . "(64) NOT NULL",
    'data' => Schema::TYPE_TEXT . " NULL",
    'created_at' => Schema::TYPE_INTEGER . "(11) NULL",
    'updated_at' => Schema::TYPE_INTEGER . "(11) NULL",
    'PRIMARY KEY (name)',
], $this->tableOptions);

// ec_mm_member
$this->createTable('{{%ec_mm_member}}', [
    'id' => Schema::TYPE_PK,
    'username' => Schema::TYPE_STRING . "(255) NOT NULL",
    'auth_key' => Schema::TYPE_STRING . "(32) NOT NULL",
    'password_hash' => Schema::TYPE_STRING . "(255) NOT NULL",
    'password_reset_token' => Schema::TYPE_STRING . "(255) NULL",
    'email' => Schema::TYPE_STRING . "(255) NOT NULL",
    'status' => Schema::TYPE_SMALLINT . "(6) NOT NULL DEFAULT '10'",
    'created_at' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'updated_at' => Schema::TYPE_INTEGER . "(11) NOT NULL",
    'access_token' => Schema::TYPE_STRING . "(255) NULL",
], $this->tableOptions);

// ec_parameters
$this->createTable('{{%ec_parameters}}', [
    'id' => Schema::TYPE_PK,
    'name' => Schema::TYPE_STRING . "(100) NOT NULL",
    'value' => Schema::TYPE_STRING . "(255) NULL",
    'disabled' => Schema::TYPE_SMALLINT . "(4) NOT NULL DEFAULT '0'",
    'created' => Schema::TYPE_DATETIME . " NULL",
    'createdBy' => Schema::TYPE_STRING . "(40) NULL",
    'updated' => Schema::TYPE_DATETIME . " NULL",
    'updatedBy' => Schema::TYPE_STRING . "(40) NULL",
], $this->tableOptions);

// fk: AdminUser
$this->addForeignKey('fk_AdminUser_member_id', '{{%AdminUser}}', 'member_id', '{{%ec_mm_member}}', 'id');

// fk: ApplicationAccess
$this->addForeignKey('fk_ApplicationAccess_user_id', '{{%ApplicationAccess}}', 'user_id', '{{%User}}', 'user_id');
$this->addForeignKey('fk_ApplicationAccess_access_type_id', '{{%ApplicationAccess}}', 'access_type_id', '{{%AccessType}}', 'access_type_id');
$this->addForeignKey('fk_ApplicationAccess_application_id', '{{%ApplicationAccess}}', 'application_id', '{{%Application}}', 'application_id');

// fk: ApplicationParameter
$this->addForeignKey('fk_ApplicationParameter_application_id', '{{%ApplicationParameter}}', 'application_id', '{{%Application}}', 'application_id');

// fk: ApplicationResource
$this->addForeignKey('fk_ApplicationResource_application_id', '{{%ApplicationResource}}', 'application_id', '{{%Application}}', 'application_id');

// fk: ApplicationVersion
$this->addForeignKey('fk_ApplicationVersion_application_id', '{{%ApplicationVersion}}', 'application_id', '{{%Application}}', 'application_id');

// fk: DisplayArea
$this->addForeignKey('fk_DisplayArea_layout_id', '{{%DisplayArea}}', 'layout_id', '{{%DisplayLayout}}', 'display_layout_id');

// fk: DisplayChannel
$this->addForeignKey('fk_DisplayChannel_ubox_id', '{{%DisplayChannel}}', 'ubox_id', '{{%Ubox}}', 'ubox_id');

// fk: DisplayProgram
$this->addForeignKey('fk_DisplayProgram_display_channel_id', '{{%DisplayProgram}}', 'display_channel_id', '{{%DisplayChannel}}', 'display_channel_id');
$this->addForeignKey('fk_DisplayProgram_installation_id', '{{%DisplayProgram}}', 'installation_id', '{{%Installation}}', 'installation_id');

// fk: Installation
$this->addForeignKey('fk_Installation_ubox_id', '{{%Installation}}', 'ubox_id', '{{%Ubox}}', 'ubox_id');
$this->addForeignKey('fk_Installation_market_application_id', '{{%Installation}}', 'market_application_id', '{{%MarketApplication}}', 'mp_application_id');
$this->addForeignKey('fk_Installation_shared_application_id', '{{%Installation}}', 'shared_application_id', '{{%SharedApplication}}', 'shared_application_id');

// fk: InstallationParameter
$this->addForeignKey('fk_InstallationParameter_application_parameter_id', '{{%InstallationParameter}}', 'application_parameter_id', '{{%ApplicationParameter}}', 'application_parameter_id');
$this->addForeignKey('fk_InstallationParameter_installation_id', '{{%InstallationParameter}}', 'installation_id', '{{%Installation}}', 'installation_id');

// fk: MarketApplication
$this->addForeignKey('fk_MarketApplication_mp_status_application_id', '{{%MarketApplication}}', 'mp_status_application_id', '{{%MarketStatusApplication}}', 'market_status_application_id');
$this->addForeignKey('fk_MarketApplication_application_id', '{{%MarketApplication}}', 'application_id', '{{%Application}}', 'application_id');

// fk: MarketApplicationVersion
$this->addForeignKey('fk_MarketApplicationVersion_market_application_id', '{{%MarketApplicationVersion}}', 'market_application_id', '{{%MarketApplication}}', 'mp_application_id');

// fk: SharedApplication
$this->addForeignKey('fk_SharedApplication_user_id', '{{%SharedApplication}}', 'user_id', '{{%User}}', 'user_id');
$this->addForeignKey('fk_SharedApplication_application_id', '{{%SharedApplication}}', 'application_id', '{{%Application}}', 'application_id');

// fk: Ubox
$this->addForeignKey('fk_Ubox_ubox_status_id', '{{%Ubox}}', 'ubox_status_id', '{{%UboxStatus}}', 'ubox_status_id');
$this->addForeignKey('fk_Ubox_place_id', '{{%Ubox}}', 'place_id', '{{%Place}}', 'place_id');
$this->addForeignKey('fk_Ubox_ubox_config_id', '{{%Ubox}}', 'ubox_config_id', '{{%UboxConfig}}', 'ubox_config_id');
$this->addForeignKey('fk_Ubox_ubox_type_id', '{{%Ubox}}', 'ubox_type_id', '{{%UboxType}}', 'ubox_type_id');

// fk: UboxProfile
$this->addForeignKey('fk_UboxProfile_display_screen_size_id', '{{%UboxProfile}}', 'display_screen_size_id', '{{%DisplayScreenSize}}', 'display_screen_size_id');
$this->addForeignKey('fk_UboxProfile_layout_id', '{{%UboxProfile}}', 'layout_id', '{{%DisplayLayout}}', 'display_layout_id');
$this->addForeignKey('fk_UboxProfile_ubox_id', '{{%UboxProfile}}', 'ubox_id', '{{%Ubox}}', 'ubox_id');

// fk: UboxProfileDetail
$this->addForeignKey('fk_UboxProfileDetail_display_area_id', '{{%UboxProfileDetail}}', 'display_area_id', '{{%DisplayArea}}', 'display_area_id');
$this->addForeignKey('fk_UboxProfileDetail_display_channel_id', '{{%UboxProfileDetail}}', 'display_channel_id', '{{%DisplayChannel}}', 'display_channel_id');
$this->addForeignKey('fk_UboxProfileDetail_ubox_profile_id', '{{%UboxProfileDetail}}', 'ubox_profile_id', '{{%UboxProfile}}', 'ubox_profile_id');

// fk: UserPlace
$this->addForeignKey('fk_UserPlace_access_type_id', '{{%UserPlace}}', 'access_type_id', '{{%AccessType}}', 'access_type_id');
$this->addForeignKey('fk_UserPlace_place_id', '{{%UserPlace}}', 'place_id', '{{%Place}}', 'place_id');
$this->addForeignKey('fk_UserPlace_user_id', '{{%UserPlace}}', 'user_id', '{{%User}}', 'user_id');

// fk: UserUbox
$this->addForeignKey('fk_UserUbox_access_type_id', '{{%UserUbox}}', 'access_type_id', '{{%AccessType}}', 'access_type_id');
$this->addForeignKey('fk_UserUbox_ubox_id', '{{%UserUbox}}', 'ubox_id', '{{%Ubox}}', 'ubox_id');
$this->addForeignKey('fk_UserUbox_user_id', '{{%UserUbox}}', 'user_id', '{{%User}}', 'user_id');

// fk: auth_assignment
$this->addForeignKey('fk_auth_assignment_item_name', '{{%auth_assignment}}', 'item_name', '{{%auth_item}}', 'name');

// fk: auth_item
$this->addForeignKey('fk_auth_item_rule_name', '{{%auth_item}}', 'rule_name', '{{%auth_rule}}', 'name');

// fk: auth_item_child
$this->addForeignKey('fk_auth_item_child_parent', '{{%auth_item_child}}', 'parent', '{{%auth_item}}', 'name');
$this->addForeignKey('fk_auth_item_child_child', '{{%auth_item_child}}', 'child', '{{%auth_item}}', 'name');