top

Package migration automatically handles versioning of a database schema by applying a series of migrations supplied by the client. It uses features only from the database/sql package, so it tries to be driver independent. However, to track the version of the database, it is necessary to execute some SQL. I've made an effort to keep those queries simple, but if they don't work with your database, you may override them.

This package works by applying a series of migrations to a database. Once a migration is created, it should never be changed. Every time a database is opened with this package, all necessary migrations are executed in a single transaction. If any part of the process fails, an error is returned and the transaction is rolled back so that the database is left untouched. (Note that for this to be useful, you'll need to use a database that supports rolling back changes to your schema. Notably, MySQL does not support this, although SQLite and PostgreSQL do.)

The version of a database is defined as the number of migrations applied to it.

Imported by 36 package(s) ΒΆ

  1. github.com/BurntSushi/goim/imdb
  2. github.com/FidelityInternational/atc/postgresrunner
  3. github.com/IMQS/authaus
  4. github.com/IMQS/messaging
  5. github.com/MakoTano/go_mingration_tool_sample/migration
  6. github.com/concourse/atc/db/migrations
  7. github.com/concourse/atc/postgresrunner
  8. github.com/contraband/checkin/db/migrations
  9. github.com/contraband/checkin/db/postgresrunner
  10. github.com/cunnie/atc/db/migrations
  11. github.com/cunnie/atc/postgresrunner
  12. github.com/danmane/abalone/go/api/db
  13. github.com/danmane/abalone/go/api/migrations
  14. github.com/dbongo/hackapp/datastore/database
  15. github.com/dbongo/hackapp/datastore/migrate
  16. github.com/drone/drone-dart/datastore/datasql
  17. github.com/drone/drone-dart/datastore/migrate
  18. github.com/gedex/simdoc/pkg/datastore/database
  19. github.com/gedex/simdoc/pkg/datastore/migrate
  20. github.com/gregory90/drone/server/datastore/database
  21. github.com/gregory90/drone/server/datastore/migrate
  22. github.com/lins05/drone/server/datastore/database
  23. github.com/lins05/drone/server/datastore/migrate
  24. github.com/mmb/atc/db/migrations
  25. github.com/mmb/atc/postgresrunner
  26. github.com/ndlib/bendo/server
  27. github.com/oppegard/atc/postgresrunner
  28. github.com/robdimsdale/atc/db/migrations
  29. github.com/robdimsdale/atc/postgresrunner
  30. github.com/savaki/atc/postgresrunner
  31. github.com/shinji62/atc/db/migrations
  32. github.com/shinji62/atc/postgresrunner
  33. github.com/xoebus/checkin/db/migrations
  34. github.com/xoebus/checkin/db/postgresrunner
  35. github.com/yanana/atc/postgresrunner
  36. github.com/zachgersh/atc/postgresrunner