From 70fbdac34f9fbc45425e29ac3151277ed6a191a3 Mon Sep 17 00:00:00 2001 From: guopengfa Date: Mon, 19 Jan 2026 16:50:17 +0800 Subject: [PATCH 1/4] capture signal error. --- backend_api_python/app/services/signal_notifier.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend_api_python/app/services/signal_notifier.py b/backend_api_python/app/services/signal_notifier.py index 8f4175348..22a0e7bf1 100644 --- a/backend_api_python/app/services/signal_notifier.py +++ b/backend_api_python/app/services/signal_notifier.py @@ -231,6 +231,7 @@ def notify_signal( else: ok, err = False, f"unsupported_channel:{c}" except Exception as e: + logger.error(rf'signal notify error: {traceback.format_exc()}') ok, err = False, str(e) results[c] = {"ok": bool(ok), "error": (err or "")} From 978e562009c6b60114465deee41a0c3331e40a3b Mon Sep 17 00:00:00 2001 From: guopengfa Date: Sat, 31 Jan 2026 20:13:24 +0800 Subject: [PATCH 2/4] qd_indicator_codes add column. --- backend_api_python/migrations/init.sql | 54 ++++++++++++++------------ 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/backend_api_python/migrations/init.sql b/backend_api_python/migrations/init.sql index a8cfaadde..aec68e9fe 100644 --- a/backend_api_python/migrations/init.sql +++ b/backend_api_python/migrations/init.sql @@ -275,32 +275,36 @@ CREATE INDEX IF NOT EXISTS idx_notifications_is_read ON qd_strategy_notification -- 7. Indicator Codes -- ============================================================================= -CREATE TABLE IF NOT EXISTS qd_indicator_codes ( - id SERIAL PRIMARY KEY, - user_id INTEGER NOT NULL DEFAULT 1 REFERENCES qd_users(id) ON DELETE CASCADE, - is_buy INTEGER NOT NULL DEFAULT 0, - end_time BIGINT NOT NULL DEFAULT 1, - name VARCHAR(255) NOT NULL DEFAULT '', - code TEXT, - description TEXT DEFAULT '', - publish_to_community INTEGER NOT NULL DEFAULT 0, - pricing_type VARCHAR(20) NOT NULL DEFAULT 'free', - price DECIMAL(10,2) NOT NULL DEFAULT 0, - is_encrypted INTEGER NOT NULL DEFAULT 0, - preview_image VARCHAR(500) DEFAULT '', - -- Review status fields (for admin review feature) - review_status VARCHAR(20) DEFAULT 'approved', -- pending/approved/rejected - review_note TEXT DEFAULT '', - reviewed_at TIMESTAMP, - reviewed_by INTEGER, - createtime BIGINT, - updatetime BIGINT, - created_at TIMESTAMP DEFAULT NOW(), - updated_at TIMESTAMP DEFAULT NOW() +CREATE TABLE public.qd_indicator_codes ( + id serial4 NOT NULL, + user_id int4 DEFAULT 1 NOT NULL, + is_buy int4 DEFAULT 0 NOT NULL, + end_time int8 DEFAULT 1 NOT NULL, + name varchar(255) DEFAULT ''::character varying NOT NULL, + code text NULL, + description text DEFAULT ''::text NULL, + publish_to_community int4 DEFAULT 0 NOT NULL, + pricing_type varchar(20) DEFAULT 'free'::character varying NOT NULL, + price numeric(10, 2) DEFAULT 0 NOT NULL, + is_encrypted int4 DEFAULT 0 NOT NULL, + preview_image varchar(500) DEFAULT ''::character varying NULL, + createtime int8 NULL, + updatetime int8 NULL, + created_at timestamp DEFAULT now(), + updated_at timestamp DEFAULT now(), + purchase_count int4 DEFAULT 0 NULL, + avg_rating numeric(3, 2) DEFAULT 0 NULL, + rating_count int4 DEFAULT 0 NULL, + view_count int4 DEFAULT 0 NULL, + review_status varchar(20) DEFAULT 'approved'::character varying NULL, + review_note text DEFAULT ''::text NULL, + reviewed_at timestamp NULL, + reviewed_by int4 NULL, + CONSTRAINT qd_indicator_codes_pkey PRIMARY KEY (id), + CONSTRAINT qd_indicator_codes_user_id_fkey FOREIGN KEY (user_id) REFERENCES qd_users(id) ON DELETE CASCADE ); - -CREATE INDEX IF NOT EXISTS idx_indicator_codes_user_id ON qd_indicator_codes(user_id); -CREATE INDEX IF NOT EXISTS idx_indicator_review_status ON qd_indicator_codes(review_status); +CREATE INDEX idx_indicator_codes_user_id ON public.qd_indicator_codes USING btree (user_id); +CREATE INDEX idx_indicator_review_status ON public.qd_indicator_codes USING btree (review_status); -- ============================================================================= -- 8. AI Decisions From 15e5e380e9765225822e417ff11089801dc74313 Mon Sep 17 00:00:00 2001 From: guopengfa Date: Sat, 31 Jan 2026 20:31:43 +0800 Subject: [PATCH 3/4] qd_indicator_codes add column. --- backend_api_python/app/services/signal_notifier.py | 1 - backend_api_python/migrations/init.sql | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend_api_python/app/services/signal_notifier.py b/backend_api_python/app/services/signal_notifier.py index 22a0e7bf1..8f4175348 100644 --- a/backend_api_python/app/services/signal_notifier.py +++ b/backend_api_python/app/services/signal_notifier.py @@ -231,7 +231,6 @@ def notify_signal( else: ok, err = False, f"unsupported_channel:{c}" except Exception as e: - logger.error(rf'signal notify error: {traceback.format_exc()}') ok, err = False, str(e) results[c] = {"ok": bool(ok), "error": (err or "")} diff --git a/backend_api_python/migrations/init.sql b/backend_api_python/migrations/init.sql index aec68e9fe..96a221b8e 100644 --- a/backend_api_python/migrations/init.sql +++ b/backend_api_python/migrations/init.sql @@ -275,7 +275,7 @@ CREATE INDEX IF NOT EXISTS idx_notifications_is_read ON qd_strategy_notification -- 7. Indicator Codes -- ============================================================================= -CREATE TABLE public.qd_indicator_codes ( +CREATE TABLE IF NOT EXISTS qd_indicator_codes ( id serial4 NOT NULL, user_id int4 DEFAULT 1 NOT NULL, is_buy int4 DEFAULT 0 NOT NULL, @@ -302,9 +302,11 @@ CREATE TABLE public.qd_indicator_codes ( reviewed_by int4 NULL, CONSTRAINT qd_indicator_codes_pkey PRIMARY KEY (id), CONSTRAINT qd_indicator_codes_user_id_fkey FOREIGN KEY (user_id) REFERENCES qd_users(id) ON DELETE CASCADE + ); -CREATE INDEX idx_indicator_codes_user_id ON public.qd_indicator_codes USING btree (user_id); -CREATE INDEX idx_indicator_review_status ON public.qd_indicator_codes USING btree (review_status); + +CREATE INDEX idx_indicator_codes_user_id ON qd_indicator_codes USING btree (user_id); +CREATE INDEX idx_indicator_review_status ON qd_indicator_codes USING btree (review_status); -- ============================================================================= -- 8. AI Decisions From fbd18851efb77866457f17b46125ae09f018a7f2 Mon Sep 17 00:00:00 2001 From: guopengfa Date: Sat, 31 Jan 2026 20:32:52 +0800 Subject: [PATCH 4/4] qd_indicator_codes add column. --- backend_api_python/migrations/init.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend_api_python/migrations/init.sql b/backend_api_python/migrations/init.sql index 96a221b8e..1d69e79e8 100644 --- a/backend_api_python/migrations/init.sql +++ b/backend_api_python/migrations/init.sql @@ -305,8 +305,8 @@ CREATE TABLE IF NOT EXISTS qd_indicator_codes ( ); -CREATE INDEX idx_indicator_codes_user_id ON qd_indicator_codes USING btree (user_id); -CREATE INDEX idx_indicator_review_status ON qd_indicator_codes USING btree (review_status); +CREATE INDEX IF NOT EXISTS idx_indicator_codes_user_id ON qd_indicator_codes USING btree (user_id); +CREATE INDEX IF NOT EXISTS idx_indicator_review_status ON qd_indicator_codes USING btree (review_status); -- ============================================================================= -- 8. AI Decisions