Как я могу добиться, чтобы data.sql выполнялся только один раз?
Я загружаю около 200000 строк исходных данных.Есть ли лучший способ сделать это, чем положить его в data.sql?Моя проблема в том, что весенняя загрузка пытается загрузить его, даже если данные уже были загружены в предыдущий раз.
Моя текущая конфигурация:
server.port = 8088
#logging.level.org.hibernate.SQL=DEBUG
#logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
logging.level.org.springframework.web=INFO
logging.level.org.hibernate=INFO
#logging.file=c:/temp/my-log/app.log
# ==============================================================
# = Data Source
# ==============================================================
#spring.datasource.url=jdbc:h2:~/database/chinese;AUTO_SERVER=TRUE
spring.datasource.url=jdbc:h2:file:~/database/chinese;AUTO_SERVER=TRUE
spring.datasource.username=SA
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver
# H2
spring.h2.console.enabled=true
spring.h2.console.path=/h2
# ==============================================================
# = Keep the connection alive if idle for a long time (needed in production)
# ==============================================================
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
# ==============================================================
# = Show or not log for each sql query
# ==============================================================
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.format_sql=false
# ==============================================================
# = Hibernate ddl auto (create, create-drop, update)
# ==============================================================
spring.jpa.hibernate.ddl-auto = update
#spring.jpa.hibernate.ddl-auto = create-drop
# ==============================================================
# = The SQL dialect makes Hibernate generate better SQL for the chosen database
# ==============================================================
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.H2Dialect
# ==============================================================
# = Spring Security / Queries for AuthenticationManagerBuilder
# ==============================================================
spring.queries.users-query=select email, password, active from user where email=?
spring.queries.roles-query=select u.email, r.role from user u inner join user_role ur on(u.user_id=ur.user_id) inner join role r on(ur.role_id=r.role_id) where u.email=?
# ==============================================================
# = Initialize the database using data.sql script
# ==============================================================
#spring.datasource.initialization-mode=always
#spring.jpa.properties.hibernate.hbm2ddl.import_files=characters.sql, zdtStrokeData.sql, cedict_ts.u8.sql