mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: remove unused sqlite table (#2704)
* chore: remove unused sqlite table * ci: fix tests
This commit is contained in:
parent
e24a8aabeb
commit
f2dd58a4f1
@ -1,5 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE user_table;
|
||||
DROP TABLE workspace_table;
|
||||
DROP TABLE app_table;
|
||||
DROP TABLE view_table;
|
@ -1,53 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
|
||||
CREATE TABLE user_table (
|
||||
id TEXT NOT NULL PRIMARY KEY,
|
||||
name TEXT NOT NULL DEFAULT '',
|
||||
token TEXT NOT NULL DEFAULT '',
|
||||
email TEXT NOT NULL DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE TABLE workspace_table (
|
||||
id TEXT NOT NULL PRIMARY KEY,
|
||||
name TEXT NOT NULL DEFAULT '',
|
||||
desc TEXT NOT NULL DEFAULT '',
|
||||
modified_time BIGINT NOT NULL DEFAULT 0,
|
||||
create_time BIGINT NOT NULL DEFAULT 0,
|
||||
user_id TEXT NOT NULL DEFAULT '',
|
||||
version BIGINT NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE app_table (
|
||||
id TEXT NOT NULL PRIMARY KEY,
|
||||
workspace_id TEXT NOT NULL DEFAULT '',
|
||||
name TEXT NOT NULL DEFAULT '',
|
||||
desc TEXT NOT NULL DEFAULT '',
|
||||
color_style BLOB NOT NULL DEFAULT (x''),
|
||||
last_view_id TEXT DEFAULT '',
|
||||
modified_time BIGINT NOT NULL DEFAULT 0,
|
||||
create_time BIGINT NOT NULL DEFAULT 0,
|
||||
version BIGINT NOT NULL DEFAULT 0,
|
||||
is_trash Boolean NOT NULL DEFAULT false
|
||||
);
|
||||
|
||||
CREATE TABLE view_table (
|
||||
id TEXT NOT NULL PRIMARY KEY,
|
||||
belong_to_id TEXT NOT NULL DEFAULT '',
|
||||
name TEXT NOT NULL DEFAULT '',
|
||||
desc TEXT NOT NULL DEFAULT '',
|
||||
modified_time BIGINT NOT NULL DEFAULT 0,
|
||||
create_time BIGINT NOT NULL DEFAULT 0,
|
||||
thumbnail TEXT NOT NULL DEFAULT '',
|
||||
view_type INTEGER NOT NULL DEFAULT 0,
|
||||
version BIGINT NOT NULL DEFAULT 0,
|
||||
is_trash Boolean NOT NULL DEFAULT false
|
||||
);
|
||||
|
||||
CREATE TABLE trash_table (
|
||||
id TEXT NOT NULL PRIMARY KEY,
|
||||
name TEXT NOT NULL DEFAULT '',
|
||||
desc TEXT NOT NULL DEFAULT '',
|
||||
modified_time BIGINT NOT NULL DEFAULT 0,
|
||||
create_time BIGINT NOT NULL DEFAULT 0,
|
||||
ty INTEGER NOT NULL DEFAULT 0
|
||||
);
|
@ -1,2 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
ALTER TABLE user_table DROP COLUMN workspace;
|
@ -1,2 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
ALTER TABLE user_table ADD COLUMN workspace TEXT NOT NULL DEFAULT '';
|
@ -1,10 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE rev_table (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
doc_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,
|
||||
ty INTEGER NOT NULL DEFAULT 0
|
||||
);
|
@ -1,4 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE kv_table;
|
||||
DROP TABLE grid_rev_table;
|
||||
DROP TABLE grid_meta_rev_table;
|
@ -1,22 +0,0 @@
|
||||
-- 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 '',
|
||||
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
|
||||
);
|
||||
|
||||
CREATE TABLE grid_meta_rev_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
|
||||
);
|
@ -1,3 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE grid_block_index_table;
|
||||
-- DROP TABLE grid_block_fts_table;
|
@ -1,7 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE grid_block_index_table (
|
||||
row_id TEXT NOT NULL PRIMARY KEY,
|
||||
block_id TEXT NOT NULL
|
||||
);
|
||||
|
||||
-- CREATE VIRTUAL TABLE grid_block_fts_table USING FTS5(content, grid_id, block_id, row_id);
|
@ -1,2 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE rev_snapshot;
|
@ -1,7 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE rev_snapshot (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
object_id TEXT NOT NULL DEFAULT '',
|
||||
rev_id BIGINT NOT NULL DEFAULT 0,
|
||||
data BLOB NOT NULL DEFAULT (x'')
|
||||
);
|
@ -1,2 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
ALTER TABLE view_table DROP COLUMN ext_data;
|
@ -1,2 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
ALTER TABLE view_table ADD COLUMN ext_data TEXT NOT NULL DEFAULT '';
|
@ -1 +0,0 @@
|
||||
ALTER TABLE user_table DROP COLUMN icon_url;
|
@ -1 +0,0 @@
|
||||
ALTER TABLE user_table ADD COLUMN icon_url TEXT NOT NULL DEFAULT '';
|
@ -1,2 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE grid_view_rev_table;
|
@ -1,11 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
|
||||
|
||||
CREATE TABLE grid_view_rev_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
|
||||
);
|
@ -1,2 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE grid_view_rev_table;
|
@ -1,9 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE document_rev_table (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
document_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
|
||||
);
|
@ -1,2 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE grid_rev_snapshot;
|
@ -1,9 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE grid_rev_snapshot (
|
||||
snapshot_id TEXT NOT NULL PRIMARY KEY DEFAULT '',
|
||||
object_id TEXT NOT NULL DEFAULT '',
|
||||
rev_id BIGINT NOT NULL DEFAULT 0,
|
||||
base_rev_id BIGINT NOT NULL DEFAULT 0,
|
||||
timestamp BIGINT NOT NULL DEFAULT 0,
|
||||
data BLOB NOT NULL DEFAULT (x'')
|
||||
);
|
@ -1,2 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE folder_rev_snapshot;
|
@ -1,9 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE folder_rev_snapshot (
|
||||
snapshot_id TEXT NOT NULL PRIMARY KEY DEFAULT '',
|
||||
object_id TEXT NOT NULL DEFAULT '',
|
||||
rev_id BIGINT NOT NULL DEFAULT 0,
|
||||
base_rev_id BIGINT NOT NULL DEFAULT 0,
|
||||
timestamp BIGINT NOT NULL DEFAULT 0,
|
||||
data BLOB NOT NULL DEFAULT (x'')
|
||||
);
|
@ -1,2 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE document_rev_snapshot;
|
@ -1,9 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE document_rev_snapshot (
|
||||
snapshot_id TEXT NOT NULL PRIMARY KEY DEFAULT '',
|
||||
object_id TEXT NOT NULL DEFAULT '',
|
||||
rev_id BIGINT NOT NULL DEFAULT 0,
|
||||
base_rev_id BIGINT NOT NULL DEFAULT 0,
|
||||
timestamp BIGINT NOT NULL DEFAULT 0,
|
||||
data BLOB NOT NULL DEFAULT (x'')
|
||||
);
|
@ -1 +0,0 @@
|
||||
ALTER TABLE user_table DROP COLUMN openai_key;
|
@ -1 +0,0 @@
|
||||
ALTER TABLE user_table ADD COLUMN openai_key TEXT NOT NULL DEFAULT '';
|
@ -1,2 +0,0 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE database_refs;
|
@ -1,8 +0,0 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE database_refs (
|
||||
ref_id TEXT NOT NULL PRIMARY KEY DEFAULT '',
|
||||
name TEXT NOT NULL DEFAULT '',
|
||||
is_base Boolean NOT NULL DEFAULT false,
|
||||
view_id TEXT NOT NULL DEFAULT '',
|
||||
database_id TEXT NOT NULL DEFAULT ''
|
||||
);
|
@ -1,2 +1,2 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE rev_table;
|
||||
DROP TABLE user_table;
|
@ -0,0 +1,10 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE user_table (
|
||||
id TEXT NOT NULL PRIMARY KEY,
|
||||
name TEXT NOT NULL DEFAULT '',
|
||||
workspace TEXT NOT NULL DEFAULT '',
|
||||
icon_url TEXT NOT NULL DEFAULT '',
|
||||
openai_key TEXT NOT NULL DEFAULT '',
|
||||
token TEXT NOT NULL DEFAULT '',
|
||||
email TEXT NOT NULL DEFAULT ''
|
||||
);
|
@ -1,209 +1,13 @@
|
||||
// @generated automatically by Diesel CLI.
|
||||
|
||||
diesel::table! {
|
||||
app_table (id) {
|
||||
id -> Text,
|
||||
workspace_id -> Text,
|
||||
name -> Text,
|
||||
desc -> Text,
|
||||
color_style -> Binary,
|
||||
last_view_id -> Nullable<Text>,
|
||||
modified_time -> BigInt,
|
||||
create_time -> BigInt,
|
||||
version -> BigInt,
|
||||
is_trash -> Bool,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
database_refs (ref_id) {
|
||||
ref_id -> Text,
|
||||
name -> Text,
|
||||
is_base -> Bool,
|
||||
view_id -> Text,
|
||||
database_id -> Text,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
document_rev_snapshot (snapshot_id) {
|
||||
snapshot_id -> Text,
|
||||
object_id -> Text,
|
||||
rev_id -> BigInt,
|
||||
base_rev_id -> BigInt,
|
||||
timestamp -> BigInt,
|
||||
data -> Binary,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
document_rev_table (id) {
|
||||
id -> Integer,
|
||||
document_id -> Text,
|
||||
base_rev_id -> BigInt,
|
||||
rev_id -> BigInt,
|
||||
data -> Binary,
|
||||
state -> Integer,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
folder_rev_snapshot (snapshot_id) {
|
||||
snapshot_id -> Text,
|
||||
object_id -> Text,
|
||||
rev_id -> BigInt,
|
||||
base_rev_id -> BigInt,
|
||||
timestamp -> BigInt,
|
||||
data -> Binary,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
grid_block_index_table (row_id) {
|
||||
row_id -> Text,
|
||||
block_id -> Text,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
grid_meta_rev_table (id) {
|
||||
id -> Integer,
|
||||
object_id -> Text,
|
||||
base_rev_id -> BigInt,
|
||||
rev_id -> BigInt,
|
||||
data -> Binary,
|
||||
state -> Integer,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
grid_rev_snapshot (snapshot_id) {
|
||||
snapshot_id -> Text,
|
||||
object_id -> Text,
|
||||
rev_id -> BigInt,
|
||||
base_rev_id -> BigInt,
|
||||
timestamp -> BigInt,
|
||||
data -> Binary,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
grid_rev_table (id) {
|
||||
id -> Integer,
|
||||
object_id -> Text,
|
||||
base_rev_id -> BigInt,
|
||||
rev_id -> BigInt,
|
||||
data -> Binary,
|
||||
state -> Integer,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
grid_view_rev_table (id) {
|
||||
id -> Integer,
|
||||
object_id -> Text,
|
||||
base_rev_id -> BigInt,
|
||||
rev_id -> BigInt,
|
||||
data -> Binary,
|
||||
state -> Integer,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
kv_table (key) {
|
||||
key -> Text,
|
||||
value -> Binary,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rev_snapshot (id) {
|
||||
id -> Integer,
|
||||
object_id -> Text,
|
||||
rev_id -> BigInt,
|
||||
data -> Binary,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
rev_table (id) {
|
||||
id -> Integer,
|
||||
doc_id -> Text,
|
||||
base_rev_id -> BigInt,
|
||||
rev_id -> BigInt,
|
||||
data -> Binary,
|
||||
state -> Integer,
|
||||
ty -> Integer,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
trash_table (id) {
|
||||
id -> Text,
|
||||
name -> Text,
|
||||
desc -> Text,
|
||||
modified_time -> BigInt,
|
||||
create_time -> BigInt,
|
||||
ty -> Integer,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
user_table (id) {
|
||||
id -> Text,
|
||||
name -> Text,
|
||||
token -> Text,
|
||||
email -> Text,
|
||||
workspace -> Text,
|
||||
icon_url -> Text,
|
||||
openai_key -> Text,
|
||||
token -> Text,
|
||||
email -> Text,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
view_table (id) {
|
||||
id -> Text,
|
||||
belong_to_id -> Text,
|
||||
name -> Text,
|
||||
desc -> Text,
|
||||
modified_time -> BigInt,
|
||||
create_time -> BigInt,
|
||||
thumbnail -> Text,
|
||||
view_type -> Integer,
|
||||
version -> BigInt,
|
||||
is_trash -> Bool,
|
||||
ext_data -> Text,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::table! {
|
||||
workspace_table (id) {
|
||||
id -> Text,
|
||||
name -> Text,
|
||||
desc -> Text,
|
||||
modified_time -> BigInt,
|
||||
create_time -> BigInt,
|
||||
user_id -> Text,
|
||||
version -> BigInt,
|
||||
}
|
||||
}
|
||||
|
||||
diesel::allow_tables_to_appear_in_same_query!(
|
||||
app_table,
|
||||
database_refs,
|
||||
document_rev_snapshot,
|
||||
document_rev_table,
|
||||
folder_rev_snapshot,
|
||||
grid_block_index_table,
|
||||
grid_meta_rev_table,
|
||||
grid_rev_snapshot,
|
||||
grid_rev_table,
|
||||
grid_view_rev_table,
|
||||
kv_table,
|
||||
rev_snapshot,
|
||||
rev_table,
|
||||
trash_table,
|
||||
user_table,
|
||||
view_table,
|
||||
workspace_table,
|
||||
);
|
||||
|
@ -105,16 +105,18 @@ lazy_static! {
|
||||
static ref COLLAB_DB_MAP: RwLock<HashMap<i64, Arc<RocksCollabDB>>> = RwLock::new(HashMap::new());
|
||||
}
|
||||
|
||||
/// The order of the fields in the struct must be the same as the order of the fields in the table.
|
||||
/// Check out the [schema.rs] for table schema.
|
||||
#[derive(Clone, Default, Queryable, Identifiable, Insertable)]
|
||||
#[table_name = "user_table"]
|
||||
pub struct UserTable {
|
||||
pub(crate) id: String,
|
||||
pub(crate) name: String,
|
||||
pub(crate) token: String,
|
||||
pub(crate) email: String,
|
||||
pub(crate) workspace: String,
|
||||
pub(crate) icon_url: String,
|
||||
pub(crate) openai_key: String,
|
||||
pub(crate) token: String,
|
||||
pub(crate) email: String,
|
||||
}
|
||||
|
||||
impl UserTable {
|
||||
|
Loading…
Reference in New Issue
Block a user