Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding MySQL suppport into breakerbox. #33

Merged
merged 1 commit into from
May 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions breakerbox-jdbi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.yammer.breakerbox</groupId>
<artifactId>breakerbox-store</artifactId>
Expand Down
6 changes: 5 additions & 1 deletion breakerbox-jdbi/src/main/resources/migrations/dependency.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
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.3.xsd">
<!-- Defining this database driven property as MySQL has a constraint while creating indexes on VARCHAR columns
Refer: https://stackoverflow.com/questions/15157227/mysql-varchar-index-length -->
<property name="name.type" value="varchar(1024)" dbms="h2,postgresql"/>
<property name="name.type" value="varchar(255)" dbms="mysql"/>
<changeSet id="1" author="chrisgray">
<createTable tableName="dependency">
<column name="id" type="int" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="varchar(1024)">
<column name="name" type="${name.type}">
<constraints nullable="false"/>
</column>
<column name="timestamp" type="bigint">
Expand Down
10 changes: 8 additions & 2 deletions breakerbox-jdbi/src/main/resources/migrations/service.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
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.3.xsd">
<!-- Defining these database driven properties as MySQL has a constraint while creating indexes on VARCHAR columns
Refer: https://stackoverflow.com/questions/15157227/mysql-varchar-index-length -->
<property name="name.type" value="varchar(1024)" dbms="h2,postgresql"/>
<property name="name.type" value="varchar(255)" dbms="mysql"/>
<property name="dependency.type" value="varchar(1024)" dbms="h2,postgresql"/>
<property name="dependency.type" value="varchar(255)" dbms="mysql"/>
<changeSet id="1" author="chrisgray">
<createTable tableName="service">
<column name="id" type="int" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="varchar(1024)">
<column name="name" type="${name.type}">
<constraints nullable="false"/>
</column>
<column name="dependency" type="varchar(1024)">
<column name="dependency" type="${dependency.type}">
<constraints nullable="false"/>
</column>
</createTable>
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<turbine.version>1.0.0</turbine.version>
<dropwizard-auth-ldap.version>1.0.4</dropwizard-auth-ldap.version>
<postgresql.version>42.1.1</postgresql.version>
<mysql.version>5.1.38</mysql.version>
<h2.version>1.4.195</h2.version>
<kubernetes.version>2.2.144</kubernetes.version>
<mockito-core.version>2.8.9</mockito-core.version>
Expand Down Expand Up @@ -105,6 +106,11 @@
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
Expand Down