Ajout de la version 3 de la base de donnée:

- Échantillon des recettes non obligation
 - Couleur des recettes
 - Lustre des recettes
This commit is contained in:
FyloZ 2021-03-10 17:05:47 -05:00
parent 8bb0057099
commit 944c736705
4 changed files with 44 additions and 1 deletions

View File

@ -23,6 +23,8 @@ dependencies {
implementation("org.slf4j:slf4j-api:1.7.30")
implementation("ch.qos.logback:logback-classic:1.0.13")
runtimeOnly("mysql:mysql-connector-java:8.0.22")
testImplementation("io.mockk:mockk:1.10.6")
testImplementation("io.kotest:kotest-runner-junit5:4.4.1")
}

View File

@ -5,7 +5,7 @@ import java.io.FileInputStream
import java.util.*
/** The latest version of the database supported by the utility. The [DatabaseUpdaterProperties] target version cannot be higher than this. */
internal const val LATEST_DATABASE_VERSION = 2
internal const val LATEST_DATABASE_VERSION = 3
/** The key of the target version property */
internal const val PROPERTY_TARGET_VERSION = "database.target-version"

View File

@ -0,0 +1,31 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-3.9.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd">
<changeSet id="1" author="william">
<dropNotNullConstraint tableName="recipe" columnName="sample" columnDataType="int"/>
</changeSet>
<changeSet id="2" author="william">
<addColumn tableName="recipe">
<column name="color" type="VARCHAR(7)" defaultValue="#ffffff">
<constraints nullable="false"/>
</column>
<column name="gloss" type="TINYINT" defaultValueNumeric="0">
<constraints nullable="false"/>
</column>
</addColumn>
</changeSet>
<changeSet id="3" author="william">
<update tableName="updater_metadata">
<column name="metadata_value" value="3"/>
<where>metadata_key='version'</where>
</update>
<rollback>
<update tableName="updater_metadata">
<column name="metadata_value" value="2"/>
<where>metadata_key='version'</where>
</update>
</rollback>
</changeSet>
</databaseChangeLog>

View File

@ -0,0 +1,10 @@
<?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.8.xsd">
<include file="/changelogs/changelog.1.xml"/>
<include file="/changelogs/changelog.2.xml"/>
<include file="/changelogs/changelog.3.xml"/>
</databaseChangeLog>