Skip to content

Commit c0b508b

Browse files
committed
Start adding support for sync streams
1 parent 2606c8b commit c0b508b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

crates/core/src/migrations.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,5 +384,24 @@ INSERT INTO ps_migration(id, down_migrations) VALUES (10, json_array(
384384
.into_db_result(local_db)?;
385385
}
386386

387+
if current_version < 11 && target_version >= 11 {
388+
let stmt = "\
389+
CREATE TABLE ps_streams (
390+
id NOT NULL INTEGER PRIMARY KEY,
391+
definition_name TEXT NOT NULL,
392+
is_default INTEGER NOT NULL,
393+
local_priority INTEGER,
394+
local_params TEXT
395+
) STRICT;
396+
ALTER TABLE ps_buckets ADD COLUMN derived_from INTEGER REFERENCES ps_streams (id);
397+
398+
INSERT INTO ps_migration(id, down_migrations) VALUES(9, json_array(
399+
json_object('sql', 'todo down migration'),
400+
json_object('sql', 'DELETE FROM ps_migration WHERE id >= 10')
401+
));
402+
";
403+
local_db.exec_safe(stmt)?;
404+
}
405+
387406
Ok(())
388407
}

0 commit comments

Comments
 (0)