Spring Boot DDL自动生成器 [英] Spring boot ddl auto generator

查看:273
本文介绍了Spring Boot DDL自动生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Spring Boot与spring.jpa.hibernate.ddl-auto=create一起使用,但是当应用程序重新启动时,所有表都会删除并再次创建.有什么方法可以避免重新创建已经存在的表?

I'm using spring boot with spring.jpa.hibernate.ddl-auto=create, but when application restarted, all tables drops and creates again. Is there some way to avoiding re-creation for already existing tables?

推荐答案

spring.jpa.hibernate.ddl-auto=update

hibernate.ddl -auto 通常不应在生产中使用.

hibernate.ddl-auto should usually not be used in production.

这篇关于Spring Boot DDL自动生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆