22 lines
347 B
MySQL
22 lines
347 B
MySQL
|
-- 创建账户表
|
||
|
CREATE TABLE account (
|
||
|
a_id SERIAL PRIMARY KEY,
|
||
|
meta JSONB
|
||
|
);
|
||
|
|
||
|
-- 创建类别表
|
||
|
CREATE TABLE category (
|
||
|
c_id SERIAL PRIMARY KEY,
|
||
|
meta JSONB
|
||
|
);
|
||
|
|
||
|
-- 创建流水表
|
||
|
CREATE TABLE transaction (
|
||
|
t_id SERIAL PRIMARY KEY,
|
||
|
c_id INTEGER REFERENCES category(c_id),
|
||
|
a_id INTEGER REFERENCES account(a_id),
|
||
|
meta JSONB
|
||
|
);
|
||
|
|
||
|
|