Skip to content

Commit 4cd9e18

Browse files
Preethi Gpuneetjaiswal
authored andcommitted
Added a db-migration script (#69)
* Removed OSCache. Using EHCache and Guava instead. (#67) * Gateway HA implementation * perf: Utilize EHCache and Guava cache only * fix: changes after review * docs: update gateway-ha README.md * fix: updated after review * fix: replaced cacheDir with gatewayStateDir * Removed OSCache. Using EHCache and Guava instead. (#67) * Gateway HA implementation * perf: Utilize EHCache and Guava cache only * fix: changes after review * docs: update gateway-ha README.md * fix: updated after review * fix: replaced cacheDir with gatewayStateDir * feat: Added db migration script * fix: removed db-migrator-plugin from validate phase
1 parent 0c52b95 commit 4cd9e18

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

gateway-ha/pom.xml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020
<maven.compiler.source>1.8</maven.compiler.source>
2121
<maven.compiler.target>1.8</maven.compiler.target>
2222
<ehcache.version>2.7.4</ehcache.version>
23+
<activejdbc.version>2.2</activejdbc.version>
24+
<mysqlconnector.version>8.0.17</mysqlconnector.version>
2325
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2426
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
27+
<environments>development</environments>
2528
<app.main.class>com.lyft.data.gateway.ha.HaGatewayLauncher</app.main.class>
2629
</properties>
2730

@@ -45,7 +48,7 @@
4548
<dependency>
4649
<groupId>mysql</groupId>
4750
<artifactId>mysql-connector-java</artifactId>
48-
<version>8.0.17</version>
51+
<version>${mysqlconnector.version}</version>
4952
</dependency>
5053
<!-- Test deps -->
5154
<dependency>
@@ -62,7 +65,7 @@
6265
<dependency>
6366
<groupId>org.javalite</groupId>
6467
<artifactId>activejdbc</artifactId>
65-
<version>2.2</version>
68+
<version>${activejdbc.version}</version>
6669
</dependency>
6770
<dependency>
6871
<groupId>net.sf.ehcache</groupId>
@@ -132,6 +135,22 @@
132135
</execution>
133136
</executions>
134137
</plugin>
138+
<plugin>
139+
<groupId>org.javalite</groupId>
140+
<artifactId>db-migrator-maven-plugin</artifactId>
141+
<version>${activejdbc.version}</version>
142+
<configuration>
143+
<configFile>${project.basedir}/src/migrations/database.properties</configFile>
144+
<environments>${environments}</environments>
145+
</configuration>
146+
<dependencies>
147+
<dependency>
148+
<groupId>mysql</groupId>
149+
<artifactId>mysql-connector-java</artifactId>
150+
<version>${mysqlconnector.version}</version>
151+
</dependency>
152+
</dependencies>
153+
</plugin>
135154
</plugins>
136155
</build>
137-
</project>
156+
</project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
development.driver=com.mysql.cj.jdbc.Driver
2+
development.username=root
3+
development.password=root123
4+
development.url=jdbc:mysql://127.0.0.1:3306/prestogateway
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CREATE DATABASE prestogateway;
2+
3+
CREATE TABLE IF NOT EXISTS gateway_backend (
4+
name VARCHAR(256) PRIMARY KEY,
5+
routing_group VARCHAR (256),
6+
backend_url VARCHAR (256),
7+
active BOOLEAN
8+
);
9+
10+
CREATE TABLE IF NOT EXISTS query_history (
11+
query_id VARCHAR(256) PRIMARY KEY,
12+
query_text VARCHAR (256),
13+
created bigint,
14+
backend_url VARCHAR (256),
15+
user_name VARCHAR(256),
16+
source VARCHAR(256)
17+
);
18+
CREATE INDEX query_history_created_idx ON query_history(created);

0 commit comments

Comments
 (0)