diff --git a/Dockerfile b/Dockerfile index da166f6c8..b3c841a0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN go mod download COPY . ./ -RUN make build-docker +#RUN make build-docker FROM alpine:latest diff --git a/build/migrate.linux-386 b/build/migrate.linux-386 new file mode 100755 index 000000000..0b87b80ff Binary files /dev/null and b/build/migrate.linux-386 differ diff --git a/builder.sh b/builder.sh new file mode 100755 index 000000000..e3622a0c3 --- /dev/null +++ b/builder.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +make build-docker +make build +docker tag infoblox/migrate:5.0.0-2-g8ab5a72-unsupported-j0 core-harbor-prod.sdp.infoblox.com/infobloxcto-dev/infoblox/migrate:5.0.0-2-g8ab5a72-unsupported-j0 +docker push core-harbor-prod.sdp.infoblox.com/infobloxcto-dev/infoblox/migrate:5.0.0-2-g8ab5a72-unsupported-j0 +docker run -it -v /Users/vvenkatasubramanian/go/src/github.com/Infoblox-CTO/ddi.keys/db/migrations/:/ns-migrations/ --net host --entrypoint /bin/sh core-harbor-prod.sdp.infoblox.com/infobloxcto-dev/infoblox/migrate:5.0.0-2-g8ab5a72-unsupported-j0 diff --git a/coverage/combined.txt b/coverage/combined.txt new file mode 100644 index 000000000..51240453d --- /dev/null +++ b/coverage/combined.txt @@ -0,0 +1,409 @@ +mode: atomic +github.com/golang-migrate/migrate/v4/migrate.go:53.39,55.2 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:61.34,63.2 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:103.59,107.19 3 151 +github.com/golang-migrate/migrate/v4/migrate.go:107.19,109.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:110.5,113.19 3 151 +github.com/golang-migrate/migrate/v4/migrate.go:113.19,115.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:116.5,119.19 3 151 +github.com/golang-migrate/migrate/v4/migrate.go:119.19,121.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:122.5,125.19 3 151 +github.com/golang-migrate/migrate/v4/migrate.go:125.19,127.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:128.5,130.18 2 151 +github.com/golang-migrate/migrate/v4/migrate.go:133.59,135.19 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:135.19,137.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:138.5,139.15 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:146.121,150.19 3 1 +github.com/golang-migrate/migrate/v4/migrate.go:150.19,152.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:153.5,158.19 4 1 +github.com/golang-migrate/migrate/v4/migrate.go:158.19,160.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:161.5,165.18 3 1 +github.com/golang-migrate/migrate/v4/migrate.go:172.115,176.19 3 1 +github.com/golang-migrate/migrate/v4/migrate.go:176.19,178.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:179.5,184.19 4 1 +github.com/golang-migrate/migrate/v4/migrate.go:184.19,186.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:187.5,191.18 3 1 +github.com/golang-migrate/migrate/v4/migrate.go:198.144,208.2 6 1 +github.com/golang-migrate/migrate/v4/migrate.go:210.81,216.2 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:218.27,225.2 1 154 +github.com/golang-migrate/migrate/v4/migrate.go:228.58,234.15 4 1 +github.com/golang-migrate/migrate/v4/migrate.go:234.15,236.6 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:238.5,238.15 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:238.15,240.6 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:242.5,242.48 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:247.47,248.36 1 20 +github.com/golang-migrate/migrate/v4/migrate.go:248.36,250.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:251.5,252.19 2 20 +github.com/golang-migrate/migrate/v4/migrate.go:252.19,254.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:257.5,257.14 1 20 +github.com/golang-migrate/migrate/v4/migrate.go:257.14,258.40 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:258.40,259.55 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:259.55,261.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:262.13,262.79 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:262.79,264.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:266.15,269.10 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:274.5,274.40 1 19 +github.com/golang-migrate/migrate/v4/migrate.go:274.40,276.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:278.5,281.47 3 19 +github.com/golang-migrate/migrate/v4/migrate.go:281.47,282.40 1 8 +github.com/golang-migrate/migrate/v4/migrate.go:282.40,284.80 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:284.80,286.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:288.9,288.32 1 8 +github.com/golang-migrate/migrate/v4/migrate.go:291.5,291.50 1 11 +github.com/golang-migrate/migrate/v4/migrate.go:291.50,293.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:295.5,295.22 1 11 +github.com/golang-migrate/migrate/v4/migrate.go:300.38,301.15 1 20 +github.com/golang-migrate/migrate/v4/migrate.go:301.15,303.6 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:305.5,305.36 1 19 +github.com/golang-migrate/migrate/v4/migrate.go:305.36,307.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:309.5,310.19 2 19 +github.com/golang-migrate/migrate/v4/migrate.go:310.19,312.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:314.5,314.14 1 19 +github.com/golang-migrate/migrate/v4/migrate.go:314.14,316.6 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:318.5,320.14 2 18 +github.com/golang-migrate/migrate/v4/migrate.go:320.14,322.6 1 9 +github.com/golang-migrate/migrate/v4/migrate.go:322.11,324.6 1 9 +github.com/golang-migrate/migrate/v4/migrate.go:326.5,326.45 1 18 +github.com/golang-migrate/migrate/v4/migrate.go:331.30,332.36 1 3 +github.com/golang-migrate/migrate/v4/migrate.go:332.36,334.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:336.5,337.19 2 3 +github.com/golang-migrate/migrate/v4/migrate.go:337.19,339.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:341.5,341.14 1 3 +github.com/golang-migrate/migrate/v4/migrate.go:341.14,343.6 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:345.5,348.45 3 2 +github.com/golang-migrate/migrate/v4/migrate.go:353.32,354.36 1 3 +github.com/golang-migrate/migrate/v4/migrate.go:354.36,356.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:358.5,359.19 2 3 +github.com/golang-migrate/migrate/v4/migrate.go:359.19,361.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:363.5,363.14 1 3 +github.com/golang-migrate/migrate/v4/migrate.go:363.14,365.6 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:367.5,369.45 3 2 +github.com/golang-migrate/migrate/v4/migrate.go:373.32,374.36 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:374.36,376.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:377.5,377.48 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:377.48,379.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:380.5,380.22 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:387.54,388.28 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:388.28,390.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:392.5,392.36 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:392.36,394.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:396.5,397.19 2 2 +github.com/golang-migrate/migrate/v4/migrate.go:397.19,399.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:401.5,401.14 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:401.14,403.6 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:405.5,407.15 2 1 +github.com/golang-migrate/migrate/v4/migrate.go:407.15,409.40 2 1 +github.com/golang-migrate/migrate/v4/migrate.go:409.40,410.61 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:410.61,412.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:412.19,414.14 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:416.13,417.38 2 1 +github.com/golang-migrate/migrate/v4/migrate.go:417.38,418.53 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:418.53,420.18 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:425.5,425.45 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:431.44,432.21 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:432.21,434.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:436.5,436.36 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:436.36,438.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:440.5,440.68 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:440.68,442.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:444.5,444.22 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:449.67,451.19 2 27 +github.com/golang-migrate/migrate/v4/migrate.go:451.19,453.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:455.5,455.33 1 27 +github.com/golang-migrate/migrate/v4/migrate.go:455.33,457.6 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:459.5,459.28 1 25 +github.com/golang-migrate/migrate/v4/migrate.go:466.66,470.18 2 122 +github.com/golang-migrate/migrate/v4/migrate.go:470.18,471.60 1 110 +github.com/golang-migrate/migrate/v4/migrate.go:471.60,474.10 2 40 +github.com/golang-migrate/migrate/v4/migrate.go:478.5,478.16 1 82 +github.com/golang-migrate/migrate/v4/migrate.go:478.16,479.58 1 76 +github.com/golang-migrate/migrate/v4/migrate.go:479.58,482.10 2 31 +github.com/golang-migrate/migrate/v4/migrate.go:486.5,486.19 1 51 +github.com/golang-migrate/migrate/v4/migrate.go:486.19,489.6 2 7 +github.com/golang-migrate/migrate/v4/migrate.go:491.5,491.18 1 44 +github.com/golang-migrate/migrate/v4/migrate.go:491.18,494.23 1 24 +github.com/golang-migrate/migrate/v4/migrate.go:494.23,496.27 2 6 +github.com/golang-migrate/migrate/v4/migrate.go:496.27,499.14 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:501.13,502.27 2 6 +github.com/golang-migrate/migrate/v4/migrate.go:502.27,505.14 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:507.13,508.23 2 6 +github.com/golang-migrate/migrate/v4/migrate.go:508.23,509.53 1 6 +github.com/golang-migrate/migrate/v4/migrate.go:509.53,511.18 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:514.13,514.37 1 6 +github.com/golang-migrate/migrate/v4/migrate.go:518.9,518.23 1 24 +github.com/golang-migrate/migrate/v4/migrate.go:518.23,519.25 1 50 +github.com/golang-migrate/migrate/v4/migrate.go:519.25,521.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:523.13,524.27 2 50 +github.com/golang-migrate/migrate/v4/migrate.go:524.27,527.14 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:529.13,530.27 2 50 +github.com/golang-migrate/migrate/v4/migrate.go:530.27,533.14 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:535.13,536.23 2 50 +github.com/golang-migrate/migrate/v4/migrate.go:536.23,537.53 1 50 +github.com/golang-migrate/migrate/v4/migrate.go:537.53,539.18 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:542.13,542.29 1 50 +github.com/golang-migrate/migrate/v4/migrate.go:545.11,548.36 1 20 +github.com/golang-migrate/migrate/v4/migrate.go:548.36,549.25 1 43 +github.com/golang-migrate/migrate/v4/migrate.go:549.25,551.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:553.13,554.59 2 43 +github.com/golang-migrate/migrate/v4/migrate.go:554.59,557.31 2 5 +github.com/golang-migrate/migrate/v4/migrate.go:557.31,560.18 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:561.17,562.27 2 5 +github.com/golang-migrate/migrate/v4/migrate.go:562.27,563.57 1 5 +github.com/golang-migrate/migrate/v4/migrate.go:563.57,565.22 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:568.17,568.23 1 5 +github.com/golang-migrate/migrate/v4/migrate.go:570.19,570.34 1 38 +github.com/golang-migrate/migrate/v4/migrate.go:570.34,573.14 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:575.13,576.27 2 38 +github.com/golang-migrate/migrate/v4/migrate.go:576.27,579.14 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:581.13,582.23 2 38 +github.com/golang-migrate/migrate/v4/migrate.go:582.23,583.53 1 38 +github.com/golang-migrate/migrate/v4/migrate.go:583.53,585.18 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:588.13,588.29 1 38 +github.com/golang-migrate/migrate/v4/migrate.go:598.71,602.18 2 51 +github.com/golang-migrate/migrate/v4/migrate.go:602.18,603.60 1 43 +github.com/golang-migrate/migrate/v4/migrate.go:603.60,606.10 2 16 +github.com/golang-migrate/migrate/v4/migrate.go:609.5,609.19 1 35 +github.com/golang-migrate/migrate/v4/migrate.go:609.19,612.6 2 6 +github.com/golang-migrate/migrate/v4/migrate.go:614.5,615.38 2 29 +github.com/golang-migrate/migrate/v4/migrate.go:615.38,616.21 1 62 +github.com/golang-migrate/migrate/v4/migrate.go:616.21,618.10 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:621.9,621.23 1 62 +github.com/golang-migrate/migrate/v4/migrate.go:621.23,623.27 2 7 +github.com/golang-migrate/migrate/v4/migrate.go:623.27,626.14 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:628.13,629.27 2 7 +github.com/golang-migrate/migrate/v4/migrate.go:629.27,632.14 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:634.13,635.23 2 7 +github.com/golang-migrate/migrate/v4/migrate.go:635.23,636.53 1 7 +github.com/golang-migrate/migrate/v4/migrate.go:636.53,638.18 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:640.13,642.21 3 7 +github.com/golang-migrate/migrate/v4/migrate.go:646.9,647.43 2 55 +github.com/golang-migrate/migrate/v4/migrate.go:647.43,649.42 1 13 +github.com/golang-migrate/migrate/v4/migrate.go:649.42,652.14 2 1 +github.com/golang-migrate/migrate/v4/migrate.go:655.13,655.28 1 12 +github.com/golang-migrate/migrate/v4/migrate.go:655.28,657.14 1 7 +github.com/golang-migrate/migrate/v4/migrate.go:660.13,660.40 1 5 +github.com/golang-migrate/migrate/v4/migrate.go:660.40,663.14 2 3 +github.com/golang-migrate/migrate/v4/migrate.go:666.13,666.30 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:666.30,669.14 2 2 +github.com/golang-migrate/migrate/v4/migrate.go:671.9,671.23 1 42 +github.com/golang-migrate/migrate/v4/migrate.go:671.23,674.10 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:676.9,677.23 2 42 +github.com/golang-migrate/migrate/v4/migrate.go:677.23,680.10 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:682.9,683.19 2 42 +github.com/golang-migrate/migrate/v4/migrate.go:683.19,684.49 1 42 +github.com/golang-migrate/migrate/v4/migrate.go:684.49,686.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:688.9,689.16 2 42 +github.com/golang-migrate/migrate/v4/migrate.go:698.73,702.18 2 51 +github.com/golang-migrate/migrate/v4/migrate.go:702.18,703.60 1 46 +github.com/golang-migrate/migrate/v4/migrate.go:703.60,706.10 2 16 +github.com/golang-migrate/migrate/v4/migrate.go:709.5,709.19 1 35 +github.com/golang-migrate/migrate/v4/migrate.go:709.19,712.6 2 6 +github.com/golang-migrate/migrate/v4/migrate.go:715.5,715.34 1 29 +github.com/golang-migrate/migrate/v4/migrate.go:715.34,718.6 2 1 +github.com/golang-migrate/migrate/v4/migrate.go:721.5,721.32 1 28 +github.com/golang-migrate/migrate/v4/migrate.go:721.32,724.6 2 3 +github.com/golang-migrate/migrate/v4/migrate.go:726.5,727.38 2 25 +github.com/golang-migrate/migrate/v4/migrate.go:727.38,728.21 1 49 +github.com/golang-migrate/migrate/v4/migrate.go:728.21,730.10 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:732.9,733.43 2 49 +github.com/golang-migrate/migrate/v4/migrate.go:733.43,735.47 1 12 +github.com/golang-migrate/migrate/v4/migrate.go:735.47,737.31 2 12 +github.com/golang-migrate/migrate/v4/migrate.go:737.31,740.18 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:742.17,743.31 2 12 +github.com/golang-migrate/migrate/v4/migrate.go:743.31,746.18 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:747.17,748.27 2 12 +github.com/golang-migrate/migrate/v4/migrate.go:748.27,749.57 1 12 +github.com/golang-migrate/migrate/v4/migrate.go:749.57,751.22 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:753.17,753.24 1 12 +github.com/golang-migrate/migrate/v4/migrate.go:756.13,756.30 1 12 +github.com/golang-migrate/migrate/v4/migrate.go:756.30,758.14 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:759.13,759.19 1 12 +github.com/golang-migrate/migrate/v4/migrate.go:761.9,761.23 1 37 +github.com/golang-migrate/migrate/v4/migrate.go:761.23,764.10 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:766.9,767.23 2 37 +github.com/golang-migrate/migrate/v4/migrate.go:767.23,770.10 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:772.9,773.19 2 37 +github.com/golang-migrate/migrate/v4/migrate.go:773.19,774.49 1 37 +github.com/golang-migrate/migrate/v4/migrate.go:774.49,776.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:778.9,779.16 2 37 +github.com/golang-migrate/migrate/v4/migrate.go:789.63,790.24 1 42 +github.com/golang-migrate/migrate/v4/migrate.go:790.24,792.21 1 70 +github.com/golang-migrate/migrate/v4/migrate.go:792.21,794.10 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:796.9,796.30 1 70 +github.com/golang-migrate/migrate/v4/migrate.go:797.20,798.21 1 12 +github.com/golang-migrate/migrate/v4/migrate.go:800.25,804.86 2 58 +github.com/golang-migrate/migrate/v4/migrate.go:804.86,806.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:808.13,808.33 1 58 +github.com/golang-migrate/migrate/v4/migrate.go:808.33,810.76 2 45 +github.com/golang-migrate/migrate/v4/migrate.go:810.76,812.18 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:816.13,816.87 1 58 +github.com/golang-migrate/migrate/v4/migrate.go:816.87,818.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:820.13,825.29 4 58 +github.com/golang-migrate/migrate/v4/migrate.go:825.29,826.36 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:826.36,828.18 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:828.23,830.18 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:833.17,834.72 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:837.5,837.15 1 30 +github.com/golang-migrate/migrate/v4/migrate.go:842.62,845.19 2 275 +github.com/golang-migrate/migrate/v4/migrate.go:845.19,846.22 1 139 +github.com/golang-migrate/migrate/v4/migrate.go:846.22,847.56 1 139 +github.com/golang-migrate/migrate/v4/migrate.go:847.56,849.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:852.5,852.36 1 275 +github.com/golang-migrate/migrate/v4/migrate.go:852.36,854.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:854.11,854.47 1 275 +github.com/golang-migrate/migrate/v4/migrate.go:854.47,856.6 1 139 +github.com/golang-migrate/migrate/v4/migrate.go:859.5,860.19 2 136 +github.com/golang-migrate/migrate/v4/migrate.go:860.19,861.22 1 33 +github.com/golang-migrate/migrate/v4/migrate.go:861.22,862.58 1 33 +github.com/golang-migrate/migrate/v4/migrate.go:862.58,864.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:867.5,867.36 1 136 +github.com/golang-migrate/migrate/v4/migrate.go:867.36,869.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:869.11,869.47 1 136 +github.com/golang-migrate/migrate/v4/migrate.go:869.47,871.6 1 33 +github.com/golang-migrate/migrate/v4/migrate.go:873.5,875.15 3 103 +github.com/golang-migrate/migrate/v4/migrate.go:881.31,882.25 1 274 +github.com/golang-migrate/migrate/v4/migrate.go:882.25,884.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:886.5,886.12 1 274 +github.com/golang-migrate/migrate/v4/migrate.go:887.27,889.20 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:891.13,892.21 1 274 +github.com/golang-migrate/migrate/v4/migrate.go:898.85,901.38 2 325 +github.com/golang-migrate/migrate/v4/migrate.go:901.38,903.43 2 169 +github.com/golang-migrate/migrate/v4/migrate.go:903.43,906.27 2 36 +github.com/golang-migrate/migrate/v4/migrate.go:906.27,908.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:910.15,910.30 1 133 +github.com/golang-migrate/migrate/v4/migrate.go:910.30,913.10 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:913.15,916.27 2 133 +github.com/golang-migrate/migrate/v4/migrate.go:916.27,918.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:921.11,923.43 2 156 +github.com/golang-migrate/migrate/v4/migrate.go:923.43,926.27 2 36 +github.com/golang-migrate/migrate/v4/migrate.go:926.27,928.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:930.15,930.30 1 120 +github.com/golang-migrate/migrate/v4/migrate.go:930.30,933.10 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:933.15,936.27 2 120 +github.com/golang-migrate/migrate/v4/migrate.go:936.27,938.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:942.5,942.53 1 325 +github.com/golang-migrate/migrate/v4/migrate.go:942.53,944.6 1 253 +github.com/golang-migrate/migrate/v4/migrate.go:944.11,946.6 1 72 +github.com/golang-migrate/migrate/v4/migrate.go:948.5,948.21 1 325 +github.com/golang-migrate/migrate/v4/migrate.go:953.32,957.19 3 52 +github.com/golang-migrate/migrate/v4/migrate.go:957.19,959.6 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:962.5,963.18 2 51 +github.com/golang-migrate/migrate/v4/migrate.go:963.18,965.6 1 51 +github.com/golang-migrate/migrate/v4/migrate.go:968.5,972.15 3 51 +github.com/golang-migrate/migrate/v4/migrate.go:972.15,973.13 1 51 +github.com/golang-migrate/migrate/v4/migrate.go:973.13,974.20 1 51 +github.com/golang-migrate/migrate/v4/migrate.go:975.25,976.23 1 51 +github.com/golang-migrate/migrate/v4/migrate.go:977.28,979.23 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:985.5,985.15 1 51 +github.com/golang-migrate/migrate/v4/migrate.go:985.15,986.52 1 51 +github.com/golang-migrate/migrate/v4/migrate.go:986.52,988.10 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:988.15,990.10 1 51 +github.com/golang-migrate/migrate/v4/migrate.go:994.5,995.19 2 51 +github.com/golang-migrate/migrate/v4/migrate.go:995.19,997.6 1 51 +github.com/golang-migrate/migrate/v4/migrate.go:998.5,998.15 1 51 +github.com/golang-migrate/migrate/v4/migrate.go:1004.34,1008.50 3 50 +github.com/golang-migrate/migrate/v4/migrate.go:1008.50,1011.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1013.5,1014.15 2 50 +github.com/golang-migrate/migrate/v4/migrate.go:1019.50,1020.38 1 36 +github.com/golang-migrate/migrate/v4/migrate.go:1020.38,1022.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1023.5,1023.19 1 36 +github.com/golang-migrate/migrate/v4/migrate.go:1027.62,1028.21 1 13 +github.com/golang-migrate/migrate/v4/migrate.go:1028.21,1030.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1034.69,1035.40 1 372 +github.com/golang-migrate/migrate/v4/migrate.go:1035.40,1037.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1041.37,1042.21 1 103 +github.com/golang-migrate/migrate/v4/migrate.go:1042.21,1044.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1047.44,1051.19 3 5 +github.com/golang-migrate/migrate/v4/migrate.go:1051.19,1053.6 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:1054.5,1056.19 3 4 +github.com/golang-migrate/migrate/v4/migrate.go:1056.19,1058.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1060.5,1060.76 1 4 +github.com/golang-migrate/migrate/v4/migrate.go:1060.76,1062.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1064.5,1066.65 2 4 +github.com/golang-migrate/migrate/v4/migrate.go:1066.65,1068.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1070.5,1071.15 2 4 +github.com/golang-migrate/migrate/v4/migrate.go:1074.72,1076.19 2 3 +github.com/golang-migrate/migrate/v4/migrate.go:1076.19,1078.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1080.5,1084.24 4 3 +github.com/golang-migrate/migrate/v4/migrate.go:1084.24,1086.15 2 7 +github.com/golang-migrate/migrate/v4/migrate.go:1086.15,1087.51 1 7 +github.com/golang-migrate/migrate/v4/migrate.go:1087.51,1088.22 1 3 +github.com/golang-migrate/migrate/v4/migrate.go:1090.13,1090.69 1 4 +github.com/golang-migrate/migrate/v4/migrate.go:1094.5,1095.92 2 3 +github.com/golang-migrate/migrate/v4/migrate.go:1098.46,1099.43 1 14 +github.com/golang-migrate/migrate/v4/migrate.go:1099.43,1101.6 1 12 +github.com/golang-migrate/migrate/v4/migrate.go:1102.5,1103.19 2 2 +github.com/golang-migrate/migrate/v4/migrate.go:1103.19,1105.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1107.5,1109.32 2 2 +github.com/golang-migrate/migrate/v4/migrate.go:1109.32,1113.95 2 8 +github.com/golang-migrate/migrate/v4/migrate.go:1113.95,1114.21 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1118.9,1119.29 2 8 +github.com/golang-migrate/migrate/v4/migrate.go:1119.29,1121.21 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1124.9,1125.23 2 8 +github.com/golang-migrate/migrate/v4/migrate.go:1125.23,1127.21 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:1131.9,1131.40 1 8 +github.com/golang-migrate/migrate/v4/migrate.go:1131.40,1132.84 1 3 +github.com/golang-migrate/migrate/v4/migrate.go:1132.84,1134.25 2 0 +github.com/golang-migrate/migrate/v4/migrate.go:1136.13,1136.54 1 3 +github.com/golang-migrate/migrate/v4/migrate.go:1140.5,1140.15 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:1144.37,1145.43 1 22 +github.com/golang-migrate/migrate/v4/migrate.go:1145.43,1147.6 1 20 +github.com/golang-migrate/migrate/v4/migrate.go:1148.5,1149.19 2 2 +github.com/golang-migrate/migrate/v4/migrate.go:1149.19,1152.6 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1154.5,1156.92 2 2 +github.com/golang-migrate/migrate/v4/migrate.go:1156.92,1157.23 1 10 +github.com/golang-migrate/migrate/v4/migrate.go:1157.23,1159.10 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1162.9,1162.25 1 10 +github.com/golang-migrate/migrate/v4/migrate.go:1162.25,1164.39 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:1164.39,1166.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1167.13,1167.23 1 2 +github.com/golang-migrate/migrate/v4/migrate.go:1170.9,1170.41 1 8 +github.com/golang-migrate/migrate/v4/migrate.go:1170.41,1172.10 1 1 +github.com/golang-migrate/migrate/v4/migrate.go:1174.9,1179.52 3 7 +github.com/golang-migrate/migrate/v4/migrate.go:1179.52,1181.10 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1182.9,1182.38 1 7 +github.com/golang-migrate/migrate/v4/migrate.go:1182.38,1183.50 1 7 +github.com/golang-migrate/migrate/v4/migrate.go:1183.50,1185.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1189.9,1189.56 1 7 +github.com/golang-migrate/migrate/v4/migrate.go:1189.56,1191.10 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1192.9,1192.39 1 7 +github.com/golang-migrate/migrate/v4/migrate.go:1192.39,1193.51 1 7 +github.com/golang-migrate/migrate/v4/migrate.go:1193.51,1195.14 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1199.9,1199.60 1 7 +github.com/golang-migrate/migrate/v4/migrate.go:1199.60,1201.10 1 0 +github.com/golang-migrate/migrate/v4/migrate.go:1202.9,1202.43 1 7 +github.com/golang-migrate/migrate/v4/migration.go:77.55,86.17 3 330 +github.com/golang-migrate/migrate/v4/migration.go:86.17,87.27 1 75 +github.com/golang-migrate/migrate/v4/migration.go:87.27,89.4 1 75 +github.com/golang-migrate/migrate/v4/migration.go:91.3,94.16 4 75 +github.com/golang-migrate/migrate/v4/migration.go:97.2,102.15 6 255 +github.com/golang-migrate/migrate/v4/migration.go:106.37,108.2 1 0 +github.com/golang-migrate/migrate/v4/migration.go:111.40,113.38 2 374 +github.com/golang-migrate/migrate/v4/migration.go:113.38,115.3 1 179 +github.com/golang-migrate/migrate/v4/migration.go:116.2,116.71 1 374 +github.com/golang-migrate/migrate/v4/migration.go:121.36,122.19 1 198 +github.com/golang-migrate/migrate/v4/migration.go:122.19,124.3 1 43 +github.com/golang-migrate/migrate/v4/migration.go:126.2,132.70 3 155 +github.com/golang-migrate/migrate/v4/migration.go:132.70,134.3 1 0 +github.com/golang-migrate/migrate/v4/migration.go:136.2,141.16 3 155 +github.com/golang-migrate/migrate/v4/migration.go:141.16,143.3 1 0 +github.com/golang-migrate/migrate/v4/migration.go:145.2,150.47 3 45 +github.com/golang-migrate/migrate/v4/migration.go:150.47,152.3 1 0 +github.com/golang-migrate/migrate/v4/migration.go:155.2,155.39 1 45 +github.com/golang-migrate/migrate/v4/migration.go:155.39,157.3 1 0 +github.com/golang-migrate/migrate/v4/migration.go:159.2,159.12 1 45 +github.com/golang-migrate/migrate/v4/util.go:19.46,21.25 2 0 +github.com/golang-migrate/migrate/v4/util.go:21.25,22.15 1 0 +github.com/golang-migrate/migrate/v4/util.go:22.15,24.4 1 0 +github.com/golang-migrate/migrate/v4/util.go:26.2,26.32 1 0 +github.com/golang-migrate/migrate/v4/util.go:30.36,32.27 2 0 +github.com/golang-migrate/migrate/v4/util.go:32.27,33.25 1 0 +github.com/golang-migrate/migrate/v4/util.go:33.25,35.4 1 0 +github.com/golang-migrate/migrate/v4/util.go:37.2,37.36 1 0 +github.com/golang-migrate/migrate/v4/util.go:43.24,44.11 1 583 +github.com/golang-migrate/migrate/v4/util.go:44.11,45.56 1 1 +github.com/golang-migrate/migrate/v4/util.go:47.2,47.16 1 582 +github.com/golang-migrate/migrate/v4/util.go:51.47,54.31 3 1 +github.com/golang-migrate/migrate/v4/util.go:54.31,55.36 1 4 +github.com/golang-migrate/migrate/v4/util.go:55.36,57.4 1 3 +github.com/golang-migrate/migrate/v4/util.go:59.2,60.12 2 1 diff --git a/migrate b/migrate new file mode 100755 index 000000000..61b08fe11 Binary files /dev/null and b/migrate differ diff --git a/migrate.go b/migrate.go index b05835919..32a76145a 100644 --- a/migrate.go +++ b/migrate.go @@ -88,7 +88,7 @@ type Migrate struct { // but can be set per Migrate instance. LockTimeout time.Duration - // DirtyStateHandler is used to handle dirty state of the database + // dirtyStateConfig is used to store the configuration required to handle dirty state of the database dirtyStateConf *dirtyStateConfig } @@ -224,13 +224,11 @@ func (m *Migrate) WithDirtyStateConfig(srcPath, destPath string, isDirty bool) e if err != nil { return "", "", err } - scheme := uri.Scheme - if scheme == "" || scheme == "file" { - scheme = "file://" - } else if scheme != "file" { + scheme := "file" + if uri.Scheme != "file" && uri.Scheme != "" { return "", "", fmt.Errorf("unsupported scheme: %s", scheme) } - return scheme, uri.Path, nil + return scheme + "://", uri.Path, nil } sScheme, sPath, err := parsePath(srcPath) @@ -1091,7 +1089,7 @@ func (m *Migrate) handleDirtyState() error { 3. Set the last successful migration version in the schema_migrations table 4. Delete the last successful migration file */ - // the source driver should read the migrations from the mounted volume + // the source driver should read the migrations from the destination path // as the DB is dirty and last applied migrations to the database are not present in the source path if err := m.updateSourceDrv(m.dirtyStateConf.destScheme + m.dirtyStateConf.destPath); err != nil { return err diff --git a/migrate_test.go b/migrate_test.go index 4a0e4a79d..4b83b92a0 100644 --- a/migrate_test.go +++ b/migrate_test.go @@ -1418,17 +1418,6 @@ func equalDbSeq(t *testing.T, i int, expected migrationSequence, got *dStub.Stub } } -// Setting up temp directory to be used as the volume mount -func setupTempDir(t *testing.T) (string, func()) { - tempDir := t.TempDir() - - return tempDir, func() { - if err := os.RemoveAll(tempDir); err != nil { - t.Fatal(err) - } - } -} - func setupMigrateInstance(tempDir string) (*Migrate, *dStub.Stub) { scheme := "stub://" m, _ := New(scheme, scheme) @@ -1441,8 +1430,7 @@ func setupMigrateInstance(tempDir string) (*Migrate, *dStub.Stub) { } func TestHandleDirtyState(t *testing.T) { - tempDir, cleanup := setupTempDir(t) - defer cleanup() + tempDir := t.TempDir() m, dbDrv := setupMigrateInstance(tempDir) m.sourceDrv.(*sStub.Stub).Migrations = sourceStubMigrations @@ -1519,8 +1507,7 @@ func TestHandleDirtyState(t *testing.T) { } func TestHandleMigrationFailure(t *testing.T) { - tempDir, cleanup := setupTempDir(t) - defer cleanup() + tempDir := t.TempDir() m, _ := setupMigrateInstance(tempDir) @@ -1557,8 +1544,7 @@ func TestHandleMigrationFailure(t *testing.T) { } func TestCleanupFiles(t *testing.T) { - tempDir, cleanup := setupTempDir(t) - defer cleanup() + tempDir := t.TempDir() m, _ := setupMigrateInstance(tempDir) m.sourceDrv.(*sStub.Stub).Migrations = sourceStubMigrations @@ -1622,11 +1608,8 @@ func TestCleanupFiles(t *testing.T) { } func TestCopyFiles(t *testing.T) { - srcDir, cleanupSrc := setupTempDir(t) - defer cleanupSrc() - - destDir, cleanupDest := setupTempDir(t) - defer cleanupDest() + srcDir := t.TempDir() + destDir := t.TempDir() m, _ := setupMigrateInstance(destDir) m.dirtyStateConf.srcPath = srcDir @@ -1748,24 +1731,13 @@ func TestWithDirtyStateConfig(t *testing.T) { t.Errorf("error = %v, wantErr %v", err, tt.wantErr) return } - if !tt.wantErr && !compareDirtyStateConfig(m.dirtyStateConf, tt.wantConf) { + if !tt.wantErr && m.dirtyStateConf == tt.wantConf { t.Errorf("dirtyStateConf = %v, want %v", m.dirtyStateConf, tt.wantConf) } }) } } -func compareDirtyStateConfig(a, b *dirtyStateConfig) bool { - if a == nil || b == nil { - return a == b - } - return a.srcScheme == b.srcScheme && - a.srcPath == b.srcPath && - a.destScheme == b.destScheme && - a.destPath == b.destPath && - a.enable == b.enable -} - /* diff returns an array containing the elements in Array A and not in B */