<commit_before><?xml version="1.0" encoding="UTF-8"?>
 
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
                  http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
    <!--
        See http://www.liquibase.org/manual/home#available_database_refactorings
        for a list of supported elements and attributes
    -->
    
</databaseChangeLog><commit_msg>Added initial liquibase file for item database.<commit_after><?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
                  http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
    
	<changeSet id="openhmis.cashier-2012-08-24-17:30" author="akmad">
	    <createTable tableName="cashier_item">
		    <column name="item_id" autoIncrement="true" type="int">
			    <constraints nullable="false" primaryKey="true"/>
		    </column>
		    <column defaultValue="" name="name" type="varchar(255)">
			    <constraints nullable="false"/>
		    </column>
		    <column defaultValue="" name="description" type="varchar(500)" />
		    <column name="department_id" type="int">
			    <constraints nullable="false" />
		    </column>

		    <column defaultValueNumeric="0" name="creator" type="int">
			    <constraints nullable="false"/>
		    </column>
		    <column name="date_created" type="DATETIME">
			    <constraints nullable="false"/>
		    </column>
		    <column name="changed_by" type="int"/>
		    <column name="date_changed" type="DATETIME"/>
		    <column defaultValueBoolean="false" name="retired" type="BOOLEAN">
			    <constraints nullable="false"/>
		    </column>
		    <column name="retired_by" type="int"/>
		    <column name="date_retired" type="DATETIME"/>
		    <column name="retire_reason" type="varchar(255)"/>
		    <column name="uuid" type="char(38)" />
	    </createTable>

		<createTable tableName="cashier_item_attribute_type">
			<column name="item_attribute_type_id" type="int" autoIncrement="true">
				<constraints primaryKey="true" nullable="false" />
			</column>
			<column name="name" type="varchar(255)">
				<constraints nullable="false" />
			</column>
			<column name="description" type="varchar(1024)" />
			<column name="datatype" type="varchar(255)" />
			<column name="datatype_config" type="text" />
			<column name="preferred_handler" type="varchar(255)" />
			<column name="handler_config" type="text" />
			<column name="min_occurs" type="int">
				<constraints nullable="false" />
			</column>
			<column name="max_occurs" type="int"/>
			<column name="creator" type="int">
				<constraints nullable="false" />
			</column>
			<column name="date_created" type="datetime">
				<constraints nullable="false" />
			</column>
			<column name="changed_by" type="int" />
			<column name="date_changed" type="datetime" />
			<column name="retired" type="boolean" defaultValueBoolean="false">
				<constraints nullable="false" />
			</column>
			<column name="retired_by" type="int" />
			<column name="date_retired" type="datetime" />
			<column name="retire_reason" type="varchar(255)" defaultValue="null" />
			<column name="uuid" type="char(38)">
				<constraints nullable="false" unique="true" />
			</column>
		</createTable>

		<createTable tableName="cashier_item_attribute">
			<column name="item_attribute_id" type="int" autoIncrement="true">
				<constraints primaryKey="true" nullable="false" />
			</column>
			<column name="item_id" type="int"><constraints nullable="false" /></column>
			<column name="attribute_type_id" type="int"><constraints nullable="false" /></column>
			<column name="value_reference" type="text"><constraints nullable="false" /></column>
			<column name="uuid" type="char(38)"><constraints nullable="false" unique="true" /></column>
			<column name="creator" type="int"><constraints nullable="false"/></column>
			<column name="date_created" type="datetime"><constraints nullable="false"/></column>
			<column name="changed_by" type="int"/>
			<column name="date_changed" type="datetime" />
			<column name="voided" type="boolean" defaultValueBoolean="false">
				<constraints nullable="false"/>
			</column>
			<column name="voided_by" type="int" />
			<column name="date_voided" type="datetime" />
			<column name="void_reason" type="varchar(255)" defaultValue="null"/>
		</createTable>

		<createIndex indexName="name_of_cashier_item" tableName="cashier_item" unique="false">
			<column name="name"/>
			<column name="retired" />
		</createIndex>
		<createIndex indexName="department_cashier_item_name" tableName="cashier_item" unique="false">
			<column name="department_id" />
			<column name="name"/>
			<column name="retired" />
		</createIndex>

		<addForeignKeyConstraint constraintName="user_who_created_cashier_item"
		    baseTableName="cashier_item" baseColumnNames="creator"
		    referencedTableName="users" referencedColumnNames="user_id"
		    deferrable="false" initiallyDeferred="false" />
		<addForeignKeyConstraint constraintName="user_who_changed_cashier_item"
		    baseTableName="cashier_item" baseColumnNames="changed_by"
		    referencedTableName="users" referencedColumnNames="user_id"
		    deferrable="false" initiallyDeferred="false" />
		<addForeignKeyConstraint constraintName="user_who_retired_cashier_item"
		    baseTableName="cashier_item" baseColumnNames="retired_by"
		    referencedTableName="users" referencedColumnNames="user_id"
		    deferrable="false" initiallyDeferred="false" />

		<addForeignKeyConstraint constraintName="cashier_item_attribute_type_creator_fk"
		     baseTableName="cashier_item_attribute_type" baseColumnNames="creator"
		     referencedTableName="users" referencedColumnNames="user_id"/>
		<addForeignKeyConstraint constraintName="cashier_item_attribute_type_changed_by_fk"
		     baseTableName="cashier_item_attribute_type" baseColumnNames="changed_by"
		     referencedTableName="users" referencedColumnNames="user_id"/>
		<addForeignKeyConstraint constraintName="cashier_item_attribute_type_retired_by_fk"
		     baseTableName="cashier_item_attribute_type" baseColumnNames="retired_by"
		     referencedTableName="users" referencedColumnNames="user_id"/>

		<addForeignKeyConstraint constraintName="cashier_item_attribute_attribute_type_id_fk"
		     baseTableName="cashier_item_attribute" baseColumnNames="attribute_type_id"
		     referencedTableName="cashier_item_attribute_type" referencedColumnNames="cashier_item_attribute_type_id" />
		<addForeignKeyConstraint constraintName="cashier_item_attribute_creator_fk"
		     baseTableName="cashier_item_attribute" baseColumnNames="creator"
		     referencedTableName="users" referencedColumnNames="user_id"/>
		<addForeignKeyConstraint constraintName="cashier_item_attribute_changed_by_fk"
		     baseTableName="cashier_item_attribute" baseColumnNames="changed_by"
		     referencedTableName="users" referencedColumnNames="user_id"/>
		<addForeignKeyConstraint constraintName="cashier_item_attribute_voided_by_fk"
		     baseTableName="cashier_item_attribute" baseColumnNames="voided_by"
		     referencedTableName="users" referencedColumnNames="user_id"/>
    </changeSet>    
</databaseChangeLog>
{'fraction_non_alphanumeric': 0.14663978494623656, 'fraction_numerical': 0.010080645161290322, 'mean_word_length': 5.3220050977060325, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 2, '>': 123, 'https://': 0, 'lorem ipsum': 0, 'www.': 9, 'xml': 12}, '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': '1063862', 'n_tokens_mistral': 2640, 'n_tokens_neox': 2292, 'n_words': 335}