mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-15 20:08:18 +08:00
fix(db): store JSON columns as TEXT in the PostgreSQL-family tree
This commit is contained in:
parent
f3119e0217
commit
1ac1df12bf
@ -3,5 +3,5 @@
|
|||||||
-- See h2/V129__wiki_page_broken_links.sql for column semantics.
|
-- See h2/V129__wiki_page_broken_links.sql for column semantics.
|
||||||
-- KingbaseES (PostgreSQL) supports ADD COLUMN IF NOT EXISTS natively.
|
-- KingbaseES (PostgreSQL) supports ADD COLUMN IF NOT EXISTS natively.
|
||||||
|
|
||||||
ALTER TABLE mate_wiki_page ADD COLUMN IF NOT EXISTS broken_links JSONB DEFAULT NULL;
|
ALTER TABLE mate_wiki_page ADD COLUMN IF NOT EXISTS broken_links TEXT DEFAULT NULL;
|
||||||
ALTER TABLE mate_wiki_page ADD COLUMN IF NOT EXISTS broken_links_scanned_at TIMESTAMP(3) DEFAULT NULL;
|
ALTER TABLE mate_wiki_page ADD COLUMN IF NOT EXISTS broken_links_scanned_at TIMESTAMP(3) DEFAULT NULL;
|
||||||
|
|||||||
@ -14,6 +14,6 @@ BEGIN
|
|||||||
SELECT 1 FROM information_schema.columns
|
SELECT 1 FROM information_schema.columns
|
||||||
WHERE table_name = 'mate_agent_goal' AND column_name = 'criteria'
|
WHERE table_name = 'mate_agent_goal' AND column_name = 'criteria'
|
||||||
) THEN
|
) THEN
|
||||||
ALTER TABLE mate_agent_goal ADD COLUMN criteria JSON NULL;
|
ALTER TABLE mate_agent_goal ADD COLUMN criteria TEXT NULL;
|
||||||
END IF;
|
END IF;
|
||||||
END $$;
|
END $$;
|
||||||
|
|||||||
@ -177,7 +177,7 @@ CREATE TABLE IF NOT EXISTS mate_message (
|
|||||||
runtime_model VARCHAR(128),
|
runtime_model VARCHAR(128),
|
||||||
runtime_provider VARCHAR(64),
|
runtime_provider VARCHAR(64),
|
||||||
status VARCHAR(32) NOT NULL DEFAULT 'completed',
|
status VARCHAR(32) NOT NULL DEFAULT 'completed',
|
||||||
metadata JSONB,
|
metadata TEXT,
|
||||||
create_time TIMESTAMP NOT NULL,
|
create_time TIMESTAMP NOT NULL,
|
||||||
update_time TIMESTAMP NOT NULL,
|
update_time TIMESTAMP NOT NULL,
|
||||||
deleted INT NOT NULL DEFAULT 0
|
deleted INT NOT NULL DEFAULT 0
|
||||||
|
|||||||
@ -3,4 +3,4 @@
|
|||||||
-- Dual-written alongside the existing source_raw_ids for backwards compatibility.
|
-- Dual-written alongside the existing source_raw_ids for backwards compatibility.
|
||||||
-- KingbaseES (PostgreSQL) supports ADD COLUMN IF NOT EXISTS natively.
|
-- KingbaseES (PostgreSQL) supports ADD COLUMN IF NOT EXISTS natively.
|
||||||
|
|
||||||
ALTER TABLE mate_wiki_page ADD COLUMN IF NOT EXISTS source_entries JSONB NULL;
|
ALTER TABLE mate_wiki_page ADD COLUMN IF NOT EXISTS source_entries TEXT NULL;
|
||||||
|
|||||||
@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS mate_wiki_relation (
|
|||||||
page_b_id BIGINT NOT NULL,
|
page_b_id BIGINT NOT NULL,
|
||||||
|
|
||||||
total_score DECIMAL(8, 4),
|
total_score DECIMAL(8, 4),
|
||||||
signals_json JSONB,
|
signals_json TEXT,
|
||||||
|
|
||||||
type VARCHAR(32),
|
type VARCHAR(32),
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user