<commit_before><?php 
class m131104_101736_event_type_OphInDnaextraction extends CDbMigration
{
	public function up()
	{
			if (!$parent_event = $this->dbConnection->createCommand()->select("id")->from("event_type")->where("class_name = :class_name",array(":class_name" => 'OphInBloodsample'))->queryRow()) {
				throw new Exception("Parent event type 'OphInBloodsample' not found, please install the parent module first.");
			}
			$parent_id = $parent_event['id'];
		
		if (!$this->dbConnection->createCommand()->select('id')->from('event_type')->where('class_name=:class_name', array(':class_name'=>'OphInDnaextraction'))->queryRow()) {
			$group = $this->dbConnection->createCommand()->select('id')->from('event_group')->where('name=:name',array(':name'=>'Investigation events'))->queryRow();
			$this->insert('event_type', array('class_name' => 'OphInDnaextraction', 'name' => 'DNA extraction','event_group_id' => $group['id'],'parent_id' => $parent_id));
		}
		$event_type = $this->dbConnection->createCommand()->select('id')->from('event_type')->where('class_name=:class_name', array(':class_name'=>'OphInDnaextraction'))->queryRow();
		if (!$this->dbConnection->createCommand()->select('id')->from('element_type')->where('name=:name and event_type_id=:eventTypeId', array(':name'=>'DNA extraction',':eventTypeId'=>$event_type['id']))->queryRow()) {
			$this->insert('element_type', array('name' => 'DNA extraction','class_name' => 'Element_OphInDnaextraction_DnaExtraction', 'event_type_id' => $event_type['id'], 'display_order' => 1));
		}

		$element_type = $this->dbConnection->createCommand()->select('id')->from('element_type')->where('event_type_id=:eventTypeId and name=:name', array(':eventTypeId'=>$event_type['id'],':name'=>'DNA extraction'))->queryRow();

		$this->createTable('et_ophindnaextraction_dnaextraction', array(
				'id' => 'int(10) unsigned NOT NULL AUTO_INCREMENT',
				'event_id' => 'int(10) unsigned NOT NULL',
				'sample_event_id' => 'int(10) unsigned NOT NULL',
				'box' => 'varchar(5) COLLATE utf8_bin DEFAULT \'\'',
				'letter' => 'varchar(2) COLLATE utf8_bin DEFAULT \'\'',
				'number' => 'varchar(5) COLLATE utf8_bin DEFAULT \'\'',
				'orientry' => 'varchar(8) COLLATE utf8_bin DEFAULT \'\'',
				'extracted_date' => 'date DEFAULT NULL',
				'extracted_by' => 'varchar(255) COLLATE utf8_bin NOT NULL',
				'comments' => 'text COLLATE utf8_bin',
				'dna_concentration' => 'float NULL',
				'volume' => 'int(10) unsigned NULL',
				'last_modified_user_id' => 'int(10) unsigned NOT NULL DEFAULT 1',
				'last_modified_date' => 'datetime NOT NULL DEFAULT \'1901-01-01 00:00:00\'',
				'created_user_id' => 'int(10) unsigned NOT NULL DEFAULT 1',
				'created_date' => 'datetime NOT NULL DEFAULT \'1901-01-01 00:00:00\'',<commit_msg>import fix<commit_after><?php 
class m131104_101736_event_type_OphInDnaextraction extends CDbMigration
{
	public function up()
	{
			if (!$parent_event = $this->dbConnection->createCommand()->select("id")->from("event_type")->where("class_name = :class_name",array(":class_name" => 'OphInBloodsample'))->queryRow()) {
				throw new Exception("Parent event type 'OphInBloodsample' not found, please install the parent module first.");
			}
			$parent_id = $parent_event['id'];
		
		if (!$this->dbConnection->createCommand()->select('id')->from('event_type')->where('class_name=:class_name', array(':class_name'=>'OphInDnaextraction'))->queryRow()) {
			$group = $this->dbConnection->createCommand()->select('id')->from('event_group')->where('name=:name',array(':name'=>'Investigation events'))->queryRow();
			$this->insert('event_type', array('class_name' => 'OphInDnaextraction', 'name' => 'DNA extraction','event_group_id' => $group['id'],'parent_id' => $parent_id));
		}
		$event_type = $this->dbConnection->createCommand()->select('id')->from('event_type')->where('class_name=:class_name', array(':class_name'=>'OphInDnaextraction'))->queryRow();
		if (!$this->dbConnection->createCommand()->select('id')->from('element_type')->where('name=:name and event_type_id=:eventTypeId', array(':name'=>'DNA extraction',':eventTypeId'=>$event_type['id']))->queryRow()) {
			$this->insert('element_type', array('name' => 'DNA extraction','class_name' => 'Element_OphInDnaextraction_DnaExtraction', 'event_type_id' => $event_type['id'], 'display_order' => 1));
		}

		$element_type = $this->dbConnection->createCommand()->select('id')->from('element_type')->where('event_type_id=:eventTypeId and name=:name', array(':eventTypeId'=>$event_type['id'],':name'=>'DNA extraction'))->queryRow();

		$this->createTable('et_ophindnaextraction_dnaextraction', array(
				'id' => 'int(10) unsigned NOT NULL AUTO_INCREMENT',
				'event_id' => 'int(10) unsigned NOT NULL',
				'sample_event_id' => 'int(10) unsigned NOT NULL',
				'box' => 'varchar(5) COLLATE utf8_bin',
				'letter' => 'varchar(2) COLLATE utf8_bin',
				'number' => 'varchar(5) COLLATE utf8_bin',
				'orientry' => 'varchar(8) COLLATE utf8_bin',
				'extracted_date' => 'date DEFAULT NULL',
				'extracted_by' => 'varchar(255) COLLATE utf8_bin',
				'comments' => 'text COLLATE utf8_bin',
				'dna_concentration' => 'float NULL',
				'volume' => 'int(10) unsigned NULL',
				'last_modified_user_id' => 'int(10) unsigned NOT NULL DEFAULT 1',
				'last_modified_date' => 'datetime NOT NULL DEFAULT \'1901-01-01 00:00:00\'',
				'created_user_id' => 'int(10) unsigned NOT NULL DEFAULT 1',
				'created_date' => 'datetime NOT NULL DEFAULT \'1901-01-01 00:00:00\'',
{'fraction_non_alphanumeric': 0.20758847136081723, 'fraction_numerical': 0.024808464064210143, 'mean_word_length': 6.7883522727272725, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 145, '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': '381818', 'n_tokens_mistral': 2080, 'n_tokens_neox': 1855, 'n_words': 302}