<commit_before><?php

class m160819_094559_optom_comment_alert extends CDbMigration
{
	public function up()
	{
		$this->insert('setting_metadata', array(
			'element_type_id' => null,
			'field_type_id' => SettingFieldType::model()->find('name = "Text Field"')->id,
			'key' => 'optom_comment_alert',
			'name' => 'Address For Optom Comment Alerts',
			'default_value' => '',
		));
	}

	public function down()
	{
		echo "m160819_094559_optom_comment_alert does not support migration down.\n";
		return false;
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}<commit_msg>+ alternate and hopefully more robust request for getting the setting meta type id<commit_after><?php

class m160819_094559_optom_comment_alert extends CDbMigration
{
    public function up()
    {
        $setting_field_type_id = $this->dbConnection->createCommand()
            ->select('id')
            ->from('setting_field_type')
            ->where('name = :name', array(':name' => 'Text Field'))
            ->queryScalar();

        $this->insert('setting_metadata', array(
            'element_type_id' => null,
            'field_type_id' => $setting_field_type_id,
            'key' => 'optom_comment_alert',
            'name' => 'Address For Optom Comment Alerts',
            'default_value' => '',
        ));
    }

    public function down()
    {
        echo "m160819_094559_optom_comment_alert does not support migration down.\n";
        return false;
    }

    /*
    // Use safeUp/safeDown to do migration with transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
{'fraction_non_alphanumeric': 0.12772218952324896, 'fraction_numerical': 0.028251912889935255, 'mean_word_length': 2.8374717832957113, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2147898', 'n_tokens_mistral': 575, 'n_tokens_neox': 534, 'n_words': 121}