这是我的 application.properties 文件:
application.properties
spring.datasource.url= jdbc:postgresql://localhost:5432/Crypto spring.datasource.username=postgres spring.datasource.password=wololo spring.jpa.hibernate.ddl-auto=update spring.datasource.initialization-mode=always
这是我的 data.sql 文件:
data.sql
INSERT INTO crypto(departure, details, lowest_price_date, lowest_price_ever, coin_name, url) VALUES (null, null, null, 10, 'foooobs', 'http://foo.foo');
问题是,每次重新启动应用程序时,都会添加一个新记录,即使它是上一个会话中的记录。我只想用数据初始化数据库一次,而不想更改它。
有什么想法吗?
ids
INSERT INTO crypto (id, departure, details, lowest_price_date, lowest_price_ever, coin_name, url) ^^ VALUES (1, null, null, null, 10, 'foooobs', 'http://foo.foo'); ^
spring.jpa.hibernate.ddl-auto=update
flyway