package sihl-type

  1. Overview
  2. Docs

Source file migration.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
type step =
  { label : string
  ; statement : string
  ; check_fk : bool
  }
[@@deriving show, eq]

type t = string * step list [@@deriving show, eq]

let create_step ~label ?(check_fk = true) statement = { label; check_fk; statement }
let empty namespace = namespace, []

(* Append the migration step to the list of steps *)
let add_step step (label, steps) = label, List.concat [ steps; [ step ] ]