Skip to content

Commit

Permalink
add specific sql script for oracle database (helidon-io#8426)
Browse files Browse the repository at this point in the history
Signed-off-by: tvallin <thibault.vallin@oracle.com>
  • Loading branch information
tvallin authored and hrstoyanov committed Mar 12, 2024
1 parent 581ea71 commit 437d7b9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@
</method>
<method name="h2">
<output if="${db.server} == 'h2'">
<file source="../database/files/src/main/resources/META-INF/init_script.sql.default"
target="src/main/resources/META-INF/init_script.sql"/>
<model>
<value key="readme-description">Helidon MP application that uses JPA with an in-memory H2 database.</value>
<value key="integration-artifactId">h2</value>
Expand Down Expand Up @@ -276,6 +278,8 @@ For details, see https://www.h2database.com/html/cheatSheet.html
</method>
<method name="mysql">
<output if="${db.server} == 'mysql'">
<file source="../database/files/src/main/resources/META-INF/init_script.sql.default"
target="src/main/resources/META-INF/init_script.sql"/>
<model>
<value key="helidon-test">false</value>
<value key="readme-description">Helidon MP application that uses the dbclient API with MySQL database.</value>
Expand Down Expand Up @@ -320,6 +324,8 @@ docker run --rm --name mysql -p 3306:3306 \
</method>
<method name="oracle">
<output if="${db.server} == 'oracledb'">
<file source="../database/files/src/main/resources/META-INF/init_script.sql.oracle"
target="src/main/resources/META-INF/init_script.sql"/>
<templates engine="mustache" transformations="mustache,packaged">
<directory>../database/files</directory>
<includes>
Expand Down Expand Up @@ -376,12 +382,6 @@ For details on an Oracle Docker image, see https://github.com/oracle/docker-imag
<call method="mysql" />
<call method="oracle" />
<output>
<files>
<directory>../database/files</directory>
<includes>
<include>src/*/resources/*/init_script.sql</include>
</includes>
</files>
<templates engine="mustache" transformations="mustache,packaged">
<directory>../database/files</directory>
<includes>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
INSERT INTO POKEMONTYPE VALUES (1, 'Normal')
INSERT INTO POKEMONTYPE VALUES (2, 'Fighting')
INSERT INTO POKEMONTYPE VALUES (3, 'Flying')
INSERT INTO POKEMONTYPE VALUES (4, 'Poison')
INSERT INTO POKEMONTYPE VALUES (5, 'Ground')
INSERT INTO POKEMONTYPE VALUES (6, 'Rock')
INSERT INTO POKEMONTYPE VALUES (7, 'Bug')
INSERT INTO POKEMONTYPE VALUES (8, 'Ghost')
INSERT INTO POKEMONTYPE VALUES (9, 'Steel')
INSERT INTO POKEMONTYPE VALUES (10, 'Fire')
INSERT INTO POKEMONTYPE VALUES (11, 'Water')
INSERT INTO POKEMONTYPE VALUES (12, 'Grass')
INSERT INTO POKEMONTYPE VALUES (13, 'Electric')
INSERT INTO POKEMONTYPE VALUES (14, 'Psychic')
INSERT INTO POKEMONTYPE VALUES (15, 'Ice')
INSERT INTO POKEMONTYPE VALUES (16, 'Dragon')
INSERT INTO POKEMONTYPE VALUES (17, 'Dark')
INSERT INTO POKEMONTYPE VALUES (18, 'Fairy')

INSERT INTO POKEMON VALUES (1, 'Bulbasaur', 12)
INSERT INTO POKEMON VALUES (2, 'Charmander', 10)
INSERT INTO POKEMON VALUES (3, 'Squirtle', 11)
INSERT INTO POKEMON VALUES (4, 'Caterpie', 7)
INSERT INTO POKEMON VALUES (5, 'Weedle', 7)
INSERT INTO POKEMON VALUES (6, 'Pidgey', 3)

0 comments on commit 437d7b9

Please sign in to comment.