This commit is contained in:
@@ -42,6 +42,11 @@ jobs:
|
||||
--from-literal=SECRET_KEY_BASE=$(openssl rand -hex 64) \
|
||||
--from-literal=AI_TOKEN="$AI_TOKEN"
|
||||
|
||||
kubectl create configmap db-schema \
|
||||
--from-file=schema.sql=schema.sql \
|
||||
--namespace ai-ha-elixir \
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
for file in kubernetes/*.yml; do
|
||||
cat "$file" | envsubst | kubectl apply -f -
|
||||
done
|
||||
|
||||
@@ -25,6 +25,10 @@ spec:
|
||||
value: "elixir_ai"
|
||||
- name: POSTGRES_DB
|
||||
value: "elixir_ai"
|
||||
volumeMounts:
|
||||
- name: schema
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
readOnly: true
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: ["pg_isready", "-U", "elixir_ai"]
|
||||
@@ -37,6 +41,10 @@ spec:
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
volumes:
|
||||
- name: schema
|
||||
configMap:
|
||||
name: db-schema
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
CREATE TABLE conversations (
|
||||
CREATE TABLE IF NOT EXISTS conversations (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
name TEXT NOT NULL UNIQUE,
|
||||
inserted_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE TABLE messages (
|
||||
CREATE TABLE IF NOT EXISTS messages (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
conversation_id UUID NOT NULL REFERENCES conversations(id) ON DELETE CASCADE,
|
||||
role TEXT NOT NULL CHECK (role IN ('user', 'assistant', 'tool')),
|
||||
|
||||
Reference in New Issue
Block a user