Skip to content

Commit a7acd32

Browse files
committed
modify README and remove errors.Unwrap
Signed-off-by: luoji <gunsluo@gmail.com>
1 parent 1eaca86 commit a7acd32

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ production:
130130

131131
See [here](https://github.com/go-sql-driver/mysql#parsetime) for more information.
132132

133-
### Oracle(oci8)
134-
Oracle Driver is [oci8](https://github.com/mattn/go-oci8), it is not pure golang code and rely on Oracle Office Client([Instant Client](https://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html)), more detail information is [oci8 repo](https://github.com/mattn/go-oci8).
133+
### Oracle (oci8)
134+
Oracle Driver is [oci8](https://github.com/mattn/go-oci8), it is not pure Go code and relies on Oracle Office Client ([Instant Client](https://www.oracle.com/database/technologies/instant-client/downloads.html)), more detailed information is in the [oci8 repo](https://github.com/mattn/go-oci8).
135135

136136
#### Install with Oracle support
137137

138138
To install the library and command line program, use the following:
139139

140140
```bash
141-
go get -tags oci8 -v github.com/rubenv/sql-migrate/...
141+
go get -tags oracle -v github.com/rubenv/sql-migrate/...
142142
```
143143

144144
```yml
@@ -149,16 +149,16 @@ development:
149149
table: migrations
150150
```
151151

152-
### Oracle(godror)
153-
Oracle Driver is [godror](https://github.com/godror/godror), it is not pure golang code and rely on Oracle Office Client([Instant Client](https://www.oracle.com/database/technologies/instant-client/downloads.html)), more detail information is [godror repo](https://github.com/godror/godror).
152+
### Oracle (godror)
153+
Oracle Driver is [godror](https://github.com/godror/godror), it is not pure Go code and relies on Oracle Office Client ([Instant Client](https://www.oracle.com/database/technologies/instant-client/downloads.html)), more detailed information is in the [godror repository](https://github.com/godror/godror).
154154

155155
#### Install with Oracle support
156156

157157
To install the library and command line program, use the following:
158158

159159
1. Install sql-migrate
160160
```bash
161-
CGO_ENABLED=1 GO111MODULE=on go get -tags godror -v github.com/rubenv/sql-migrate/...
161+
go get -tags godror -v github.com/rubenv/sql-migrate/...
162162
```
163163

164164
2. Download Oracle Office Client(e.g. macos, click [Instant Client](https://www.oracle.com/database/technologies/instant-client/downloads.html) if you are other system)

migrate.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -755,11 +755,7 @@ Check https://github.com/go-sql-driver/mysql#parsetime for more info.`)
755755
if err != nil {
756756
// Oracle database does not support `if not exists`, so use `ORA-00955:` error code
757757
// to check if the table exists.
758-
if oerr := errors.Unwrap(err); oerr != nil {
759-
err = oerr
760-
}
761-
762-
if (dialect == "oci8" || dialect == "godror") && strings.HasPrefix(err.Error(), "ORA-00955:") {
758+
if (dialect == "oci8" || dialect == "godror") && strings.Contains(err.Error(), "ORA-00955:") {
763759
return dbMap, nil
764760
}
765761
return nil, err

sql-migrate/oracle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build oci8
1+
// +build oracle
22

33
package main
44

0 commit comments

Comments
 (0)