}) It("appends itself to the migration list", func() { Expect(migrations.Migrations).To(ContainElement(migration)) }) Describe("Version", func() { It("returns the timestamp from which it was created", func() { Expect(migration.Version()).To(BeEquivalentTo(1461790966)) }) }) Describe("Up", func() { JustBeforeEach(func() { migration.SetStoreClient(storeClient) migration.SetRawSQLDB(rawSQLDB) migration.SetCryptor(cryptor) migration.SetClock(fakeClock) migration.SetDBFlavor(sqlRunner.DriverName()) migrationErr = migration.Up(logger) }) Context("when there is existing data in the database", func() { BeforeEach(func() { var err error _, err = rawSQLDB.Exec(`CREATE TABLE domains( domain VARCHAR(255) PRIMARY KEY);`) Expect(err).NotTo(HaveOccurred()) _, err = rawSQLDB.Exec(`CREATE TABLE desired_lrps( process_guid VARCHAR(255) PRIMARY KEY);`) Expect(err).NotTo(HaveOccurred())