Skip to content

Commit a27ca58

Browse files
refactor: improve reliability
Signed-off-by: Anatoli Nicolae <an@thundersquared.com>
1 parent ccdd31b commit a27ca58

File tree

1 file changed

+4
-2
lines changed
  • web3/ansible/roles/system/migrations/tasks

1 file changed

+4
-2
lines changed

web3/ansible/roles/system/migrations/tasks/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,14 @@
5353
register: migration_results
5454

5555
- name: Record applied migrations
56-
command: sqlite3 {{ migration_state_file }} "INSERT OR IGNORE INTO migrations (id) VALUES ('{{ item }}');"
56+
command: sqlite3 {{ migration_state_file }} "INSERT INTO migrations (id) VALUES ('{{ item }}');"
5757
loop: "{{ pending_migrations }}"
58+
loop_control:
59+
index_var: migration_index
5860
when:
5961
- migration_results.results is defined
6062
- migration_results.results | length > 0
61-
- not (migration_results.results[ansible_loop.index0].failed | default(false))
63+
- not (migration_results.results[migration_index].failed | default(false))
6264

6365
- name: Verify migrations were recorded
6466
command: sqlite3 {{ migration_state_file }} "SELECT id FROM migrations;"

0 commit comments

Comments
 (0)