本文介绍了Play Framework DML插入脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将Play Framework 2.3与Slick和内存中的H2数据库一起使用.当我启动应用程序时,我不仅要从Evolution脚本创建数据库,还要插入一些默认数据. Play文档中似乎没有涵盖该主题.
I am using Play Framework 2.3 with Slick and an in-memory H2 databse. When I start the application, I would like to not only create the database from the evolution script, but as well insert some default data. This topic doesen't seem to be covered in the Play documentation.
推荐答案可以创建自定义的演变脚本并将DML放入其中.有一个具有此功能的激活器模板–参见2.sql文件此处
It is possible to create a custom evolution script and place the DML in it. There is an activator template with this functionality – see the 2.sql file here.
更多推荐
Play Framework DML插入脚本
发布评论