【发布时间】:2018-04-11 01:33:20
【问题描述】:
我目前设置了 hibernate.ddl:
spring.jpa.hibernate.ddl-auto = create-drop
我不会一次又一次地丢失我的数据...
我可以使用什么值而不是每次都删除和创建架构
有没有办法更新现有的?
我试图使用 update 代替 create-drop 但它引发了异常:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.3.RELEASE:run (default-cli) on project fno-connector-core:
An exception occurred while running. null: InvocationTargetException:
Failed to execute SQL script statement #1 of URL [file:/D:/..../classes/data.sql]:
insert into users (username, enabled, password, first_name, last_name, email)
values ('admin', true, '************', 'Flexera', 'Admin', 'aurovindosahu@*****.com');
nested exception is java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'admin' for key 'PRIMARY'
【问题讨论】:
标签: mysql hibernate spring-boot