Play Framework DML插入脚本

编程入门 行业动态 更新时间:2024-10-28 12:29:54
本文介绍了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插入脚本

本文发布于:2023-07-11 17:10:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1094793.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚本   Play   Framework   DML

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!