pit-manager
Version:
Centralized prompt management system for Human Behavior AI agents
54 lines (41 loc) ⢠1.58 kB
text/typescript
/**
* Script to apply the chain execution groups database schema to Supabase.
*/
import dotenv from 'dotenv';
import { SupabaseManager } from '../src/typescript/storage/supabase-client';
async function applySchema() {
// Load environment variables
dotenv.config();
// Check for required environment variables
const supabaseUrl = process.env.PIT_SUPABASE_URL;
const serviceKey = process.env.PIT_SUPABASE_SERVICE_ROLE_KEY;
if (!supabaseUrl || !serviceKey) {
console.log("ā Missing required environment variables:");
console.log(" - PIT_SUPABASE_URL");
console.log(" - PIT_SUPABASE_SERVICE_ROLE_KEY");
return;
}
try {
// Create Supabase manager
const manager = new SupabaseManager(supabaseUrl, serviceKey);
// Get the schema
const schema = manager.getDatabaseSchema();
console.log("š§ Applying Chain Execution Groups Schema to Supabase...");
console.log("=" * 60);
console.log(schema);
console.log("=" * 60);
// Note: This would require direct SQL execution capability
// For now, we'll print the schema for manual application
console.log("\nš To apply this schema:");
console.log("1. Go to your Supabase dashboard");
console.log("2. Navigate to SQL Editor");
console.log("3. Copy and paste the schema above");
console.log("4. Execute the SQL");
console.log("\nā
Schema ready for application!");
} catch (error) {
console.error("ā Error applying schema:", error);
}
}
// Run the script
applySchema();