Enable pgvector in postgres template (#724)
authorRafael dos Santos Silva <xfalcox@gmail.com>
Thu, 13 Jul 2023 18:34:12 +0000 (15:34 -0300)
committerGitHub <noreply@github.com>
Thu, 13 Jul 2023 18:34:12 +0000 (15:34 -0300)
image/discourse_dev/postgres_dev.template.yml
templates/postgres.13.template.yml
templates/postgres.template.yml

index 2092d03e81b0cc216e726362fefe1c746dcce4ef..fd257f2777d7ab3ac94e300b69e13a08cea9a2bb 100644 (file)
@@ -28,18 +28,21 @@ run:
   - exec: su postgres -c 'psql discourse_development -c "alter schema public owner to discourse;"'
   - exec: su postgres -c 'psql discourse_development -c "create extension if not exists hstore;"'
   - exec: su postgres -c 'psql discourse_development -c "create extension if not exists pg_trgm;"'
+  - exec: su postgres -c 'psql discourse_development -c "create extension if not exists vector;"'
 
   - exec: su postgres -c 'createdb discourse_test' || true
   - exec: su postgres -c 'psql discourse_test -c "grant all privileges on database discourse_test to discourse;"' || true
   - exec: su postgres -c 'psql discourse_test -c "alter schema public owner to discourse;"'
   - exec: su postgres -c 'psql discourse_test -c "create extension if not exists hstore;"'
   - exec: su postgres -c 'psql discourse_test -c "create extension if not exists pg_trgm;"'
+  - exec: su postgres -c 'psql discourse_test -c "create extension if not exists vector;"'
 
   - exec: su postgres -c 'createdb discourse_test_multisite' || true
   - exec: su postgres -c 'psql discourse_test_multisite -c "grant all privileges on database discourse_test_multisite to discourse;"' || true
   - exec: su postgres -c 'psql discourse_test_multisite -c "alter schema public owner to discourse;"'
   - exec: su postgres -c 'psql discourse_test_multisite -c "create extension if not exists hstore;"'
   - exec: su postgres -c 'psql discourse_test_multisite -c "create extension if not exists pg_trgm;"'
+  - exec: su postgres -c 'psql discourse_test_multisite -c "create extension if not exists vector;"'
 
   - exec: cd tmp && git clone https://github.com/discourse/discourse.git --depth=1
   - exec: chown -R discourse /tmp/discourse
index a5f13b8953dd02bc15e3ed27f71253c5a1af37aa..bb2c0a232226c901503cd33dbef85ef14b02e48c 100644 (file)
@@ -213,8 +213,10 @@ run:
   - exec: su postgres -c 'psql $db_name -c "alter schema public owner to $db_user;"'
   - exec: su postgres -c 'psql template1 -c "create extension if not exists hstore;"'
   - exec: su postgres -c 'psql template1 -c "create extension if not exists pg_trgm;"'
+  - exec: su postgres -c 'psql template1 -c "create extension if not exists vector;"'
   - exec: su postgres -c 'psql $db_name -c "create extension if not exists hstore;"'
   - exec: su postgres -c 'psql $db_name -c "create extension if not exists pg_trgm;"'
+  - exec: su postgres -c 'psql $db_name -c "create extension if not exists vector;"'
   - exec:
       stdin: |
         update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = '$db_name' AND encoding = pg_char_to_encoding('SQL_ASCII');
index a5f13b8953dd02bc15e3ed27f71253c5a1af37aa..bb2c0a232226c901503cd33dbef85ef14b02e48c 100644 (file)
@@ -213,8 +213,10 @@ run:
   - exec: su postgres -c 'psql $db_name -c "alter schema public owner to $db_user;"'
   - exec: su postgres -c 'psql template1 -c "create extension if not exists hstore;"'
   - exec: su postgres -c 'psql template1 -c "create extension if not exists pg_trgm;"'
+  - exec: su postgres -c 'psql template1 -c "create extension if not exists vector;"'
   - exec: su postgres -c 'psql $db_name -c "create extension if not exists hstore;"'
   - exec: su postgres -c 'psql $db_name -c "create extension if not exists pg_trgm;"'
+  - exec: su postgres -c 'psql $db_name -c "create extension if not exists vector;"'
   - exec:
       stdin: |
         update pg_database set encoding = pg_char_to_encoding('UTF8') where datname = '$db_name' AND encoding = pg_char_to_encoding('SQL_ASCII');