Test properties

If we are using ebean-test that will automatically set appropriate DLL properties for testing. If we are not using that or just want to understand more and have finer control read on ...

DDL generation and run

Controlling the generation and running of db-create-all.sql and db-drop-all.sql.

Property Description
ddl.generate Set to true to generate the db-create-all.sql and db-drop-all.sql DDL scripts.
ddl.run Set to true to run the db-create-all.sql, db-drop-all.sql and extra DDL scripts
ddl.createOnly Set to true to run the db-create-all.sql but NOT run the db-drop-all.sql. Mostly used with H2 database in-memory testing when we know that the database is not populated / there are no tables to drop first.
ddl.initSql Specify a SQL script to run prior to running the create-all ddl.
ddl.seedSql Specify a SQL script to run after to running the create-all ddl. Typically this inserts seed data into the test database.
ebean.migraton.run Set to true or false to run the migrations when the EbeanServer starts

Example application-test.properties

ebean.db.ddl.generate=true
ebean.db.ddl.run=true
ebean.db.ddl.initSql=initialise-test-db.sql
ebean.db.ddl.seedSql=seed-test-db.sql

datasource.db.username=sa
datasource.db.password=
datasource.db.databaseUrl=jdbc:h2:mem:tests
datasource.db.databaseDriver=org.h2.Driver