Play Framework DML插入脚本 [英] Play Framework DML insert script

查看:115
本文介绍了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插入脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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