| 663 | } |
| 664 | |
| 665 | func (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 | |
| 690 | func (s *SqliteMigrateSuite) TestRunMigrationObjOtherTable(c *C) { |
| 691 | migrations := &MemoryMigrationSource{ |