Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any easy way to generate a build script from an H2 database?

let's image that one creates an H2 database with table, indexes, etc... Is there an easy way to extract a SQL script to recreate the structure of this database in another H2 database?

I am not referring to the content of the tables, indexes, etc... I am just interested in the general structure of the database to replicate it elsewhere. Thanks.

like image 273
Jérôme Verstrynge Avatar asked Mar 29 '11 08:03

Jérôme Verstrynge


1 Answers

I would use SCRIPT NODATA (returns a result set) or SCRIPT NODATA TO 'fileName'.

like image 131
Thomas Mueller Avatar answered Sep 27 '22 23:09

Thomas Mueller