-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
testcontainers#24 Support custom Docker images for Postgres (i.e. Pos…
…tgis)
- Loading branch information
1 parent
7e8fa3d
commit 0abf0a1
Showing
6 changed files
with
129 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "automatic" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.testcontainers</groupId> | ||
<artifactId>testcontainers-jooq-codegen-maven-plugin-test</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
|
||
<properties> | ||
<java.version>17</java.version> | ||
<testcontainers.version>1.18.3</testcontainers.version> | ||
<testcontainers-jooq-codegen-maven-plugin.version>0.0.3</testcontainers-jooq-codegen-maven-plugin.version> | ||
<jooq.version>3.18.3</jooq.version> | ||
<postgresql.version>42.6.0</postgresql.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.jooq</groupId> | ||
<artifactId>jooq-codegen</artifactId> | ||
<version>${jooq.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jooq</groupId> | ||
<artifactId>jooq</artifactId> | ||
<version>${jooq.version}</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>testcontainers-jooq-codegen-maven-plugin</artifactId> | ||
<version>${testcontainers-jooq-codegen-maven-plugin.version}</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>postgresql</artifactId> | ||
<version>${testcontainers.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.postgresql</groupId> | ||
<artifactId>postgresql</artifactId> | ||
<version>${postgresql.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
<executions> | ||
<execution> | ||
<id>generate</id> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
<phase>generate-sources</phase> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<database> | ||
<type>POSTGRES</type> | ||
<containerImage>postgis/postgis:15-3.4-alpine</containerImage> | ||
<username>test</username> | ||
<password>test</password> | ||
<databaseName>test</databaseName> | ||
</database> | ||
<flyway> | ||
<locations> | ||
filesystem:${project.basedir}/src/main/resources/db/migration/postgres | ||
</locations> | ||
</flyway> | ||
<jooq> | ||
<generator> | ||
<database> | ||
<includes>.*</includes> | ||
<inputSchema>public</inputSchema> | ||
</database> | ||
<target> | ||
<packageName>org.jooq.codegen.maven.test</packageName> | ||
<directory>target/generated-sources/jooq</directory> | ||
</target> | ||
</generator> | ||
</jooq> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
16 changes: 16 additions & 0 deletions
16
...sources/pom/postgis-flyway/src/main/resources/db/migration/postgres/V1__create_tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
create sequence user_id_seq start with 1 increment by 5; | ||
|
||
create table users | ||
( | ||
id bigint DEFAULT nextval('user_id_seq') not null, | ||
email varchar not null, | ||
password varchar not null, | ||
name varchar not null, | ||
role varchar not null, | ||
verified bool not null default false, | ||
verification_token varchar, | ||
created_at timestamp, | ||
updated_at timestamp, | ||
primary key (id), | ||
CONSTRAINT user_email_unique UNIQUE (email) | ||
); |