diff --git a/scripts/database/6.0.sql b/scripts/database/6.0.sql index 1018eb37b..bc48f79b9 100644 --- a/scripts/database/6.0.sql +++ b/scripts/database/6.0.sql @@ -1,4 +1,16 @@ -- Optimized database schema +-- Add organizations table +CREATE TABLE IF NOT EXISTS organizations ( + org_id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + name VARCHAR(255) NOT NULL, + slug VARCHAR(255) UNIQUE NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +-- Create indexes for better performance +CREATE INDEX IF NOT EXISTS idx_organizations_slug ON organizations(slug); +CREATE INDEX IF NOT EXISTS idx_organizations_created_at ON organizations(created_at); -- Core tables CREATE TABLE IF NOT EXISTS users ( diff --git a/scripts/dev/build_fix.sh b/scripts/dev/build_fix.sh new file mode 100755 index 000000000..0823ef877 --- /dev/null +++ b/scripts/dev/build_fix.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" +OUTPUT_FILE="$SCRIPT_DIR/prompt.txt" + +echo "Consolidated LLM Context" > "$OUTPUT_FILE" + +prompts=( + "../../prompts/dev/general.md" + "../../Cargo.toml" + "../../prompts/dev/fix.md" +) + +for file in "${prompts[@]}"; do + cat "$file" >> "$OUTPUT_FILE" + echo "" >> "$OUTPUT_FILE" +done + +dirs=( + "auth" + "automation" + "basic" + "bot" + "channels" + "chart" + "config" + "context" + "email" + "file" + "llm" + "llm_legacy" + "org" + "session" + "shared" + "tests" + "tools" + "web_automation" + "whatsapp" +) + +for dir in "${dirs[@]}"; do + find "$PROJECT_ROOT/src/$dir" -name "*.rs" | while read file; do + cat "$file" >> "$OUTPUT_FILE" + echo "" >> "$OUTPUT_FILE" + done +done + +cat "$PROJECT_ROOT/src/main.rs" >> "$OUTPUT_FILE" +echo "" >> "$OUTPUT_FILE" + + +cd "$PROJECT_ROOT" +tree -P '*.rs' -I 'target|*.lock' --prune | grep -v '[0-9] directories$' >> "$OUTPUT_FILE" + + +cargo build 2>> "$OUTPUT_FILE" diff --git a/src/main.rs b/src/main.rs index d8aa175ab..0c5958075 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + use actix_cors::Cors; use actix_web::middleware::Logger; use actix_web::{web, App, HttpServer}; diff --git a/src/org/mod.rs b/src/org/mod.rs index 6669eee91..c7e93529b 100644 --- a/src/org/mod.rs +++ b/src/org/mod.rs @@ -35,7 +35,7 @@ impl OrganizationService { pub async fn get_organization( &self, - org_id: Uuid, + _org_id: Uuid, ) -> Result, Box> { Ok(None) }