-- SQL dump generated using DBML (dbml.dbdiagram.io)
-- Database: PostgreSQL
-- Generated at: 2025-06-12T01:21:05.629Z

CREATE TABLE "sys_user" (
  "id" SERIAL NOT NULL,
  "uuid" uuid NOT NULL,
  "email" VARCHAR(100) NOT NULL,
  "username" VARCHAR(100) NOT NULL,
  "hashed_password" bytea NOT NULL,
  "salt" VARCHAR(20) NOT NULL,
  "avatar" VARCHAR(200) NOT NULL,
  "gender" INT NOT NULL DEFAULT 0,
  "department_id" INT NOT NULL DEFAULT 0,
  "role_id" INT NOT NULL DEFAULT 0,
  "status" INT NOT NULL DEFAULT 0,
  "change_password_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  PRIMARY KEY ("id")
);

CREATE TABLE "sys_user_login_log" (
  "id" BIGSERIAL NOT NULL,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "email" VARCHAR(100) NOT NULL,
  "is_success" Boolean NOT NULL,
  "message" VARCHAR(300) NOT NULL,
  "referer_url" VARCHAR(500) NOT NULL,
  "url" VARCHAR(500) NOT NULL,
  "os" VARCHAR(50) NOT NULL,
  "ip" VARCHAR(20) NOT NULL,
  "browser" VARCHAR(100) NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "sys_audit_log" (
  "id" BIGSERIAL NOT NULL,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "email" VARCHAR(100) NOT NULL,
  "start_at" TIMESTAMPTZ NOT NULL,
  "end_at" TIMESTAMPTZ NOT NULL,
  "duration" VARCHAR(10) NOT NULL,
  "url" VARCHAR(500) NOT NULL,
  "method" VARCHAR(50) NOT NULL,
  "parameters" VARCHAR NOT NULL,
  "referer_url" VARCHAR(500) NOT NULL,
  "os" VARCHAR(50) NOT NULL,
  "ip" VARCHAR(20) NOT NULL,
  "browser" VARCHAR(100) NOT NULL,
  "remark" VARCHAR(300) NOT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "sessions" (
  "token" TEXT NOT NULL,
  "data" BYTEA NOT NULL,
  "expiry" TIMESTAMPTZ NOT NULL,
  PRIMARY KEY ("token")
);

CREATE TABLE "sys_department" (
  "id" SERIAL NOT NULL,
  "name" VARCHAR(200) NOT NULL,
  "parent_id" INT NOT NULL,
  "parent_path" VARCHAR(500) NOT NULL,
  "status" INT NOT NULL DEFAULT 0,
  "sort" INT NOT NULL DEFAULT 0,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  PRIMARY KEY ("id")
);

CREATE TABLE "sys_role" (
  "id" SERIAL NOT NULL,
  "name" VARCHAR(200) NOT NULL,
  "display_name" VARCHAR(200) NOT NULL,
  "parent_id" INT NOT NULL,
  "parent_path" VARCHAR(500) NOT NULL,
  "vip" Boolean NOT NULL,
  "status" INT NOT NULL DEFAULT 0,
  "sort" INT NOT NULL DEFAULT 0,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  PRIMARY KEY ("id")
);

CREATE TABLE "sys_menu" (
  "id" SERIAL NOT NULL,
  "name" VARCHAR(200) NOT NULL,
  "display_name" VARCHAR(200) NOT NULL,
  "url" VARCHAR(200) NOT NULL,
  "type" VARCHAR(50) NOT NULL,
  "parent_id" INT NOT NULL,
  "parent_path" VARCHAR(500) NOT NULL,
  "avatar" VARCHAR(100) NOT NULL,
  "style" VARCHAR(100) NOT NULL,
  "visible" Boolean NOT NULL,
  "is_list" Boolean NOT NULL,
  "status" INT NOT NULL DEFAULT 0,
  "sort" INT NOT NULL DEFAULT 0,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  PRIMARY KEY ("id")
);

CREATE TABLE "sys_role_menu" (
  "role_id" INT NOT NULL,
  "menu_id" INT NOT NULL,
  PRIMARY KEY ("role_id", "menu_id")
);

CREATE TABLE "sys_config" (
  "id" SERIAL NOT NULL,
  "key" VARCHAR(100) NOT NULL,
  "value" jsonb NOT NULL,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  PRIMARY KEY ("id")
);

CREATE TABLE "categories" (
  "id" SERIAL NOT NULL,
  "name" VARCHAR(100) NOT NULL,
  "icon" VARCHAR(300) NOT NULL DEFAULT '',
  "description" VARCHAR(500) NOT NULL DEFAULT '',
  "letter" VARCHAR(100) NOT NULL DEFAULT '',
  "parent_id" INT NOT NULL DEFAULT 0,
  "parent_path" VARCHAR(500) NOT NULL DEFAULT '',
  "status" SMALLINT NOT NULL DEFAULT 0,
  "sort" INT NOT NULL DEFAULT 0,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  PRIMARY KEY ("id")
);

CREATE TABLE "customers" (
  "id" BIGINT NOT NULL,
  "name" VARCHAR(100) NOT NULL,
  "category" INT NOT NULL DEFAULT 0,
  "source" INT NOT NULL DEFAULT 0,
  "address" VARCHAR(500) NOT NULL DEFAULT '',
  "contact_name" VARCHAR(100) NOT NULL DEFAULT '',
  "contact_phone" VARCHAR(50) NOT NULL DEFAULT '',
  "status" SMALLINT NOT NULL DEFAULT 0,
  "sort" INT NOT NULL DEFAULT 0,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "created_by" INT NOT NULL DEFAULT 0,
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  "updated_by" INT NOT NULL DEFAULT 0,
  PRIMARY KEY ("id")
);

CREATE TABLE "customer_contact" (
  "id" SERIAL NOT NULL,
  "name" VARCHAR(100) NOT NULL,
  "telephone" VARCHAR(50) NOT NULL,
  "customer_id" BIGINT NOT NULL,
  "status" SMALLINT NOT NULL DEFAULT 0,
  "sort" INT NOT NULL DEFAULT 0,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "created_by" INT NOT NULL DEFAULT 0,
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  "updated_by" INT NOT NULL DEFAULT 0,
  PRIMARY KEY ("id")
);

CREATE TABLE "projects" (
  "id" BIGINT NOT NULL,
  "name" VARCHAR(100) NOT NULL,
  "start_at" TIMESTAMPTZ NOT NULL,
  "end_at" TIMESTAMPTZ NOT NULL,
  "customer_id" BIGINT NOT NULL,
  "total_money" DECIMAL(10,2) NOT NULL DEFAULT 0,
  "description" VARCHAR(500) NOT NULL DEFAULT '',
  "apply_at" TIMESTAMPTZ NOT NULL,
  "apply_user_id" INT NOT NULL,
  "manager_id" INT NOT NULL,
  "members" VARCHAR(1000) NOT NULL,
  "status" SMALLINT NOT NULL DEFAULT 0,
  "sort" INT NOT NULL DEFAULT 0,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "created_user_id" INT NOT NULL DEFAULT 0,
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  "updated_user_id" INT NOT NULL DEFAULT 0,
  PRIMARY KEY ("id")
);

CREATE TABLE "project_files" (
  "id" BIGINT NOT NULL,
  "name" VARCHAR(100) NOT NULL,
  "path" VARCHAR(500) NOT NULL,
  "project_id" BIGINT NOT NULL,
  "sort" INT NOT NULL DEFAULT 0,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "created_user_id" INT NOT NULL DEFAULT 0,
  PRIMARY KEY ("id")
);

CREATE TABLE "budgets" (
  "id" BIGSERIAL NOT NULL,
  "project_id" BIGINT NOT NULL,
  "name" VARCHAR(100) NOT NULL,
  "budget_type" INT NOT NULL,
  "category" INT NOT NULL,
  "start_at" TIMESTAMPTZ NOT NULL,
  "end_at" TIMESTAMPTZ NOT NULL,
  "amount" DECIMAL(10,2) NOT NULL DEFAULT 0,
  "used_amount" DECIMAL(10,2) NOT NULL DEFAULT 0,
  "remaining_amount" DECIMAL(10,2) NOT NULL DEFAULT 0,
  "remark" VARCHAR(500) NOT NULL DEFAULT '',
  "status" SMALLINT NOT NULL DEFAULT 0,
  "sort" INT NOT NULL DEFAULT 0,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "created_user_id" INT NOT NULL DEFAULT 0,
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  "updated_user_id" INT NOT NULL DEFAULT 0,
  PRIMARY KEY ("id")
);

CREATE TABLE "incomes" (
  "id" BIGSERIAL NOT NULL,
  "project_id" BIGINT NOT NULL,
  "budget_id" BIGINT NOT NULL DEFAULT 0,
  "amount" DECIMAL(10,2) NOT NULL DEFAULT 0,
  "income_at" TIMESTAMPTZ NOT NULL,
  "income_type" INT NOT NULL,
  "income_bank" INT NOT NULL,
  "remark" VARCHAR(500) NOT NULL DEFAULT '',
  "status" SMALLINT NOT NULL DEFAULT 0,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "created_user_id" INT NOT NULL DEFAULT 0,
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  "updated_user_id" INT NOT NULL DEFAULT 0,
  PRIMARY KEY ("id")
);

CREATE TABLE "expenses" (
  "id" BIGSERIAL NOT NULL,
  "project_id" BIGINT NOT NULL,
  "budget_id" BIGINT NOT NULL DEFAULT 0,
  "amount" DECIMAL(10,2) NOT NULL DEFAULT 0,
  "expenses_at" TIMESTAMPTZ NOT NULL,
  "expenses_type" INT NOT NULL,
  "remark" VARCHAR(500) NOT NULL DEFAULT '',
  "status" SMALLINT NOT NULL DEFAULT 0,
  "created_at" TIMESTAMPTZ NOT NULL DEFAULT (NOW()),
  "created_user_id" INT NOT NULL DEFAULT 0,
  "updated_at" TIMESTAMPTZ NOT NULL DEFAULT ('0001-01-01 00:00:00+8'),
  "updated_user_id" INT NOT NULL DEFAULT 0,
  PRIMARY KEY ("id")
);

CREATE UNIQUE INDEX ON "sys_user" ("uuid");

CREATE UNIQUE INDEX ON "sys_user" ("username");

CREATE UNIQUE INDEX ON "sys_user" ("email");

CREATE INDEX ON "sys_user" ("status");

CREATE INDEX ON "sys_user_login_log" ("created_at");

CREATE INDEX ON "sys_user_login_log" ("email");

CREATE INDEX ON "sys_audit_log" ("created_at");

CREATE INDEX ON "sys_audit_log" ("email");

CREATE INDEX ON "sessions" ("expiry");

CREATE UNIQUE INDEX ON "sys_department" ("name");

CREATE INDEX ON "sys_department" ("status");

CREATE UNIQUE INDEX ON "sys_role" ("name");

CREATE UNIQUE INDEX ON "sys_role" ("display_name");

CREATE INDEX ON "sys_role" ("status");

CREATE UNIQUE INDEX ON "sys_menu" ("url");

CREATE INDEX ON "sys_menu" ("type");

CREATE INDEX ON "sys_menu" ("parent_id");

CREATE INDEX ON "sys_menu" ("status");

CREATE UNIQUE INDEX ON "sys_config" ("key");

CREATE INDEX ON "categories" ("name");

CREATE UNIQUE INDEX ON "categories" ("letter");

CREATE INDEX ON "customers" ("name");

CREATE INDEX ON "customer_contact" ("name");

CREATE INDEX ON "customer_contact" ("telephone");

CREATE INDEX ON "projects" ("name");

CREATE INDEX ON "project_files" ("name");

CREATE INDEX ON "budgets" ("project_id");

CREATE INDEX ON "budgets" ("category");

CREATE INDEX ON "incomes" ("project_id");

CREATE INDEX ON "incomes" ("budget_id");

CREATE INDEX ON "incomes" ("income_type");

CREATE INDEX ON "expenses" ("project_id");

CREATE INDEX ON "expenses" ("budget_id");

CREATE INDEX ON "expenses" ("expenses_type");

COMMENT ON COLUMN "sys_user"."email" IS '邮箱地址';

COMMENT ON COLUMN "sys_user"."username" IS '用户名称';

COMMENT ON COLUMN "sys_user"."hashed_password" IS '加密密码';

COMMENT ON COLUMN "sys_user"."salt" IS '密码盐值';

COMMENT ON COLUMN "sys_user"."avatar" IS '头像';

COMMENT ON COLUMN "sys_user"."gender" IS '性别';

COMMENT ON COLUMN "sys_user"."department_id" IS '部门';

COMMENT ON COLUMN "sys_user"."role_id" IS '角色';

COMMENT ON COLUMN "sys_user"."status" IS '状态';

COMMENT ON COLUMN "sys_user"."change_password_at" IS '密码修改时间';

COMMENT ON COLUMN "sys_user"."created_at" IS '创建时间';

COMMENT ON COLUMN "sys_user"."updated_at" IS '更新时间';

COMMENT ON COLUMN "sys_user_login_log"."created_at" IS '创建时间';

COMMENT ON COLUMN "sys_user_login_log"."email" IS '邮箱地址';

COMMENT ON COLUMN "sys_user_login_log"."is_success" IS '是否登陆成功';

COMMENT ON COLUMN "sys_user_login_log"."message" IS '登陆消息';

COMMENT ON COLUMN "sys_user_login_log"."referer_url" IS '上一个链接';

COMMENT ON COLUMN "sys_user_login_log"."url" IS '链接';

COMMENT ON COLUMN "sys_user_login_log"."os" IS '系统';

COMMENT ON COLUMN "sys_user_login_log"."ip" IS 'ip';

COMMENT ON COLUMN "sys_user_login_log"."browser" IS '浏览器';

COMMENT ON COLUMN "sys_audit_log"."created_at" IS '创建时间';

COMMENT ON COLUMN "sys_audit_log"."email" IS '邮箱地址';

COMMENT ON COLUMN "sys_audit_log"."start_at" IS '请求开始时间';

COMMENT ON COLUMN "sys_audit_log"."end_at" IS '请求结束时间';

COMMENT ON COLUMN "sys_audit_log"."duration" IS '请求总时间';

COMMENT ON COLUMN "sys_audit_log"."url" IS '请求链接';

COMMENT ON COLUMN "sys_audit_log"."method" IS '请求类型';

COMMENT ON COLUMN "sys_audit_log"."parameters" IS '请求参数';

COMMENT ON COLUMN "sys_audit_log"."referer_url" IS '上一个链接';

COMMENT ON COLUMN "sys_audit_log"."os" IS '系统';

COMMENT ON COLUMN "sys_audit_log"."ip" IS 'ip';

COMMENT ON COLUMN "sys_audit_log"."browser" IS '浏览器';

COMMENT ON COLUMN "sys_audit_log"."remark" IS '备注';

COMMENT ON COLUMN "sessions"."token" IS 'token';

COMMENT ON COLUMN "sessions"."data" IS 'data';

COMMENT ON COLUMN "sessions"."expiry" IS 'expiry';

COMMENT ON COLUMN "sys_department"."name" IS '部门名称';

COMMENT ON COLUMN "sys_department"."parent_id" IS '上级id';

COMMENT ON COLUMN "sys_department"."parent_path" IS '树路径';

COMMENT ON COLUMN "sys_department"."status" IS '状态';

COMMENT ON COLUMN "sys_department"."sort" IS '排序';

COMMENT ON COLUMN "sys_department"."created_at" IS '创建时间';

COMMENT ON COLUMN "sys_department"."updated_at" IS '更新时间';

COMMENT ON COLUMN "sys_role"."name" IS '名称';

COMMENT ON COLUMN "sys_role"."display_name" IS '显示名称';

COMMENT ON COLUMN "sys_role"."parent_id" IS '上级id';

COMMENT ON COLUMN "sys_role"."parent_path" IS '树路径';

COMMENT ON COLUMN "sys_role"."vip" IS '是否vip';

COMMENT ON COLUMN "sys_role"."status" IS '状态';

COMMENT ON COLUMN "sys_role"."sort" IS '排序';

COMMENT ON COLUMN "sys_role"."created_at" IS '创建时间';

COMMENT ON COLUMN "sys_role"."updated_at" IS '更新时间';

COMMENT ON COLUMN "sys_menu"."name" IS '名称';

COMMENT ON COLUMN "sys_menu"."display_name" IS '显示名称';

COMMENT ON COLUMN "sys_menu"."url" IS '菜单url';

COMMENT ON COLUMN "sys_menu"."type" IS '菜单类型(node, menu, btn)';

COMMENT ON COLUMN "sys_menu"."parent_id" IS '上级id';

COMMENT ON COLUMN "sys_menu"."parent_path" IS '树路径';

COMMENT ON COLUMN "sys_menu"."avatar" IS '菜单图标';

COMMENT ON COLUMN "sys_menu"."style" IS '菜单样式';

COMMENT ON COLUMN "sys_menu"."visible" IS '是否可见';

COMMENT ON COLUMN "sys_menu"."is_list" IS '是否列表';

COMMENT ON COLUMN "sys_menu"."status" IS '状态';

COMMENT ON COLUMN "sys_menu"."sort" IS '排序';

COMMENT ON COLUMN "sys_menu"."created_at" IS '创建时间';

COMMENT ON COLUMN "sys_menu"."updated_at" IS '更新时间';

COMMENT ON COLUMN "sys_role_menu"."role_id" IS '角色id';

COMMENT ON COLUMN "sys_role_menu"."menu_id" IS '菜单id';

COMMENT ON COLUMN "sys_config"."key" IS '存储键';

COMMENT ON COLUMN "sys_config"."value" IS '存储值';

COMMENT ON COLUMN "sys_config"."created_at" IS '创建时间';

COMMENT ON COLUMN "sys_config"."updated_at" IS '更新时间';

COMMENT ON COLUMN "categories"."id" IS 'ID';

COMMENT ON COLUMN "categories"."name" IS '名称';

COMMENT ON COLUMN "categories"."icon" IS '图标';

COMMENT ON COLUMN "categories"."description" IS '描述';

COMMENT ON COLUMN "categories"."letter" IS '拼音';

COMMENT ON COLUMN "categories"."parent_id" IS '父级ID';

COMMENT ON COLUMN "categories"."parent_path" IS '树路径';

COMMENT ON COLUMN "categories"."status" IS '状态';

COMMENT ON COLUMN "categories"."sort" IS '排序';

COMMENT ON COLUMN "categories"."created_at" IS '创建时间';

COMMENT ON COLUMN "categories"."updated_at" IS '更新时间';

COMMENT ON COLUMN "customers"."id" IS 'ID';

COMMENT ON COLUMN "customers"."name" IS '名称';

COMMENT ON COLUMN "customers"."category" IS '类别';

COMMENT ON COLUMN "customers"."source" IS '来源';

COMMENT ON COLUMN "customers"."address" IS '地址';

COMMENT ON COLUMN "customers"."contact_name" IS '主要联系人';

COMMENT ON COLUMN "customers"."contact_phone" IS '主要联系人手机';

COMMENT ON COLUMN "customers"."status" IS '状态';

COMMENT ON COLUMN "customers"."sort" IS '排序';

COMMENT ON COLUMN "customers"."created_at" IS '创建时间';

COMMENT ON COLUMN "customers"."created_by" IS '创建人';

COMMENT ON COLUMN "customers"."updated_at" IS '更新时间';

COMMENT ON COLUMN "customers"."updated_by" IS '更新人';

COMMENT ON COLUMN "customer_contact"."id" IS 'ID';

COMMENT ON COLUMN "customer_contact"."name" IS '名称';

COMMENT ON COLUMN "customer_contact"."telephone" IS '联系方式';

COMMENT ON COLUMN "customer_contact"."customer_id" IS '客户ID';

COMMENT ON COLUMN "customer_contact"."status" IS '状态';

COMMENT ON COLUMN "customer_contact"."sort" IS '排序';

COMMENT ON COLUMN "customer_contact"."created_at" IS '创建时间';

COMMENT ON COLUMN "customer_contact"."created_by" IS '创建人';

COMMENT ON COLUMN "customer_contact"."updated_at" IS '更新时间';

COMMENT ON COLUMN "customer_contact"."updated_by" IS '更新人';

COMMENT ON COLUMN "projects"."id" IS 'ID';

COMMENT ON COLUMN "projects"."name" IS '名称';

COMMENT ON COLUMN "projects"."start_at" IS '开始时间';

COMMENT ON COLUMN "projects"."end_at" IS '结束时间';

COMMENT ON COLUMN "projects"."customer_id" IS '客户ID';

COMMENT ON COLUMN "projects"."total_money" IS '总金额';

COMMENT ON COLUMN "projects"."description" IS '简介';

COMMENT ON COLUMN "projects"."apply_at" IS '申请时间';

COMMENT ON COLUMN "projects"."apply_user_id" IS '申请人';

COMMENT ON COLUMN "projects"."manager_id" IS '项目经理';

COMMENT ON COLUMN "projects"."members" IS '项目成员';

COMMENT ON COLUMN "projects"."status" IS '状态';

COMMENT ON COLUMN "projects"."sort" IS '排序';

COMMENT ON COLUMN "projects"."created_at" IS '创建时间';

COMMENT ON COLUMN "projects"."created_user_id" IS '创建人';

COMMENT ON COLUMN "projects"."updated_at" IS '更新时间';

COMMENT ON COLUMN "projects"."updated_user_id" IS '更新人';

COMMENT ON COLUMN "project_files"."id" IS 'ID';

COMMENT ON COLUMN "project_files"."name" IS '名称';

COMMENT ON COLUMN "project_files"."path" IS '路径';

COMMENT ON COLUMN "project_files"."project_id" IS '项目ID';

COMMENT ON COLUMN "project_files"."sort" IS '排序';

COMMENT ON COLUMN "project_files"."created_at" IS '创建时间';

COMMENT ON COLUMN "project_files"."created_user_id" IS '创建人';

COMMENT ON COLUMN "budgets"."id" IS 'ID';

COMMENT ON COLUMN "budgets"."project_id" IS '项目ID';

COMMENT ON COLUMN "budgets"."name" IS '名称';

COMMENT ON COLUMN "budgets"."budget_type" IS '预算类型: 收入/支出';

COMMENT ON COLUMN "budgets"."category" IS '类别';

COMMENT ON COLUMN "budgets"."start_at" IS '开始时间';

COMMENT ON COLUMN "budgets"."end_at" IS '结束时间';

COMMENT ON COLUMN "budgets"."amount" IS '预算金额';

COMMENT ON COLUMN "budgets"."used_amount" IS '已使用金额';

COMMENT ON COLUMN "budgets"."remaining_amount" IS '剩余金额';

COMMENT ON COLUMN "budgets"."remark" IS '备注';

COMMENT ON COLUMN "budgets"."status" IS '状态';

COMMENT ON COLUMN "budgets"."sort" IS '排序';

COMMENT ON COLUMN "budgets"."created_at" IS '创建时间';

COMMENT ON COLUMN "budgets"."created_user_id" IS '创建人';

COMMENT ON COLUMN "budgets"."updated_at" IS '更新时间';

COMMENT ON COLUMN "budgets"."updated_user_id" IS '更新人';

COMMENT ON COLUMN "incomes"."id" IS 'ID';

COMMENT ON COLUMN "incomes"."project_id" IS '项目ID';

COMMENT ON COLUMN "incomes"."budget_id" IS '预算ID';

COMMENT ON COLUMN "incomes"."amount" IS '收入金额';

COMMENT ON COLUMN "incomes"."income_at" IS '收入时间';

COMMENT ON COLUMN "incomes"."income_type" IS '收入类型';

COMMENT ON COLUMN "incomes"."income_bank" IS '收入银行';

COMMENT ON COLUMN "incomes"."remark" IS '备注';

COMMENT ON COLUMN "incomes"."status" IS '状态';

COMMENT ON COLUMN "incomes"."created_at" IS '创建时间';

COMMENT ON COLUMN "incomes"."created_user_id" IS '创建人';

COMMENT ON COLUMN "incomes"."updated_at" IS '更新时间';

COMMENT ON COLUMN "incomes"."updated_user_id" IS '更新人';

COMMENT ON COLUMN "expenses"."id" IS 'ID';

COMMENT ON COLUMN "expenses"."project_id" IS '项目ID';

COMMENT ON COLUMN "expenses"."budget_id" IS '预算ID';

COMMENT ON COLUMN "expenses"."amount" IS '支出金额';

COMMENT ON COLUMN "expenses"."expenses_at" IS '支出时间';

COMMENT ON COLUMN "expenses"."expenses_type" IS '支出类型';

COMMENT ON COLUMN "expenses"."remark" IS '备注';

COMMENT ON COLUMN "expenses"."status" IS '状态';

COMMENT ON COLUMN "expenses"."created_at" IS '创建时间';

COMMENT ON COLUMN "expenses"."created_user_id" IS '创建人';

COMMENT ON COLUMN "expenses"."updated_at" IS '更新时间';

COMMENT ON COLUMN "expenses"."updated_user_id" IS '更新人';
