tangled
alpha
login
or
join now
aleeve.dev
/
ott
2
fork
atom
Scalable and distributed custom feed generator, ott - on that topic
2
fork
atom
overview
issues
pulls
pipelines
Make db work in k8s (sort of)
aleeve.dev
5 months ago
0dec8305
07d4d27c
+8
-1
3 changed files
expand all
collapse all
unified
split
crates
ott-db-migration
migrations
003_configure_pgpartman.sql
005_grant_access_to_vec_table.sql
helm
ott
templates
pg_migration.yaml
+1
-1
crates/ott-db-migration/migrations/003_configure_pgpartman.sql
···
2
3
-- Configure pg_partman for the table
4
SELECT create_parent(
5
-
p_parent_table => 'vectors',
6
p_control => 'created_at',
7
p_interval => '30 minutes',
8
p_type => 'range',
···
2
3
-- Configure pg_partman for the table
4
SELECT create_parent(
5
+
p_parent_table => 'public.vectors',
6
p_control => 'created_at',
7
p_interval => '30 minutes',
8
p_type => 'range',
+2
crates/ott-db-migration/migrations/005_grant_access_to_vec_table.sql
···
0
0
···
1
+
GRANT ALL PRIVILEGES ON TABLE public.vectors TO app;
2
+
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO app;
+5
helm/ott/templates/pg_migration.yaml
···
28
key: password
29
- name: DATABASE_URL
30
value: "postgres://$(DATABASE_USER):$(DATABASE_PASSWORD)@postgres-rw.default.svc.cluster.local:5432/app"
0
0
31
command:
32
- /bin/sh
33
- -c
···
41
echo "Attempt $i/30: Database not ready yet, waiting..."
42
sleep 10
43
done
0
0
0
44
45
echo "Setting up migration"
46
./app
···
28
key: password
29
- name: DATABASE_URL
30
value: "postgres://$(DATABASE_USER):$(DATABASE_PASSWORD)@postgres-rw.default.svc.cluster.local:5432/app"
31
+
- name: POSTGRES_URL
32
+
value: "postgres://$(DATABASE_USER):$(DATABASE_PASSWORD)@postgres-rw.default.svc.cluster.local:5432/postgres"
33
command:
34
- /bin/sh
35
- -c
···
43
echo "Attempt $i/30: Database not ready yet, waiting..."
44
sleep 10
45
done
46
+
47
+
echo "Making sure extensions are installed"
48
+
psql "$POSTGRES_URL" -c "CREATE EXTENSION IF NOT EXISTS pg_cron;"
49
50
echo "Setting up migration"
51
./app