{ "id": "95ee35f9-43d8-4df6-b2ff-f598eaf78113", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", "tables": { "public.finance_category_default": { "name": "finance_category_default", "schema": "", "columns": { "id": { "name": "id", "type": "bigint", "primaryKey": true, "notNull": true }, "name": { "name": "name", "type": "varchar(64)", "primaryKey": false, "notNull": true }, "icon": { "name": "icon", "type": "varchar(64)", "primaryKey": false, "notNull": true }, "type": { "name": "type", "type": "smallint", "primaryKey": false, "notNull": true, "default": 0 }, "sort_number": { "name": "sort_number", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "create_time": { "name": "create_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" }, "update_time": { "name": "update_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.finance_category_space": { "name": "finance_category_space", "schema": "", "columns": { "id": { "name": "id", "type": "bigint", "primaryKey": true, "notNull": true }, "space_id": { "name": "space_id", "type": "bigint", "primaryKey": false, "notNull": true }, "name": { "name": "name", "type": "varchar(64)", "primaryKey": false, "notNull": true }, "icon": { "name": "icon", "type": "varchar(64)", "primaryKey": false, "notNull": true }, "type": { "name": "type", "type": "smallint", "primaryKey": false, "notNull": true, "default": 0 }, "sort_number": { "name": "sort_number", "type": "integer", "primaryKey": false, "notNull": true, "default": 0 }, "create_by": { "name": "create_by", "type": "bigint", "primaryKey": false, "notNull": true }, "create_time": { "name": "create_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" }, "update_by": { "name": "update_by", "type": "bigint", "primaryKey": false, "notNull": true }, "update_time": { "name": "update_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "finance_category_space_space_id_space_id_fk": { "name": "finance_category_space_space_id_space_id_fk", "tableFrom": "finance_category_space", "tableTo": "space", "columnsFrom": [ "space_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "finance_category_space_create_by_user_id_fk": { "name": "finance_category_space_create_by_user_id_fk", "tableFrom": "finance_category_space", "tableTo": "user", "columnsFrom": [ "create_by" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "finance_category_space_update_by_user_id_fk": { "name": "finance_category_space_update_by_user_id_fk", "tableFrom": "finance_category_space", "tableTo": "user", "columnsFrom": [ "update_by" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.finance_record": { "name": "finance_record", "schema": "", "columns": { "id": { "name": "id", "type": "bigint", "primaryKey": true, "notNull": true }, "category_id": { "name": "category_id", "type": "bigint", "primaryKey": false, "notNull": true }, "space_id": { "name": "space_id", "type": "bigint", "primaryKey": false, "notNull": true }, "amount": { "name": "amount", "type": "numeric(12, 2)", "primaryKey": false, "notNull": true }, "remark": { "name": "remark", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "record_time": { "name": "record_time", "type": "date", "primaryKey": false, "notNull": false }, "create_by": { "name": "create_by", "type": "bigint", "primaryKey": false, "notNull": true }, "create_time": { "name": "create_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" }, "update_by": { "name": "update_by", "type": "bigint", "primaryKey": false, "notNull": true }, "update_time": { "name": "update_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "finance_record_category_id_finance_category_space_id_fk": { "name": "finance_record_category_id_finance_category_space_id_fk", "tableFrom": "finance_record", "tableTo": "finance_category_space", "columnsFrom": [ "category_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "finance_record_space_id_space_id_fk": { "name": "finance_record_space_id_space_id_fk", "tableFrom": "finance_record", "tableTo": "space", "columnsFrom": [ "space_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "finance_record_create_by_user_id_fk": { "name": "finance_record_create_by_user_id_fk", "tableFrom": "finance_record", "tableTo": "user", "columnsFrom": [ "create_by" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "finance_record_update_by_user_id_fk": { "name": "finance_record_update_by_user_id_fk", "tableFrom": "finance_record", "tableTo": "user", "columnsFrom": [ "update_by" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.session": { "name": "session", "schema": "", "columns": { "id": { "name": "id", "type": "bigint", "primaryKey": true, "notNull": true }, "space_id": { "name": "space_id", "type": "bigint", "primaryKey": false, "notNull": true }, "type": { "name": "type", "type": "smallint", "primaryKey": false, "notNull": true, "default": 0 }, "name": { "name": "name", "type": "varchar(64)", "primaryKey": false, "notNull": false }, "avatar": { "name": "avatar", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "description": { "name": "description", "type": "text", "primaryKey": false, "notNull": false }, "status": { "name": "status", "type": "smallint", "primaryKey": false, "notNull": true, "default": 0 }, "create_time": { "name": "create_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" }, "update_time": { "name": "update_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "session_space_id_space_id_fk": { "name": "session_space_id_space_id_fk", "tableFrom": "session", "tableTo": "space", "columnsFrom": [ "space_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.session_member": { "name": "session_member", "schema": "", "columns": { "id": { "name": "id", "type": "bigint", "primaryKey": true, "notNull": true }, "session_id": { "name": "session_id", "type": "bigint", "primaryKey": false, "notNull": true }, "user_id": { "name": "user_id", "type": "bigint", "primaryKey": false, "notNull": true }, "remark": { "name": "remark", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "is_top": { "name": "is_top", "type": "smallint", "primaryKey": false, "notNull": true, "default": 0 }, "unread_count": { "name": "unread_count", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "last_msg_id": { "name": "last_msg_id", "type": "bigint", "primaryKey": false, "notNull": false }, "status": { "name": "status", "type": "integer", "primaryKey": false, "notNull": false, "default": 0 }, "create_time": { "name": "create_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" }, "update_time": { "name": "update_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "session_member_session_id_session_id_fk": { "name": "session_member_session_id_session_id_fk", "tableFrom": "session_member", "tableTo": "session", "columnsFrom": [ "session_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "session_member_user_id_user_id_fk": { "name": "session_member_user_id_user_id_fk", "tableFrom": "session_member", "tableTo": "user", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "session_member_last_msg_id_session_message_id_fk": { "name": "session_member_last_msg_id_session_message_id_fk", "tableFrom": "session_member", "tableTo": "session_message", "columnsFrom": [ "last_msg_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.session_message": { "name": "session_message", "schema": "", "columns": { "id": { "name": "id", "type": "bigint", "primaryKey": true, "notNull": true }, "session_id": { "name": "session_id", "type": "bigint", "primaryKey": false, "notNull": true }, "sender_id": { "name": "sender_id", "type": "bigint", "primaryKey": false, "notNull": true }, "content": { "name": "content", "type": "text", "primaryKey": false, "notNull": true }, "content_type": { "name": "content_type", "type": "smallint", "primaryKey": false, "notNull": true, "default": 0 }, "create_time": { "name": "create_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "session_message_session_id_session_id_fk": { "name": "session_message_session_id_session_id_fk", "tableFrom": "session_message", "tableTo": "session", "columnsFrom": [ "session_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "session_message_sender_id_user_id_fk": { "name": "session_message_sender_id_user_id_fk", "tableFrom": "session_message", "tableTo": "user", "columnsFrom": [ "sender_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.space": { "name": "space", "schema": "", "columns": { "id": { "name": "id", "type": "bigint", "primaryKey": true, "notNull": true }, "name": { "name": "name", "type": "varchar(255)", "primaryKey": false, "notNull": true }, "invite_code": { "name": "invite_code", "type": "varchar(30)", "primaryKey": false, "notNull": true }, "owner_id": { "name": "owner_id", "type": "bigint", "primaryKey": false, "notNull": true }, "create_time": { "name": "create_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" }, "update_time": { "name": "update_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "space_owner_id_user_id_fk": { "name": "space_owner_id_user_id_fk", "tableFrom": "space", "tableTo": "user", "columnsFrom": [ "owner_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.space_member": { "name": "space_member", "schema": "", "columns": { "id": { "name": "id", "type": "bigint", "primaryKey": true, "notNull": true }, "space_id": { "name": "space_id", "type": "bigint", "primaryKey": false, "notNull": true }, "user_id": { "name": "user_id", "type": "bigint", "primaryKey": false, "notNull": true }, "role": { "name": "role", "type": "smallint", "primaryKey": false, "notNull": true, "default": 2 }, "join_time": { "name": "join_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" }, "update_time": { "name": "update_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "space_member_space_id_space_id_fk": { "name": "space_member_space_id_space_id_fk", "tableFrom": "space_member", "tableTo": "space", "columnsFrom": [ "space_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "space_member_user_id_user_id_fk": { "name": "space_member_user_id_user_id_fk", "tableFrom": "space_member", "tableTo": "user", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.user": { "name": "user", "schema": "", "columns": { "id": { "name": "id", "type": "bigint", "primaryKey": true, "notNull": true }, "nickname": { "name": "nickname", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "avatar": { "name": "avatar", "type": "varchar(255)", "primaryKey": false, "notNull": false }, "status": { "name": "status", "type": "smallint", "primaryKey": false, "notNull": true, "default": 0 }, "last_login_time": { "name": "last_login_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false }, "create_time": { "name": "create_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" }, "update_time": { "name": "update_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false }, "public.user_oauth": { "name": "user_oauth", "schema": "", "columns": { "id": { "name": "id", "type": "bigint", "primaryKey": true, "notNull": true }, "user_id": { "name": "user_id", "type": "bigint", "primaryKey": false, "notNull": true }, "type": { "name": "type", "type": "smallint", "primaryKey": false, "notNull": true, "default": 0 }, "openid": { "name": "openid", "type": "varchar(255)", "primaryKey": false, "notNull": true }, "create_time": { "name": "create_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" }, "update_time": { "name": "update_time", "type": "timestamp with time zone", "primaryKey": false, "notNull": false, "default": "now()" } }, "indexes": {}, "foreignKeys": { "user_oauth_user_id_user_id_fk": { "name": "user_oauth_user_id_user_id_fk", "tableFrom": "user_oauth", "tableTo": "user", "columnsFrom": [ "user_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "policies": {}, "checkConstraints": {}, "isRLSEnabled": false } }, "enums": {}, "schemas": {}, "sequences": {}, "roles": {}, "policies": {}, "views": {}, "_meta": { "columns": {}, "schemas": {}, "tables": {} } }