From 5a0d6da4dafef838a11718c11aabb8e2d9b53e49 Mon Sep 17 00:00:00 2001 From: Jan Dolezel Date: Fri, 29 Jun 2018 09:58:18 +0200 Subject: [PATCH] Added cocroach v2 to tests --- .circleci/config.yml | 22 ++++++++++++++++++++-- test/cockroach/019_add_index.js | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 19dfade3..4cf42351 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,7 +73,7 @@ jobs: - run: name: test command: npm run migrate up -- -m test/migrations && npm run migrate down 0 -- -m test/migrations --timestamps - test-cocroach: + test-cocroach-1: docker: - <<: *node-image environment: @@ -88,6 +88,21 @@ jobs: - run: name: test command: npm run migrate up -- -m test/cockroach -s '' --migrations-schema circle_test --no-lock && npm run migrate down 0 -- -m test/cockroach -s '' --migrations-schema circle_test --no-lock --timestamps + test-cocroach-2: + docker: + - <<: *node-image + environment: + - DATABASE_URL=postgresql://root@localhost:26257/circle_test + - image: cockroachdb/cockroach:v2.0.3 + command: ['start', '--insecure', '--host=localhost'] + steps: + - <<: *restore + - run: + name: create-cockroach-db + command: node -e '(new require("pg").Pool({connectionString:process.env.DATABASE_URL})).query("CREATE DATABASE circle_test").then(function(){process.exit(0)})' + - run: + name: test + command: npm run migrate up -- -m test/cockroach --no-lock && npm run migrate down 0 -- -m test/cockroach --no-lock --timestamps test-node-6: docker: - image: circleci/node:6 @@ -117,7 +132,10 @@ workflows: - test-pg: requires: - install - - test-cocroach: + - test-cocroach-1: + requires: + - install + - test-cocroach-2: requires: - install - test-node-6: diff --git a/test/cockroach/019_add_index.js b/test/cockroach/019_add_index.js index c705eb77..ff30690c 100644 --- a/test/cockroach/019_add_index.js +++ b/test/cockroach/019_add_index.js @@ -1,3 +1,3 @@ exports.up = pgm => { - pgm.createIndex("t1", ["nmbr"], { unique: true }); + pgm.createIndex("t1", ["nmbr"], { unique: true, cascade: true }); };