u
This commit is contained in:
1 parent
fc005e0fb4
commit
10d0cadfe3
18 files changed
+591
-133
No files matched your search
@@ -23,27 +23,47 @@ primary key,
|
||||
|
||||
create table space
|
||||
(
|
||||
id bigint not null
|
||||
primary key,
|
||||
name varchar(255) not null,
|
||||
invite_code varchar(30) not null,
|
||||
owner_id bigint not null,
|
||||
create_time timestamp with time zone default now(),
|
||||
update_time timestamp with time zone default now()
|
||||
id bigint primary key,
|
||||
|
||||
-- 核心业务字段
|
||||
name varchar(255) not null,
|
||||
invite_code varchar(30) not null unique,
|
||||
owner_id bigint not null,
|
||||
|
||||
-- 状态字段
|
||||
status smallint default 0 not null, -- 0 active 1 disabled 2 dissolved
|
||||
disabled_time timestamp with time zone,
|
||||
dissolve_time timestamp with time zone,
|
||||
|
||||
-- 时间字段
|
||||
create_time timestamp with time zone default now() not null,
|
||||
update_time timestamp with time zone default now() not null
|
||||
);
|
||||
|
||||
create table space_member
|
||||
(
|
||||
id bigint not null
|
||||
primary key,
|
||||
space_id bigint not null,
|
||||
user_id bigint not null,
|
||||
role smallint default 2 not null,
|
||||
is_default smallint default 0 not null,
|
||||
user_name varchar(255) not null,
|
||||
sort_number integer default 0 not null,
|
||||
join_time timestamp with time zone default now(),
|
||||
update_time timestamp with time zone default now()
|
||||
id bigint primary key,
|
||||
|
||||
-- 关系核心字段
|
||||
space_id bigint not null,
|
||||
user_id bigint not null,
|
||||
|
||||
-- 角色 & 默认
|
||||
role smallint default 2 not null,
|
||||
is_default smallint default 0 not null,
|
||||
sort_number integer default 0 not null,
|
||||
member_name varchar(255) not null,
|
||||
|
||||
-- 成员状态
|
||||
status smallint default 0 not null, -- 0 active 1 disabled 2 exited
|
||||
disabled_time timestamp with time zone,
|
||||
exit_time timestamp with time zone,
|
||||
|
||||
-- 时间字段
|
||||
join_time timestamp with time zone default now() not null,
|
||||
update_time timestamp with time zone default now() not null,
|
||||
|
||||
unique (space_id, user_id)
|
||||
);
|
||||
|
||||
create table finance_category_default
|
||||
|
||||
Reference in new issue
Block a user