| 688 | } |
| 689 | |
| 690 | func (s *SqliteMigrateSuite) TestRunMigrationObjOtherTable(c *C) { |
| 691 | migrations := &MemoryMigrationSource{ |
| 692 | Migrations: sqliteMigrations[:1], |
| 693 | } |
| 694 | |
| 695 | ms := MigrationSet{TableName: "other_migrations"} |
| 696 | // Executes one migration |
| 697 | n, err := ms.Exec(s.Db, "sqlite3", migrations, Up) |
| 698 | c.Assert(err, IsNil) |
| 699 | c.Assert(n, Equals, 1) |
| 700 | |
| 701 | // Can use table now |
| 702 | _, err = s.DbMap.Exec("SELECT * FROM people") |
| 703 | c.Assert(err, IsNil) |
| 704 | |
| 705 | // Uses default tableName |
| 706 | _, err = s.DbMap.Exec("SELECT * FROM other_migrations") |
| 707 | c.Assert(err, IsNil) |
| 708 | |
| 709 | // Shouldn't apply migration again |
| 710 | n, err = ms.Exec(s.Db, "sqlite3", migrations, Up) |
| 711 | c.Assert(err, IsNil) |
| 712 | c.Assert(n, Equals, 0) |
| 713 | } |
| 714 | |
| 715 | func (*SqliteMigrateSuite) TestSetDisableCreateTable(c *C) { |
| 716 | c.Assert(migSet.DisableCreateTable, Equals, false) |