-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
92 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
package migration | ||
|
||
type File struct { | ||
ID uint | ||
Migration string | ||
Batch int | ||
} | ||
|
||
type Repository interface { | ||
//// CreateRepository Create the migration repository data store. | ||
//CreateRepository() | ||
//// Delete Remove a migration from the log. | ||
//Delete(migration string) | ||
//// DeleteRepository Delete the migration repository data store. | ||
//DeleteRepository() | ||
//// GetLast Get the last migration batch. | ||
//GetLast() | ||
//// GetMigrationBatches Get the completed migrations with their batch numbers. | ||
//GetMigrationBatches() | ||
//// GetMigrations Get the list of migrations. | ||
//GetMigrations(steps int) | ||
//// GetMigrationsByBatch Get the list of the migrations by batch. | ||
//GetMigrationsByBatch(batch int) | ||
//// GetNextBatchNumber Get the next migration batch number. | ||
//GetNextBatchNumber() | ||
//// GetRan Get the completed migrations. | ||
//GetRan() | ||
//// Log that a migration was run. | ||
//Log(file, batch string) | ||
//// RepositoryExists Determine if the migration repository exists. | ||
//RepositoryExists() | ||
// CreateRepository Create the migration repository data store. | ||
CreateRepository() error | ||
// Delete Remove a migration from the log. | ||
Delete(migration string) error | ||
// DeleteRepository Delete the migration repository data store. | ||
DeleteRepository() error | ||
// GetLast Get the last migration batch. | ||
GetLast() ([]File, error) | ||
// GetMigrations Get the list of migrations. | ||
GetMigrations(steps int) ([]File, error) | ||
// GetMigrationsByBatch Get the list of the migrations by batch. | ||
GetMigrationsByBatch(batch int) ([]File, error) | ||
// GetNextBatchNumber Get the next migration batch number. | ||
GetNextBatchNumber() int | ||
// GetRan Get the completed migrations. | ||
GetRan() ([]string, error) | ||
// Log that a migration was run. | ||
Log(file string, batch int) error | ||
// RepositoryExists Determine if the migration repository exists. | ||
RepositoryExists() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters