mirror of
https://github.com/optim-enterprises-bv/Mailu.git
synced 2025-11-02 11:08:01 +00:00
Implement CIText as NOCASE alternative in postgresql
This commit is contained in:
@@ -7,7 +7,7 @@ RUN apk add --no-cache \
|
||||
RUN pip3 install jinja2
|
||||
# Image specific layers under this line
|
||||
RUN apk add --no-cache \
|
||||
postgresql postgresql-libs \
|
||||
postgresql postgresql-libs postgresql-contrib \
|
||||
&& apk add --virtual .build-deps gcc musl-dev postgresql-dev python3-dev \
|
||||
&& pip3 install psycopg2 anosql \
|
||||
&& apk --purge del .build-deps
|
||||
|
||||
@@ -34,3 +34,10 @@ select 1
|
||||
create
|
||||
database mailu
|
||||
owner mailu;
|
||||
|
||||
-- name: create_citext!
|
||||
-- Install the CIText extension
|
||||
create
|
||||
extension
|
||||
if not exists
|
||||
citext;
|
||||
|
||||
@@ -7,7 +7,7 @@ import glob
|
||||
import os
|
||||
|
||||
def setup():
|
||||
conn = psycopg2.connect('user=postgres')
|
||||
conn = psycopg2.connect(user = 'postgres')
|
||||
queries = anosql.load_queries('postgres', '/conf/queries.sql')
|
||||
# Mailu user
|
||||
queries.create_mailu_user(conn)
|
||||
@@ -21,6 +21,10 @@ def setup():
|
||||
queries.create_db(conn)
|
||||
conn.set_isolation_level(1)
|
||||
conn.close()
|
||||
conn = psycopg2.connect(user = 'postgres', database= 'mailu')
|
||||
queries.create_citext(conn)
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
# Bootstrap the database if postgresql is running for the first time
|
||||
if not os.path.exists('/var/lib/postgresql/data/pg_wal'):
|
||||
|
||||
Reference in New Issue
Block a user