feat(db): change table
Why not use jsonb?
This commit is contained in:
parent
2fa863436a
commit
4bf9662efc
1 changed files with 0 additions and 4 deletions
|
@ -1,22 +1,18 @@
|
||||||
-- 创建账户表
|
-- 创建账户表
|
||||||
CREATE TABLE account (
|
CREATE TABLE account (
|
||||||
a_id SERIAL PRIMARY KEY,
|
a_id SERIAL PRIMARY KEY,
|
||||||
balance DECIMAL(10, 2),
|
|
||||||
meta JSONB
|
meta JSONB
|
||||||
);
|
);
|
||||||
|
|
||||||
-- 创建类别表
|
-- 创建类别表
|
||||||
CREATE TABLE category (
|
CREATE TABLE category (
|
||||||
c_id SERIAL PRIMARY KEY,
|
c_id SERIAL PRIMARY KEY,
|
||||||
income_type boolean,
|
|
||||||
meta JSONB
|
meta JSONB
|
||||||
);
|
);
|
||||||
|
|
||||||
-- 创建流水表
|
-- 创建流水表
|
||||||
CREATE TABLE transaction (
|
CREATE TABLE transaction (
|
||||||
t_id SERIAL PRIMARY KEY,
|
t_id SERIAL PRIMARY KEY,
|
||||||
amount DECIMAL(10, 2),
|
|
||||||
date DATE,
|
|
||||||
c_id INTEGER REFERENCES category(c_id),
|
c_id INTEGER REFERENCES category(c_id),
|
||||||
a_id INTEGER REFERENCES account(a_id),
|
a_id INTEGER REFERENCES account(a_id),
|
||||||
meta JSONB
|
meta JSONB
|
||||||
|
|
Loading…
Reference in a new issue