Play!: Does Slick's DDL replace Evolutions?

后端 未结 2 1564
有刺的猬
有刺的猬 2021-01-07 22:56

This may be a dumb question but I\'m new to Play! & Slick. While using Slick\'s table.ddl.create I noticed that it doesn\'t create an evolution but the appl

2条回答
  •  误落风尘
    2021-01-07 23:33

    Slick is able to generate DDL for your defined tables it does not contain logic that does what evolutions does.

    The play slick plugin on the other hand contains a SlickDDLPlugin that will generate and run DDL evolutions for you when you run your app in non prod-mode (with play run for example) It also dumps out those evolutions in your conf/evolutions directory.

    The sources that handles evolutions: https://github.com/freekh/play-slick/blob/master/src/main/scala/play/api/db/slick/plugin/SlickPlugin.scala

提交回复
热议问题