Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lambda/init_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ def lambda_handler(event, context):
file_path="init_status_db.sql"
)

# Execute the new video workflow initialization SQL against video_status
_execute_sql_file(
conn=psycopg2.connect(
host=db_host,
port=db_port,
database="video_status",
user=db_user,
password=db_password,
),
file_path="init_video_workflow_db.sql"
)

_execute_sql_file(
conn=psycopg2.connect(
host=db_host,
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ output "video_processor_ecr_repository_uri" {
description = "URI of the Video Processor ECR public repository"
value = aws_ecrpublic_repository.video_processor.repository_uri
}

output "ecr_public_alias" {
description = "Public ECR registry alias (used to form public.ecr.aws/<alias>/...). Exposed so CI can use it as ECR_PUBLIC_ALIAS."
value = split("/", aws_ecrpublic_repository.video_processor.repository_uri)[1]
}
26 changes: 26 additions & 0 deletions scripts/init_video_workflow_db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-- Cria a tabela de workflow de vídeos e índices associados
CREATE EXTENSION IF NOT EXISTS pgcrypto;

CREATE TABLE IF NOT EXISTS tb_video_workflow (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id VARCHAR(255) NOT NULL,
video_id VARCHAR(255) NOT NULL,
upload_path VARCHAR(500) NOT NULL,
output_path VARCHAR(500),
status VARCHAR(50) NOT NULL,
error_message VARCHAR(255),
uploaded_at TIMESTAMP,
processed_at TIMESTAMP,
last_updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Índices importantes
CREATE INDEX IF NOT EXISTS idx_workflow_status
ON tb_video_workflow(status);

CREATE INDEX IF NOT EXISTS idx_workflow_video_id
ON tb_video_workflow(video_id);

CREATE INDEX IF NOT EXISTS idx_workflow_user_id
ON tb_video_workflow(user_id);