H2 “runscript” command turns all table names into uppercase

后端 未结 2 1180
执笔经年
执笔经年 2021-02-20 08:43

I have a sql script (it is just schema definition). The script is a modified version (getting rid of the bad characters h2 doesn\'t like) of a mysql dumb.

The script ru

相关标签:
2条回答
  • 2021-02-20 09:36

    Found the issue. By default, h2 has this setting set to true DATABASE_TO_UPPER. Setting that to false will save the data as expected. So in my INIT command (before it), I entered:

     jdbc:h2:mem:~/test;DATABASE_TO_UPPER=false;INIT=runscript from '~/schema.sql'
    

    Now the tables are being inserted in the correct case

    0 讨论(0)
  • 2021-02-20 09:37

    Another option is to wrap table/column names in double quotes to preserve casing.

    E.g. create table "products" instead of create table products

    0 讨论(0)
提交回复
热议问题