Back

SqlMigration (clj)

(source)

record

Examples

migratus
(ns migratus.test.migrations
  (:require
    [clojure.test :refer [deftest is]]
    [migratus.migration.sql :as sql-mig]
    [migratus.migrations :as sut]
    [migratus.properties :as props]
    [migratus.utils :as utils]))

(deftest test-list-migrations
  (is (= #{(sql-mig/->SqlMigration
             20111202113000
             "create-bar-table"
             "CREATE TABLE IF NOT EXISTS bar(id BIGINT);\n"
             "DROP TABLE IF EXISTS bar;\n")
           (sql-mig/->SqlMigration
             20111202110600
             "create-foo-table"
             "CREATE TABLE IF NOT EXISTS foo(id bigint);\n"
             "DROP TABLE IF EXISTS foo;\n")
           (sql-mig/->SqlMigration
             20120827170200
             "multiple-statements"
             multi-stmt-up
             multi-stmt-down)}
        (set (sut/list-migrations {:migration-dir "migrations"})))))
yogthos/migratus
(ns migratus.test.migrations
  (:require
    [clojure.test :refer [deftest is]]
    [migratus.migration.sql :as sql-mig]
    [migratus.migrations :as sut]
    [migratus.properties :as props]
    [migratus.utils :as utils]))

(deftest test-list-migrations
  (is (= #{(sql-mig/->SqlMigration
             20111202113000
             "create-bar-table"
             "CREATE TABLE IF NOT EXISTS bar(id BIGINT);\n"
             "DROP TABLE IF EXISTS bar;\n")
           (sql-mig/->SqlMigration
             20111202110600
             "create-foo-table"
             "CREATE TABLE IF NOT EXISTS foo(id bigint);\n"
             "DROP TABLE IF EXISTS foo;\n")
           (sql-mig/->SqlMigration
             20120827170200
             "multiple-statements"
             multi-stmt-up
             multi-stmt-down)}
        (set (sut/list-migrations {:migration-dir "migrations"})))))