-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfix_035_fixtures.dart
54 lines (52 loc) · 2.01 KB
/
fix_035_fixtures.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/// Data with some records in actual tables but not in ps_oplog
const dataBroken = '''
;INSERT INTO ps_buckets(id, name, last_applied_op, last_op, target_op, add_checksum, op_checksum, pending_delete) VALUES
(1, 'b1', 0, 0, 0, 0, 120, 0),
(2, 'b2', 0, 0, 0, 0, 3, 0)
;INSERT INTO ps_oplog(bucket, op_id, row_type, row_id, key, data, hash) VALUES
(1, 1, 'todos', 't1', '', '{}', 100),
(1, 2, 'todos', 't2', '', '{}', 20),
(2, 3, 'lists', 'l1', '', '{}', 3)
;INSERT INTO ps_data__lists(id, data) VALUES
('l1', '{}'),
('l3', '{}')
;INSERT INTO ps_data__todos(id, data) VALUES
('t1', '{}'),
('t2', '{}'),
('t3', '{}')
''';
/// Data after applying the migration fix, but before sync_local
const dataMigrated = '''
;INSERT INTO ps_buckets(id, name, last_applied_op, last_op, target_op, add_checksum, op_checksum, pending_delete, count_at_last, count_since_last) VALUES
(1, 'b1', 0, 0, 0, 0, 120, 0, 0, 0),
(2, 'b2', 0, 0, 0, 0, 3, 0, 0, 0)
;INSERT INTO ps_oplog(bucket, op_id, row_type, row_id, key, data, hash) VALUES
(1, 1, 'todos', 't1', '', '{}', 100),
(1, 2, 'todos', 't2', '', '{}', 20),
(2, 3, 'lists', 'l1', '', '{}', 3)
;INSERT INTO ps_updated_rows(row_type, row_id) VALUES
('lists', 'l3'),
('todos', 't3')
;INSERT INTO ps_data__lists(id, data) VALUES
('l1', '{}'),
('l3', '{}')
;INSERT INTO ps_data__todos(id, data) VALUES
('t1', '{}'),
('t2', '{}'),
('t3', '{}')
''';
/// Data after applying the migration fix and sync_local
const dataFixed = '''
;INSERT INTO ps_buckets(id, name, last_applied_op, last_op, target_op, add_checksum, op_checksum, pending_delete, count_at_last, count_since_last) VALUES
(1, 'b1', 0, 0, 0, 0, 120, 0, 0, 0),
(2, 'b2', 0, 0, 0, 0, 3, 0, 0, 0)
;INSERT INTO ps_oplog(bucket, op_id, row_type, row_id, key, data, hash) VALUES
(1, 1, 'todos', 't1', '', '{}', 100),
(1, 2, 'todos', 't2', '', '{}', 20),
(2, 3, 'lists', 'l1', '', '{}', 3)
;INSERT INTO ps_data__lists(id, data) VALUES
('l1', '{}')
;INSERT INTO ps_data__todos(id, data) VALUES
('t1', '{}'),
('t2', '{}')
''';