I want to deploy my Java application to Heroku, I'm using eclipse link JPA.
To do that I need to create the tables via a Java, so far I've got the code below but how do I get the DDL to create a table. I'll be running the app on MySQL for development and Heroku is Postgres for production. Therefore, I'd like the create table statement to take this into account.
import javax.persistence.*;
public class SchemaCreator
{
public static void main(String[] args)
{
EntityManagerFactory factory =
Persistence.createEntityManagerFactory("bitcoin");
EntityManager em = factory.createEntityManager();
String ddl = /// <--- How do I get it ?
em.createNativeQuery(ddl);
}
}