Merge pull request #24 from p369349074/main

update indicator code to match new version
This commit is contained in:
Quantdinger
2026-01-31 21:23:10 +08:00
committed by GitHub
+29 -23
View File
@@ -276,31 +276,37 @@ CREATE INDEX IF NOT EXISTS idx_notifications_is_read ON qd_strategy_notification
-- ============================================================================= -- =============================================================================
CREATE TABLE IF NOT EXISTS qd_indicator_codes ( CREATE TABLE IF NOT EXISTS qd_indicator_codes (
id SERIAL PRIMARY KEY, id serial4 NOT NULL,
user_id INTEGER NOT NULL DEFAULT 1 REFERENCES qd_users(id) ON DELETE CASCADE, user_id int4 DEFAULT 1 NOT NULL,
is_buy INTEGER NOT NULL DEFAULT 0, is_buy int4 DEFAULT 0 NOT NULL,
end_time BIGINT NOT NULL DEFAULT 1, end_time int8 DEFAULT 1 NOT NULL,
name VARCHAR(255) NOT NULL DEFAULT '', name varchar(255) DEFAULT ''::character varying NOT NULL,
code TEXT, code text NULL,
description TEXT DEFAULT '', description text DEFAULT ''::text NULL,
publish_to_community INTEGER NOT NULL DEFAULT 0, publish_to_community int4 DEFAULT 0 NOT NULL,
pricing_type VARCHAR(20) NOT NULL DEFAULT 'free', pricing_type varchar(20) DEFAULT 'free'::character varying NOT NULL,
price DECIMAL(10,2) NOT NULL DEFAULT 0, price numeric(10, 2) DEFAULT 0 NOT NULL,
is_encrypted INTEGER NOT NULL DEFAULT 0, is_encrypted int4 DEFAULT 0 NOT NULL,
preview_image VARCHAR(500) DEFAULT '', preview_image varchar(500) DEFAULT ''::character varying NULL,
-- Review status fields (for admin review feature) createtime int8 NULL,
review_status VARCHAR(20) DEFAULT 'approved', -- pending/approved/rejected updatetime int8 NULL,
review_note TEXT DEFAULT '', created_at timestamp DEFAULT now(),
reviewed_at TIMESTAMP, updated_at timestamp DEFAULT now(),
reviewed_by INTEGER, purchase_count int4 DEFAULT 0 NULL,
createtime BIGINT, avg_rating numeric(3, 2) DEFAULT 0 NULL,
updatetime BIGINT, rating_count int4 DEFAULT 0 NULL,
created_at TIMESTAMP DEFAULT NOW(), view_count int4 DEFAULT 0 NULL,
updated_at TIMESTAMP DEFAULT NOW() 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_codes_user_id ON qd_indicator_codes USING btree (user_id);
CREATE INDEX IF NOT EXISTS idx_indicator_review_status ON qd_indicator_codes(review_status); CREATE INDEX IF NOT EXISTS idx_indicator_review_status ON qd_indicator_codes USING btree (review_status);
-- ============================================================================= -- =============================================================================
-- 8. AI Decisions -- 8. AI Decisions