<commit_before><?php

class m121114_110229_patient_oph_info extends CDbMigration
{
	public function up()
	{
		$this->createTable('patient_oph_info_cvi_status', array(
				'id' => 'int(10) unsigned NOT NULL AUTO_INCREMENT',
				'name' => 'varchar(128) COLLATE utf8_bin NOT NULL',
				'display_order' => 'int(10) unsigned NOT NULL DEFAULT 1',
				'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\'',
				'PRIMARY KEY (`id`)',
				'KEY `et_ophauanaestheticsataudit_ramsayscore_score_lmui_fk` (`last_modified_user_id`)',
				'KEY `et_ophauanaestheticsataudit_ramsayscore_score_cui_fk` (`created_user_id`)',
				'CONSTRAINT `et_ophauanaestheticsataudit_ramsayscore_score_lmui_fk` FOREIGN KEY (`last_modified_user_id`) REFERENCES `user` (`id`)',
				'CONSTRAINT `et_ophauanaestheticsataudit_ramsayscore_score_cui_fk` FOREIGN KEY (`created_user_id`) REFERENCES `user` (`id`)',
		), 'ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin');
		
		$this->insert('patient_oph_info_cvi_status',array('name'=>'Unknown','display_order'=>1));
		$this->insert('patient_oph_info_cvi_status',array('name'=>'Not Certified','display_order'=>2));
		$this->insert('patient_oph_info_cvi_status',array('name'=>'Sight Impaired','display_order'=>3));
		$this->insert('patient_oph_info_cvi_status',array('name'=>'Severely Sight Impaired','display_order'=>4));
		
		$this->createTable('patient_oph_info',array(
				'id' => 'int(10) unsigned NOT NULL AUTO_INCREMENT',
				'patient_id' => 'int(10) unsigned NOT NULL',
				'cvi_status_date' => 'varchar(10) NOT NULL',
				'cvi_status_id' => 'int(10) unsigned NOT NULL',
				'last_modified_date' => 'datetime NOT NULL DEFAULT \'1900-01-01 00:00:00\'',
				'last_modified_user_id' => 'int(10) unsigned NOT NULL DEFAULT \'1\'',
				'created_user_id' => 'int(10) unsigned NOT NULL DEFAULT \'1\'',<commit_msg>+ fix constraint names on cvi status lookup table<commit_after><?php

class m121114_110229_patient_oph_info extends CDbMigration
{
	public function up()
	{
		$this->createTable('patient_oph_info_cvi_status', array(
				'id' => 'int(10) unsigned NOT NULL AUTO_INCREMENT',
				'name' => 'varchar(128) COLLATE utf8_bin NOT NULL',
				'display_order' => 'int(10) unsigned NOT NULL DEFAULT 1',
				'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\'',
				'PRIMARY KEY (`id`)',
				'KEY `patient_oph_info_cvi_status_lmui_fk` (`last_modified_user_id`)',
				'KEY `patient_oph_info_cvi_status_cui_fk` (`created_user_id`)',
				'CONSTRAINT `patient_oph_info_cvi_status_lmui_fk` FOREIGN KEY (`last_modified_user_id`) REFERENCES `user` (`id`)',
				'CONSTRAINT `patient_oph_info_cvi_status_cui_fk` FOREIGN KEY (`created_user_id`) REFERENCES `user` (`id`)',
		), 'ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin');
		
		$this->insert('patient_oph_info_cvi_status',array('name'=>'Unknown','display_order'=>1));
		$this->insert('patient_oph_info_cvi_status',array('name'=>'Not Certified','display_order'=>2));
		$this->insert('patient_oph_info_cvi_status',array('name'=>'Sight Impaired','display_order'=>3));
		$this->insert('patient_oph_info_cvi_status',array('name'=>'Severely Sight Impaired','display_order'=>4));
		
		$this->createTable('patient_oph_info',array(
				'id' => 'int(10) unsigned NOT NULL AUTO_INCREMENT',
				'patient_id' => 'int(10) unsigned NOT NULL',
				'cvi_status_date' => 'varchar(10) NOT NULL',
				'cvi_status_id' => 'int(10) unsigned NOT NULL',
				'last_modified_date' => 'datetime NOT NULL DEFAULT \'1900-01-01 00:00:00\'',
				'last_modified_user_id' => 'int(10) unsigned NOT NULL DEFAULT \'1\'',
				'created_user_id' => 'int(10) unsigned NOT NULL DEFAULT \'1\'',
{'fraction_non_alphanumeric': 0.16175748649975455, 'fraction_numerical': 0.043691703485517916, 'mean_word_length': 6.315978456014363, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 59, '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': '4820404', 'n_tokens_mistral': 1742, 'n_tokens_neox': 1487, 'n_words': 279}