mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
refactor: sqlite schema
This commit is contained in:
parent
7366acb58e
commit
bf5247066d
@ -1,2 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE doc_table;
|
@ -1,7 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE doc_table (
|
||||
id TEXT NOT NULL PRIMARY KEY,
|
||||
-- data BLOB NOT NULL DEFAULT (x''),
|
||||
data TEXT NOT NULL DEFAULT '',
|
||||
rev_id BIGINT NOT NULL DEFAULT 0
|
||||
);
|
@ -1,2 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE kv_table;
|
@ -1,5 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE kv_table (
|
||||
key TEXT NOT NULL PRIMARY KEY,
|
||||
value BLOB NOT NULL DEFAULT (x'')
|
||||
);
|
@ -1,3 +1,4 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE kv_table;
|
||||
DROP TABLE grid_rev_table;
|
||||
DROP TABLE grid_meta_rev_table;
|
@ -1,4 +1,8 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE kv_table (
|
||||
key TEXT NOT NULL PRIMARY KEY,
|
||||
value BLOB NOT NULL DEFAULT (x'')
|
||||
);
|
||||
CREATE TABLE grid_rev_table (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
object_id TEXT NOT NULL DEFAULT '',
|
@ -0,0 +1 @@
|
||||
-- This file should undo anything in `up.sql`
|
@ -0,0 +1,2 @@
|
||||
-- Your SQL goes here
|
||||
ALTER TABLE view_table ADD COLUMN ext_data TEXT NOT NULL DEFAULT '';
|
@ -13,14 +13,6 @@ table! {
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
doc_table (id) {
|
||||
id -> Text,
|
||||
data -> Text,
|
||||
rev_id -> BigInt,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
grid_block_index_table (row_id) {
|
||||
row_id -> Text,
|
||||
@ -102,6 +94,7 @@ table! {
|
||||
view_type -> Integer,
|
||||
version -> BigInt,
|
||||
is_trash -> Bool,
|
||||
ext_data -> Text,
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,7 +112,6 @@ table! {
|
||||
|
||||
allow_tables_to_appear_in_same_query!(
|
||||
app_table,
|
||||
doc_table,
|
||||
grid_block_index_table,
|
||||
grid_meta_rev_table,
|
||||
grid_rev_table,
|
||||
|
@ -79,6 +79,7 @@ pub(crate) struct ViewTable {
|
||||
pub view_type: SqlViewDataType,
|
||||
pub version: i64,
|
||||
pub is_trash: bool,
|
||||
pub ext_data: String,
|
||||
}
|
||||
|
||||
impl ViewTable {
|
||||
@ -120,7 +121,7 @@ impl std::convert::From<ViewTable> for View {
|
||||
modified_time: table.modified_time,
|
||||
version: table.version,
|
||||
create_time: table.create_time,
|
||||
ext_data: "".to_string(),
|
||||
ext_data: table.ext_data,
|
||||
thumbnail: table.thumbnail,
|
||||
// Store the view in ViewTable was deprecated since v0.0.2.
|
||||
// No need worry about plugin_type.
|
||||
|
Loading…
Reference in New Issue
Block a user