feat(workflow): implement target channel personalities, raw review cards, on-demand AI rewrites and multi-target dispatch
This commit is contained in:
+10
-1
@@ -1,5 +1,6 @@
|
||||
import asyncpg
|
||||
import os
|
||||
import json
|
||||
from typing import Optional
|
||||
|
||||
DATABASE_URL = os.getenv(
|
||||
@@ -23,6 +24,8 @@ CREATE TABLE IF NOT EXISTS targets (
|
||||
title VARCHAR(255),
|
||||
username VARCHAR(255),
|
||||
post_interval_min INT DEFAULT 30,
|
||||
personality TEXT DEFAULT '',
|
||||
custom_footer TEXT DEFAULT '',
|
||||
last_post_time TIMESTAMPTZ,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
|
||||
@@ -44,7 +47,8 @@ CREATE TABLE IF NOT EXISTS posts (
|
||||
ai_text TEXT,
|
||||
suggested_target_id INT REFERENCES targets(id) ON DELETE SET NULL,
|
||||
target_channel_id INT REFERENCES targets(id) ON DELETE SET NULL,
|
||||
status VARCHAR(32) DEFAULT 'pending_ai',
|
||||
status VARCHAR(32) DEFAULT 'pending_review',
|
||||
published_to JSONB DEFAULT '[]'::jsonb,
|
||||
review_message_id BIGINT,
|
||||
scheduled_at TIMESTAMPTZ,
|
||||
published_at TIMESTAMPTZ,
|
||||
@@ -63,6 +67,11 @@ CREATE TABLE IF NOT EXISTS settings (
|
||||
value TEXT NOT NULL,
|
||||
description TEXT
|
||||
);
|
||||
|
||||
-- Migration safety for existing tables
|
||||
ALTER TABLE targets ADD COLUMN IF NOT EXISTS personality TEXT DEFAULT '';
|
||||
ALTER TABLE targets ADD COLUMN IF NOT EXISTS custom_footer TEXT DEFAULT '';
|
||||
ALTER TABLE posts ADD COLUMN IF NOT EXISTS published_to JSONB DEFAULT '[]'::jsonb;
|
||||
"""
|
||||
|
||||
_pool: Optional[asyncpg.Pool] = None
|
||||
|
||||
Reference in New Issue
Block a user