6 let mut test = Test::new("Remove index");
10 name = "create_users_table"
35 test.second_migration(
37 name = "remove_name_index"
45 test.intermediate(|db, _| {
46 // Ensure index is still valid and ready during the migration
47 let result: Vec<(bool, bool)> = db
50 SELECT pg_index.indisready, pg_index.indisvalid
51 FROM pg_catalog.pg_index
52 JOIN pg_catalog.pg_class ON pg_index.indexrelid = pg_class.oid
53 WHERE pg_class.relname = 'name_idx'
59 .map(|row| (row.get("indisready"), row.get("indisvalid")))
62 assert_eq!(vec![(true, true)], result);
65 test.after_completion(|db| {
66 // Ensure index has been removed after the migration is complete
71 FROM pg_catalog.pg_index
72 JOIN pg_catalog.pg_class ON pg_index.indexrelid = pg_class.oid
73 WHERE pg_class.relname = 'name_idx'
79 .map(|row| row.get(0))
82 assert_eq!(0, count, "expected index to not exist");
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list