AppFlowy/frontend/rust-lib/flowy-sqlite/migrations/2021-07-09-063045_user/up.sql
Nathan.fooo 5b07656295
Feat/database view (#1765)
* chore: rename flowy-database to flowy-sqlite

* refactor: rename flowy-grid to flowy-database

* refactor: rename grid to database

* refactor: rename GridEvent to DatabaseEvent

* refactor: rename grid_id to database_id

* refactor: rename dart code
2023-01-31 08:28:31 +08:00

54 lines
1.6 KiB
SQL

-- 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
);