feat: kubesphere 4.0 (#6115)
* feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> * feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> --------- Signed-off-by: ci-bot <ci-bot@kubesphere.io> Co-authored-by: ks-ci-bot <ks-ci-bot@example.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
committed by
GitHub
parent
b5015ec7b9
commit
447a51f08b
31
vendor/github.com/rubenv/sql-migrate/doc.go
generated
vendored
31
vendor/github.com/rubenv/sql-migrate/doc.go
generated
vendored
@@ -1,24 +1,23 @@
|
||||
/*
|
||||
|
||||
SQL Schema migration tool for Go.
|
||||
|
||||
Key features:
|
||||
|
||||
* Usable as a CLI tool or as a library
|
||||
* Supports SQLite, PostgreSQL, MySQL, MSSQL and Oracle databases (through gorp)
|
||||
* Can embed migrations into your application
|
||||
* Migrations are defined with SQL for full flexibility
|
||||
* Atomic migrations
|
||||
* Up/down migrations to allow rollback
|
||||
* Supports multiple database types in one project
|
||||
- Usable as a CLI tool or as a library
|
||||
- Supports SQLite, PostgreSQL, MySQL, MSSQL and Oracle databases (through gorp)
|
||||
- Can embed migrations into your application
|
||||
- Migrations are defined with SQL for full flexibility
|
||||
- Atomic migrations
|
||||
- Up/down migrations to allow rollback
|
||||
- Supports multiple database types in one project
|
||||
|
||||
Installation
|
||||
# Installation
|
||||
|
||||
To install the library and command line program, use the following:
|
||||
|
||||
go get -v github.com/rubenv/sql-migrate/...
|
||||
|
||||
Command-line tool
|
||||
# Command-line tool
|
||||
|
||||
The main command is called sql-migrate.
|
||||
|
||||
@@ -77,7 +76,7 @@ Use the status command to see the state of the applied migrations:
|
||||
| 2_record.sql | no |
|
||||
+---------------+-----------------------------------------+
|
||||
|
||||
MySQL Caveat
|
||||
# MySQL Caveat
|
||||
|
||||
If you are using MySQL, you must append ?parseTime=true to the datasource configuration. For example:
|
||||
|
||||
@@ -89,7 +88,7 @@ If you are using MySQL, you must append ?parseTime=true to the datasource config
|
||||
|
||||
See https://github.com/go-sql-driver/mysql#parsetime for more information.
|
||||
|
||||
Library
|
||||
# Library
|
||||
|
||||
Import sql-migrate into your application:
|
||||
|
||||
@@ -137,7 +136,7 @@ Note that n can be greater than 0 even if there is an error: any migration that
|
||||
|
||||
The full set of capabilities can be found in the API docs below.
|
||||
|
||||
Writing migrations
|
||||
# Writing migrations
|
||||
|
||||
Migrations are defined in SQL files, which contain a set of SQL statements. Special comments are used to distinguish up and down migrations.
|
||||
|
||||
@@ -183,7 +182,7 @@ Normally each migration is run within a transaction in order to guarantee that i
|
||||
-- +migrate Down
|
||||
DROP INDEX people_unique_id_idx;
|
||||
|
||||
Embedding migrations with packr
|
||||
# Embedding migrations with packr
|
||||
|
||||
If you like your Go applications self-contained (that is: a single binary): use packr (https://github.com/gobuffalo/packr) to embed the migration files.
|
||||
|
||||
@@ -202,7 +201,7 @@ If you already have a box and would like to use a subdirectory:
|
||||
Dir: "./migrations",
|
||||
}
|
||||
|
||||
Embedding migrations with bindata
|
||||
# Embedding migrations with bindata
|
||||
|
||||
As an alternative, but slightly less maintained, you can use bindata (https://github.com/shuLhan/go-bindata) to embed the migration files.
|
||||
|
||||
@@ -226,7 +225,7 @@ Both Asset and AssetDir are functions provided by bindata.
|
||||
|
||||
Then proceed as usual.
|
||||
|
||||
Extending
|
||||
# Extending
|
||||
|
||||
Adding a new migration source means implementing MigrationSource.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user