diff --git a/frontend/rust-lib/flowy-database/migrations/2022-08-15-020544_grid-view/down.sql b/frontend/rust-lib/flowy-database/migrations/2022-08-15-020544_grid-view/down.sql new file mode 100644 index 0000000000..c2b23b0180 --- /dev/null +++ b/frontend/rust-lib/flowy-database/migrations/2022-08-15-020544_grid-view/down.sql @@ -0,0 +1,2 @@ +-- This file should undo anything in `up.sql` +DROP TABLE grid_view_table; \ No newline at end of file diff --git a/frontend/rust-lib/flowy-database/migrations/2022-08-15-020544_grid-view/up.sql b/frontend/rust-lib/flowy-database/migrations/2022-08-15-020544_grid-view/up.sql new file mode 100644 index 0000000000..d6e526aba4 --- /dev/null +++ b/frontend/rust-lib/flowy-database/migrations/2022-08-15-020544_grid-view/up.sql @@ -0,0 +1,11 @@ +-- Your SQL goes here + + +CREATE TABLE grid_view_table ( + id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + object_id TEXT NOT NULL DEFAULT '', + base_rev_id BIGINT NOT NULL DEFAULT 0, + rev_id BIGINT NOT NULL DEFAULT 0, + data BLOB NOT NULL DEFAULT (x''), + state INTEGER NOT NULL DEFAULT 0 +); diff --git a/frontend/rust-lib/flowy-database/src/schema.rs b/frontend/rust-lib/flowy-database/src/schema.rs index eda9cd888b..ae616622b7 100644 --- a/frontend/rust-lib/flowy-database/src/schema.rs +++ b/frontend/rust-lib/flowy-database/src/schema.rs @@ -42,6 +42,17 @@ table! { } } +table! { + grid_view_table (id) { + id -> Integer, + object_id -> Text, + base_rev_id -> BigInt, + rev_id -> BigInt, + data -> Binary, + state -> Integer, + } +} + table! { kv_table (key) { key -> Text, @@ -125,6 +136,7 @@ allow_tables_to_appear_in_same_query!( grid_block_index_table, grid_meta_rev_table, grid_rev_table, + grid_view_table, kv_table, rev_snapshot, rev_table, diff --git a/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs b/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs index ac5fe92c36..812ce561c1 100644 --- a/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs +++ b/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs @@ -7,6 +7,7 @@ use crate::services::cell::{apply_cell_data_changeset, decode_any_cell_data, Cel use crate::services::field::{default_type_option_builder_from_type, type_option_builder_from_bytes, FieldBuilder}; use crate::services::filter::{GridFilterChangeset, GridFilterService}; +use crate::services::grid_view_editor::GridViewRevisionEditor; use crate::services::group::GridGroupService; use crate::services::persistence::block_index::BlockIndexCache; use crate::services::row::{ @@ -32,7 +33,7 @@ pub struct GridRevisionEditor { pub(crate) grid_id: String, user: Arc, grid_pad: Arc>, - // view_editor: Arc, + view_editor: Arc, rev_manager: Arc, block_manager: Arc,