0% found this document useful (0 votes)
7 views

files

Uploaded by

fathurrahman
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

files

Uploaded by

fathurrahman
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

liquibase

<?xml version="1.0" encoding="UTF-8"?>

<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">

<!--
See http://www.liquibase.org/manual/home#available_database_refactorings
for a list of supported elements and attributes
-->

<changeSet id="harinidrugorder-1" author="harini">


<sql>
drop table if exists drugorders;
</sql>
</changeSet>

<changeSet id="harinidrugorder-2" author="harini">


<preConditions onFail="WARN" onError="WARN">
<not>
<tableExists tableName="drugorders" />
</not>
</preConditions>
<createTable tableName="drugorders">
<column name="id" type="int" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="order_id" type="int">
<constraints nullable="false" foreignKeyName="order_id"
references="orders(order_id)" />
</column>
<column name="uuid" type="varchar(255)"></column>
<column name="drug_name" type="varchar(255)"></column>
<column name="dose" type="int"></column>
<column name="quantity" type="int"></column>
<column name="duration" type="int"></column>
<column name="associated_diagnosis" type="varchar(65525)"></column>
<column name="patient_instructions" type="varchar(65525)"></column>
<column name="pharmacist_instructions" type="varchar(65525)"></column>

</createTable>
</changeSet>

</databaseChangeLog>
----------------------------------------

.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="org.openmrs.module.drugOrders">

<!--
<class name="DrugOrders"
table="drugorders">
<id name="id" type="int" column="id" unsaved-value="0">
<generator class="native" />
</id>
<discriminator column="id" insert="false" />
<property name="uuid" type="java.lang.String" column="uuid"
length="38" unique="true" />
</class>
-->

<class name="DrugOrders" table="drugorders">


<id name="id" type="int" column="id" unsaved-value="0">
<generator class="native" />
</id>
<property name="orderId" column="order_id" not-null="true" ></property>
<property name="uuid" type="java.lang.String" column="uuid" not-null="true"
length="38" ></property>
<property name="drug_name" column="drug_name" not-null="false" ></property>
<property name="dose" column="dose" not-null="false" ></property>
<property name="quantity" column="quantity" not-null="false" ></property>
<property name="duration" column="duration" not-null="false" ></property>
<property name="associated_diagnosis" type="java.lang.String"
column="associated_diagnosis" not-null="false" length="50"></property>
<property name="patient_instructions" type="java.lang.String"
column="patient_instructions" not-null="false" length="50"></property>
<property name="pharmacist_instructions" type="java.lang.String"
column="pharmacist_instructions" not-null="false" length="50" ></property>

</class>

</hibernate-mapping>

You might also like