Skip to content

Commit 5327371

Browse files
committed
Fix exception in load-migrations
1 parent 536e717 commit 5327371

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

sql/src/ragtime/sql.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
(->> (slurp f)
4545
(edn/read-string)
4646
(wrap-single-migration)
47-
(map normalize-migration)
4847
(compiler/compile)
48+
(map normalize-migration)
4949
(guess-id-from-file-extension f)))
5050

5151
(defmulti load-file-seq

sql/test/migrations/008-test.edn

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[{:id "008-test" :up ["CREATE TABLE aaa (id int)"] :down ["DROP TABLE aaa"]}
2-
{:id "009-test" :do [[:create-table bbb [id "int"]]]}]
2+
{:id "009-test" :do [[:create-table bbb [id "int"]]]}
3+
[:create-table ccc [id "int"]]]

sql/test/ragtime/sql_test.clj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
{:id "008-test", :transactions :both
2727
:up ["CREATE TABLE aaa (id int)"] :down ["DROP TABLE aaa"]}
2828
{:id "009-test", :transactions :both
29-
:up ["CREATE TABLE bbb (id int)"] :down ["DROP TABLE bbb"]}]
29+
:up ["CREATE TABLE bbb (id int)"] :down ["DROP TABLE bbb"]}
30+
{:id "create-table-ccc", :transactions :both
31+
:up ["CREATE TABLE ccc (id int)"] :down ["DROP TABLE ccc"]}]
3032
(sql/load-directory "test/migrations"))))
3133

3234
(deftest test-load-resources
@@ -53,12 +55,16 @@
5355
{:id "008-test", :transactions :both
5456
:up ["CREATE TABLE aaa (id int)"] :down ["DROP TABLE aaa"]}
5557
{:id "009-test", :transactions :both
56-
:up ["CREATE TABLE bbb (id int)"] :down ["DROP TABLE bbb"]}]
58+
:up ["CREATE TABLE bbb (id int)"] :down ["DROP TABLE bbb"]}
59+
{:id "create-table-ccc", :transactions :both
60+
:up ["CREATE TABLE ccc (id int)"] :down ["DROP TABLE ccc"]}]
5761
(sql/load-resources "migrations"))))
5862

5963
(deftest test-load-migrations
6064
(is (= [{:id "008-test", :transactions :both
6165
:up ["CREATE TABLE aaa (id int)"] :down ["DROP TABLE aaa"]}
6266
{:id "009-test", :transactions :both
63-
:up ["CREATE TABLE bbb (id int)"] :down ["DROP TABLE bbb"]}]
67+
:up ["CREATE TABLE bbb (id int)"] :down ["DROP TABLE bbb"]}
68+
{:id "create-table-ccc", :transactions :both
69+
:up ["CREATE TABLE ccc (id int)"] :down ["DROP TABLE ccc"]}]
6470
(sql/load-migrations "test/migrations/008-test.edn"))))

0 commit comments

Comments
 (0)