You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.6 KiB
45 lines
1.6 KiB
<?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"
|
|
>
|
|
<changeSet id="1" author="stian">
|
|
<preConditions onFail="MARK_RAN">
|
|
<not>
|
|
<tableExists tableName="workout"/>
|
|
</not>
|
|
</preConditions>
|
|
<createTable tableName="workout">
|
|
<column name="id" type="CHAR(10)">
|
|
<constraints nullable="false" primaryKey="true"/>
|
|
</column>
|
|
<column name="created_at" type="TIMESTAMP" defaultValueComputed="0">
|
|
<constraints nullable="false"/>
|
|
</column>
|
|
<column name="device_id" type="CHAR(10)">
|
|
<constraints nullable="false"/>
|
|
</column>
|
|
<column name="program_id" type="CHAR(10)">
|
|
<constraints nullable="false"/>
|
|
</column>
|
|
<column name="status" type="ENUM ('Created', 'Connected', 'Started', 'Stopped', 'Disconnected')">
|
|
<constraints nullable="false"/>
|
|
</column>
|
|
<column name="message" type="VARCHAR(255)">
|
|
<constraints nullable="false"/>
|
|
</column>
|
|
</createTable>
|
|
</changeSet>
|
|
|
|
<changeSet id="2" author="stian">
|
|
<preConditions onFail="MARK_RAN">
|
|
<not>
|
|
<indexExists tableName="workout" indexName="idx_status"/>
|
|
</not>
|
|
</preConditions>
|
|
<createIndex tableName="workout" indexName="idx_status" unique="false">
|
|
<column name="status"/>
|
|
</createIndex>
|
|
</changeSet>
|
|
</databaseChangeLog>
|