Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(beta)!: release #95

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
df18548
feat(account)!: rename `created` column to `created_at`
dargmuesli Dec 12, 2024
b1e5a6e
Merge pull request #91 from maevsi/feat/cleanup/created-at
dargmuesli Dec 12, 2024
1b96132
chore(release): 5.0.0-beta.1 [skip ci]
semantic-release-bot Dec 12, 2024
92b2ec2
feat(notification)!: align timestamp column name
dargmuesli Dec 12, 2024
97d6119
Merge pull request #94 from maevsi/feat/cleanup/created-at
dargmuesli Dec 12, 2024
c24b0f4
chore(release): 5.0.0-beta.2 [skip ci]
semantic-release-bot Dec 12, 2024
d36d378
feat(timestamp)!: add time zone (#92)
dargmuesli Dec 16, 2024
3a12e60
Merge branch 'master' into beta
dargmuesli Dec 18, 2024
960b978
feat(grafana)!: remove (#107)
dargmuesli Dec 18, 2024
6460b61
Merge branch 'master' into beta
dargmuesli Jan 18, 2025
5a24dfa
feat(extension)!: add postgis (#119)
dargmuesli Jan 19, 2025
49682ae
Merge branch 'master' into beta
dargmuesli Jan 20, 2025
3c616e0
refactor(extension): use schema public (#124)
dargmuesli Jan 22, 2025
4f9e910
Merge branch 'master' into beta
dargmuesli Jan 23, 2025
759c4d4
feat(event): add visibility unlisted (#126)
sthelemann Jan 25, 2025
83533e9
feat(event)!: add full text search (#121)
dargmuesli Jan 25, 2025
8d9a9d1
feat!: add location (#114)
sthelemann Jan 25, 2025
d54b5ca
Merge branch 'master' into beta
dargmuesli Jan 25, 2025
177c5f6
refactor(schema): remove prefix `public` (#128)
dargmuesli Jan 25, 2025
589c2a4
ci: filter out drafts from job optimization (#129)
dargmuesli Jan 25, 2025
7678fea
chore(release): 5.0.0-beta.3 [skip ci]
semantic-release-bot Jan 25, 2025
e5b4a36
fix(location): move test function to appropriate schema (#130)
dargmuesli Jan 26, 2025
071f480
chore(release): 5.0.0-beta.4 [skip ci]
semantic-release-bot Jan 26, 2025
6dea270
test(data): update visibility
dargmuesli Jan 26, 2025
9471b89
refactor: work in feedback
dargmuesli Jan 26, 2025
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: 8BitJonny/[email protected]
with:
filterOutClosed: true
filterOutDraft: true
sha: ${{ github.event.pull_request.head.sha }}
release_semantic_dry:
needs: prepare_jobs
Expand Down
80 changes: 78 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
## [5.0.0-beta.4](https://github.com/maevsi/sqitch/compare/5.0.0-beta.3...5.0.0-beta.4) (2025-01-26)

### Bug Fixes

* **location:** move test function to appropriate schema ([#130](https://github.com/maevsi/sqitch/issues/130)) ([e5b4a36](https://github.com/maevsi/sqitch/commit/e5b4a365eb548f2753394e58da7ea5549b01fe42))

## [5.0.0-beta.3](https://github.com/maevsi/sqitch/compare/5.0.0-beta.2...5.0.0-beta.3) (2025-01-25)

### ⚠ BREAKING CHANGES

* add location (#114)
* **event:** add full text search (#121)
* **extension:** add postgis (#119)
* **grafana:** remove (#107)
* **timestamp:** add time zone (#92)

### Features

* **account:** add login using email address ([#112](https://github.com/maevsi/sqitch/issues/112)) ([937d255](https://github.com/maevsi/sqitch/commit/937d255ab04313442f173804f2fd87f817249f81))
* **account:** add possibility to block ([#73](https://github.com/maevsi/sqitch/issues/73)) ([4ab872e](https://github.com/maevsi/sqitch/commit/4ab872eef7c165605f1070636e1050f3a876e51a))
* **achievement:** add early bird achievement ([#111](https://github.com/maevsi/sqitch/issues/111)) ([0238bea](https://github.com/maevsi/sqitch/commit/0238bea39fc942bd49c894eb57214534a01db0a1))
* add language enumeration ([76a1465](https://github.com/maevsi/sqitch/commit/76a1465f219c4c0171aafcac1bbbac16580d9691))
* add location ([#114](https://github.com/maevsi/sqitch/issues/114)) ([8d9a9d1](https://github.com/maevsi/sqitch/commit/8d9a9d1580d6e1c9f9ed1c419350dad57e4fabd9))
* **contact:** add language ([669570f](https://github.com/maevsi/sqitch/commit/669570f6322aa8ad971990b2de9fcf8afdf14007))
* **contact:** add nickname ([8b7169a](https://github.com/maevsi/sqitch/commit/8b7169a856b5e81ebb0676ac7de6ce512a83d548))
* **contact:** add timezone ([02da0f9](https://github.com/maevsi/sqitch/commit/02da0f9cdb644ef78c5c6a4b354d2bd968904337))
* **event_upload:** adjust policies. ([23eb8f4](https://github.com/maevsi/sqitch/commit/23eb8f4fbc169117e928c3b75a33635d7d970ff3))
* **event-category-mapping:** check if invited ([4ba7dac](https://github.com/maevsi/sqitch/commit/4ba7dac31bb06937cf01829db9e58d98e9a9c723))
* **event:** add full text search ([#121](https://github.com/maevsi/sqitch/issues/121)) ([83533e9](https://github.com/maevsi/sqitch/commit/83533e92951db2315fbc689cd1c6e7270d7b06eb))
* **event:** add visibility unlisted ([#126](https://github.com/maevsi/sqitch/issues/126)) ([759c4d4](https://github.com/maevsi/sqitch/commit/759c4d43f4a3338dce8d55c1eaa347b34edf4ede))
* **event:** assign images to events ([f4822f8](https://github.com/maevsi/sqitch/commit/f4822f8252089929dea47f3585737d49b19b7c30))
* **event:** mark events as favourite ([#109](https://github.com/maevsi/sqitch/issues/109)) ([7b75524](https://github.com/maevsi/sqitch/commit/7b75524def9ab2575db922567e9d6db87ef3a929))
* **extension:** add postgis ([#119](https://github.com/maevsi/sqitch/issues/119)) ([5a24dfa](https://github.com/maevsi/sqitch/commit/5a24dfaf542a1045fbd8ff0ee7a678ee44ad501f))
* **grafana:** remove ([#107](https://github.com/maevsi/sqitch/issues/107)) ([960b978](https://github.com/maevsi/sqitch/commit/960b97899d8b55cd1b1ef9aad9065c4b1b7f9118))
* **invitation:** add update metadata ([f493fe4](https://github.com/maevsi/sqitch/commit/f493fe4d6c5e5127a0cad253768c864fcdfe296b))
* **invitation:** column names prefixed ([2e29431](https://github.com/maevsi/sqitch/commit/2e294319a7b651deb1b472953ebb3ee770c5a5c6))
* **invitation:** provide flattened invitations ([119b0dd](https://github.com/maevsi/sqitch/commit/119b0dd3c7337db9688a78778eb8a9484e6d3785))
* **policy:** add policy to recommendation tables ([280f47b](https://github.com/maevsi/sqitch/commit/280f47b8fd93ee871f2bd25ba2daeaf5e496b84f))
* **recommendation:** add enum and tables needed for event recommendation ([7fb5e21](https://github.com/maevsi/sqitch/commit/7fb5e21f28fc70ea7bcbb6e764cd54cb5f0a899b))
* **recommendation:** several modifications to db schema ([8581ad0](https://github.com/maevsi/sqitch/commit/8581ad091bea58ff33fab8a31e1c9e8fd2f2c430))
* **revert:** add revert for recommendation tables ([cff0b7f](https://github.com/maevsi/sqitch/commit/cff0b7fdef045ac3f388553f7c4bbffb3a019c78))
* **schema:** fix small errors and build schema ([3183da0](https://github.com/maevsi/sqitch/commit/3183da01587f4b83e646a5158cb8fba42f44a7ff))
* **table:** add creation timestamps ([d8d142d](https://github.com/maevsi/sqitch/commit/d8d142d8d1b12ae4890b97f60fc2daf7eb20fe96))
* **timestamp:** add time zone ([#92](https://github.com/maevsi/sqitch/issues/92)) ([d36d378](https://github.com/maevsi/sqitch/commit/d36d3786a6eed54feb64f8ace35e42f925d78302))
* **verify:** add verification for event recommendation tables ([1d6bb59](https://github.com/maevsi/sqitch/commit/1d6bb59a8cd21b4b3bc1c8a48161b3d3ff6226a3))

### Bug Fixes

* **account-block:** remove bug in function, create new table function ([#125](https://github.com/maevsi/sqitch/issues/125)) ([35b22b4](https://github.com/maevsi/sqitch/commit/35b22b4a1530e6cb95687578c0725428e243b4cd))
* **build:** commit forgotten files ([d554d0f](https://github.com/maevsi/sqitch/commit/d554d0fe33d903da55a1b14ff9b35772ebad867b))
* **event-upload:** work in feedback ([678ddfc](https://github.com/maevsi/sqitch/commit/678ddfce330171ab340bd112f2734d1ab304559b))
* **invitation-flat:** work in feedback ([6ac75ac](https://github.com/maevsi/sqitch/commit/6ac75ac03d73bdf6daed20e3bf47668fe9a45e22))
* **invoker-account-id:** grant execute for tusd ([#123](https://github.com/maevsi/sqitch/issues/123)) ([7245225](https://github.com/maevsi/sqitch/commit/7245225527b7f98a76d881863c574c862254defd))
* **legal-term-acceptance:** omit update and delete ([555e031](https://github.com/maevsi/sqitch/commit/555e031c96e3a83ae41e3b03dd5c2de72e51780f))
* omit update for creation timestamps ([084ad1e](https://github.com/maevsi/sqitch/commit/084ad1e7f89dfcfd890fde76f3d5baa9dffe1cd8))
* **policy:** fix user check in event category mapping policy ([3dfd96a](https://github.com/maevsi/sqitch/commit/3dfd96ab1949933b6326e1762ee6461ff39eda60))
* **role:** drop before creation ([#106](https://github.com/maevsi/sqitch/issues/106)) ([fecd16e](https://github.com/maevsi/sqitch/commit/fecd16ea860a18f0cfdaa7f0118899acf4133cce))
* schedule release ([6e32e10](https://github.com/maevsi/sqitch/commit/6e32e10a00373c9d88d843db73038d438b130364))
* schedule release ([7dbc9bb](https://github.com/maevsi/sqitch/commit/7dbc9bbe6c23449418012ed2eb439df4400749bf))
* **schema:** remove table prefix so schema can be build ([cc5be2d](https://github.com/maevsi/sqitch/commit/cc5be2d7f0db3a251337325ec0b3aa822d0f8482))

## [5.0.0-beta.2](https://github.com/maevsi/sqitch/compare/5.0.0-beta.1...5.0.0-beta.2) (2024-12-12)
## [4.13.2](https://github.com/maevsi/sqitch/compare/4.13.1...4.13.2) (2025-01-25)

### Bug Fixes
Expand All @@ -6,9 +68,23 @@

## [4.13.1](https://github.com/maevsi/sqitch/compare/4.13.0...4.13.1) (2025-01-22)

### Bug Fixes
### ⚠ BREAKING CHANGES

* **invoker-account-id:** grant execute for tusd ([#123](https://github.com/maevsi/sqitch/issues/123)) ([7245225](https://github.com/maevsi/sqitch/commit/7245225527b7f98a76d881863c574c862254defd))
* **notification:** align timestamp column name

### Features

* **notification:** align timestamp column name ([92b2ec2](https://github.com/maevsi/sqitch/commit/92b2ec28752a96b70d4a51256959032074259b6d))

## [5.0.0-beta.1](https://github.com/maevsi/sqitch/compare/4.3.1...5.0.0-beta.1) (2024-12-12)

### ⚠ BREAKING CHANGES

* **account:** rename `created` column to `created_at`

### Features

* **account:** rename `created` column to `created_at` ([df18548](https://github.com/maevsi/sqitch/commit/df18548e11871a22271fa9d131a0538782c1e51b))

## [4.13.0](https://github.com/maevsi/sqitch/compare/4.12.0...4.13.0) (2025-01-16)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@maevsi/sqitch",
"version": "4.13.2",
"version": "5.0.0-beta.4",
"private": true,
"engines": {
"node": "22"
Expand Down
3 changes: 0 additions & 3 deletions src/deploy/database_grafana.sql

This file was deleted.

5 changes: 3 additions & 2 deletions src/deploy/enum_event_visibility.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ BEGIN;

CREATE TYPE maevsi.event_visibility AS ENUM (
'public',
'private'
'private',
'unlisted'
);

COMMENT ON TYPE maevsi.event_visibility IS 'Possible visibilities of events and event groups: public, private.';
COMMENT ON TYPE maevsi.event_visibility IS 'Possible visibilities of events and event groups: public, private and unlisted.';

COMMIT;
2 changes: 1 addition & 1 deletion src/deploy/extension_pgcrypto.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BEGIN;

CREATE EXTENSION pgcrypto WITH SCHEMA maevsi;
CREATE EXTENSION pgcrypto;

COMMENT ON EXTENSION pgcrypto IS 'Provides password hashing functions.';

Expand Down
18 changes: 18 additions & 0 deletions src/deploy/extension_postgis.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
BEGIN;

CREATE EXTENSION postgis;

COMMENT ON EXTENSION postgis IS 'Functions to work with geospatial data.';

GRANT EXECUTE ON FUNCTION
geography(geometry),
geometry(text),
geometrytype(geography),
postgis_type_name(character varying, integer, boolean),
st_asgeojson(geography, integer, integer),
st_coorddim(geometry),
st_geomfromgeojson(text),
st_srid(geography)
TO maevsi_anonymous, maevsi_account;

COMMIT;
2 changes: 1 addition & 1 deletion src/deploy/function_account_delete.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DECLARE
BEGIN
_current_account_id := current_setting('jwt.claims.account_id')::UUID;

IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = _current_account_id AND account.password_hash = maevsi.crypt($1, account.password_hash))) THEN
IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($1, account.password_hash))) THEN
IF (EXISTS (SELECT 1 FROM maevsi.event WHERE event.author_account_id = _current_account_id)) THEN
RAISE 'You still own events!' USING ERRCODE = 'foreign_key_violation';
ELSE
Expand Down
4 changes: 2 additions & 2 deletions src/deploy/function_account_password_change.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ BEGIN

_current_account_id := current_setting('jwt.claims.account_id')::UUID;

IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = _current_account_id AND account.password_hash = maevsi.crypt($1, account.password_hash))) THEN
UPDATE maevsi_private.account SET password_hash = maevsi.crypt($2, maevsi.gen_salt('bf')) WHERE account.id = _current_account_id;
IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($1, account.password_hash))) THEN
UPDATE maevsi_private.account SET password_hash = crypt($2, gen_salt('bf')) WHERE account.id = _current_account_id;
ELSE
RAISE 'Account with given password not found!' USING ERRCODE = 'invalid_password';
END IF;
Expand Down
2 changes: 1 addition & 1 deletion src/deploy/function_account_password_reset.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BEGIN

UPDATE maevsi_private.account
SET
password_hash = maevsi.crypt($2, maevsi.gen_salt('bf')),
password_hash = crypt($2, gen_salt('bf')),
password_reset_verification = NULL
WHERE account.password_reset_verification = $1;
END;
Expand Down
2 changes: 1 addition & 1 deletion src/deploy/function_account_registration.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ BEGIN
END IF;

INSERT INTO maevsi_private.account(email_address, password_hash, last_activity) VALUES
(account_registration.email_address, maevsi.crypt(account_registration.password, maevsi.gen_salt('bf')), CURRENT_TIMESTAMP)
(account_registration.email_address, crypt(account_registration.password, gen_salt('bf')), CURRENT_TIMESTAMP)
RETURNING * INTO _new_account_private;

INSERT INTO maevsi.account(id, username) VALUES
Expand Down
6 changes: 3 additions & 3 deletions src/deploy/function_authenticate.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE FUNCTION maevsi.authenticate(
DECLARE
_account_id UUID;
_jwt_id UUID := gen_random_uuid();
_jwt_exp BIGINT := EXTRACT(EPOCH FROM ((SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP)) + COALESCE(current_setting('maevsi.jwt_expiry_duration', true), '1 day')::INTERVAL));
_jwt_exp BIGINT := EXTRACT(EPOCH FROM ((SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE)) + COALESCE(current_setting('maevsi.jwt_expiry_duration', true), '1 day')::INTERVAL));
_jwt maevsi.jwt;
_username TEXT;
BEGIN
Expand All @@ -33,7 +33,7 @@ BEGIN
FROM maevsi_private.account
WHERE
account.id = _account_id
AND account.password_hash = maevsi.crypt(authenticate.password, account.password_hash)
AND account.password_hash = crypt(authenticate.password, account.password_hash)
) IS NOT NULL) THEN
RAISE 'Account not verified!' USING ERRCODE = 'object_not_in_prerequisite_state';
END IF;
Expand All @@ -44,7 +44,7 @@ BEGIN
WHERE
account.id = _account_id
AND account.email_address_verification IS NULL -- Has been checked before, but better safe than sorry.
AND account.password_hash = maevsi.crypt(authenticate.password, account.password_hash)
AND account.password_hash = crypt(authenticate.password, account.password_hash)
RETURNING *
) SELECT _jwt_id, updated.id, _username, _jwt_exp, NULL, 'maevsi_account'
FROM updated
Expand Down
2 changes: 1 addition & 1 deletion src/deploy/function_event_delete.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DECLARE
BEGIN
_current_account_id := current_setting('jwt.claims.account_id')::UUID;

IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = _current_account_id AND account.password_hash = maevsi.crypt($2, account.password_hash))) THEN
IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($2, account.password_hash))) THEN
DELETE
FROM maevsi.event
WHERE
Expand Down
28 changes: 28 additions & 0 deletions src/deploy/function_event_search.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BEGIN;

CREATE FUNCTION maevsi.event_search(
query TEXT,
language maevsi.language
) RETURNS SETOF maevsi.event AS $$
DECLARE
ts_config regconfig;
BEGIN
ts_config := maevsi.language_iso_full_text_search(event_search.language);

RETURN QUERY
SELECT
*
FROM
maevsi.event
WHERE
search_vector @@ websearch_to_tsquery(ts_config, event_search.query)
ORDER BY
ts_rank_cd(search_vector, websearch_to_tsquery(ts_config, event_search.query)) DESC;
END;
$$ LANGUAGE PLPGSQL STABLE SECURITY INVOKER;

COMMENT ON FUNCTION maevsi.event_search(TEXT, maevsi.language) IS 'Performs a full-text search on the event table based on the provided query and language, returning event IDs ordered by relevance.';

GRANT EXECUTE ON FUNCTION maevsi.event_search(TEXT, maevsi.language) TO maevsi_account, maevsi_anonymous;

COMMIT;
4 changes: 2 additions & 2 deletions src/deploy/function_jwt_refresh.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CREATE FUNCTION maevsi.jwt_refresh(
jwt_id UUID
) RETURNS maevsi.jwt AS $$
DECLARE
_epoch_now BIGINT := EXTRACT(EPOCH FROM (SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP)));
_epoch_now BIGINT := EXTRACT(EPOCH FROM (SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE)));
_jwt maevsi.jwt;
BEGIN
SELECT (token).id, (token).account_id, (token).account_username, (token)."exp", (token).invitations, (token).role INTO _jwt
Expand All @@ -16,7 +16,7 @@ BEGIN
RETURN NULL;
ELSE
UPDATE maevsi_private.jwt
SET token.exp = EXTRACT(EPOCH FROM ((SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP)) + COALESCE(current_setting('maevsi.jwt_expiry_duration', true), '1 day')::INTERVAL))
SET token.exp = EXTRACT(EPOCH FROM ((SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE)) + COALESCE(current_setting('maevsi.jwt_expiry_duration', true), '1 day')::INTERVAL))
WHERE id = $1;

UPDATE maevsi_private.account
Expand Down
40 changes: 40 additions & 0 deletions src/deploy/function_language_iso_full_text_search.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
CREATE FUNCTION maevsi.language_iso_full_text_search(language maevsi.language)
RETURNS regconfig AS $$
BEGIN
CASE language
-- WHEN 'ar' THEN RETURN 'arabic';
-- WHEN 'ca' THEN RETURN 'catalan';
-- WHEN 'da' THEN RETURN 'danish';
WHEN 'de' THEN RETURN 'german';
-- WHEN 'el' THEN RETURN 'greek';
WHEN 'en' THEN RETURN 'english';
-- WHEN 'es' THEN RETURN 'spanish';
-- WHEN 'eu' THEN RETURN 'basque';
-- WHEN 'fi' THEN RETURN 'finnish';
-- WHEN 'fr' THEN RETURN 'french';
-- WHEN 'ga' THEN RETURN 'irish';
-- WHEN 'hi' THEN RETURN 'hindi';
-- WHEN 'hu' THEN RETURN 'hungarian';
-- WHEN 'hy' THEN RETURN 'armenian';
-- WHEN 'id' THEN RETURN 'indonesian';
-- WHEN 'it' THEN RETURN 'italian';
-- WHEN 'lt' THEN RETURN 'lithuanian';
-- WHEN 'ne' THEN RETURN 'nepali';
-- WHEN 'nl' THEN RETURN 'dutch';
-- WHEN 'no' THEN RETURN 'norwegian';
-- WHEN 'pt' THEN RETURN 'portuguese';
-- WHEN 'ro' THEN RETURN 'romanian';
-- WHEN 'ru' THEN RETURN 'russian';
-- WHEN 'sr' THEN RETURN 'serbian';
-- WHEN 'sv' THEN RETURN 'swedish';
-- WHEN 'ta' THEN RETURN 'tamil';
-- WHEN 'tr' THEN RETURN 'turkish';
-- WHEN 'yi' THEN RETURN 'yiddish';
ELSE RETURN 'simple';
END CASE;
END;
$$ LANGUAGE PLPGSQL STABLE SECURITY DEFINER;

COMMENT ON FUNCTION maevsi.language_iso_full_text_search(maevsi.language) IS 'Maps an ISO language code to the corresponding PostgreSQL text search configuration. This function returns the appropriate text search configuration for supported languages, such as "german" for "de" and "english" for "en". If the language code is not explicitly handled, the function defaults to the "simple" configuration, which is a basic tokenizer that does not perform stemming or handle stop words. This ensures that full-text search can work with a wide range of languages even if specific optimizations are not available for some.';

GRANT EXECUTE ON FUNCTION maevsi.language_iso_full_text_search(maevsi.language) TO maevsi_anonymous, maevsi_account;
7 changes: 7 additions & 0 deletions src/deploy/index_account_private_location.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BEGIN;

CREATE INDEX idx_account_private_location ON maevsi_private.account USING GIST (location);

COMMENT ON INDEX maevsi_private.idx_account_private_location IS 'Spatial index on column location in maevsi_private.account.';

COMMIT;
7 changes: 7 additions & 0 deletions src/deploy/index_event_location.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BEGIN;

CREATE INDEX idx_event_location ON maevsi.event USING GIST (location_geography);

COMMENT ON INDEX maevsi.idx_event_location IS 'Spatial index on column location in maevsi.event.';

COMMIT;
14 changes: 0 additions & 14 deletions src/deploy/role_grafana.sql

This file was deleted.

2 changes: 2 additions & 0 deletions src/deploy/schema_test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ CREATE SCHEMA maevsi_test;

COMMENT ON SCHEMA maevsi_test IS 'Schema for test functions.';

GRANT USAGE ON SCHEMA maevsi_test TO maevsi_anonymous, maevsi_account;

COMMIT;
Loading
Loading