MCPcopy
hub / github.com/rubenv/sql-migrate / TestRunMigrationObjDefaultTable

Method TestRunMigrationObjDefaultTable

migrate_test.go:665–688  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

663}
664
665func (s *SqliteMigrateSuite) TestRunMigrationObjDefaultTable(c *C) {
666 migrations := &MemoryMigrationSource{
667 Migrations: sqliteMigrations[:1],
668 }
669
670 ms := MigrationSet{}
671 // Executes one migration
672 n, err := ms.Exec(s.Db, "sqlite3", migrations, Up)
673 c.Assert(err, IsNil)
674 c.Assert(n, Equals, 1)
675
676 // Can use table now
677 _, err = s.DbMap.Exec("SELECT * FROM people")
678 c.Assert(err, IsNil)
679
680 // Uses default tableName
681 _, err = s.DbMap.Exec("SELECT * FROM gorp_migrations")
682 c.Assert(err, IsNil)
683
684 // Shouldn't apply migration again
685 n, err = ms.Exec(s.Db, "sqlite3", migrations, Up)
686 c.Assert(err, IsNil)
687 c.Assert(n, Equals, 0)
688}
689
690func (s *SqliteMigrateSuite) TestRunMigrationObjOtherTable(c *C) {
691 migrations := &MemoryMigrationSource{

Callers

nothing calls this directly

Calls 2

ExecMethod · 0.95
ExecMethod · 0.65

Tested by

no test coverage detected