Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ce8a9c9
feat(account)!: add imprint and description (#188)
sthelemann Apr 10, 2025
b81b3c9
chore(release): 8.0.0-beta.1 [skip ci]
semantic-release-bot Apr 10, 2025
4abfcaf
feat(event)!: remove existence validation function (#191)
dargmuesli Apr 17, 2025
6eadec5
chore(release): 8.0.0-beta.2 [skip ci]
semantic-release-bot Apr 17, 2025
ef987b2
test!: run separately from `sqitch` (#187)
sthelemann May 2, 2025
1342047
chore(release): 8.0.0-beta.3 [skip ci]
semantic-release-bot May 2, 2025
7e525e1
chore(policy)!: simplify policies (#190)
sthelemann May 2, 2025
6329735
chore(release): 8.0.0-beta.4 [skip ci]
semantic-release-bot May 2, 2025
c977979
fix(event-favorite): correct smart tags
dargmuesli May 2, 2025
fa81e9e
fix(event-favorite)!: correct smart tags (#194)
dargmuesli May 2, 2025
31de779
chore(release): 8.0.0-beta.5 [skip ci]
semantic-release-bot May 2, 2025
22cf406
feat(event)!: remove groups
dargmuesli May 9, 2025
4bae6c6
feat(event)!: remove groups (#195)
dargmuesli May 9, 2025
4c6db63
chore(release): 8.0.0-beta.6 [skip ci]
semantic-release-bot May 9, 2025
c6f44f6
chore(package): sort
dargmuesli May 10, 2025
0e9278e
Merge branch 'main' into beta
dargmuesli May 10, 2025
65a081d
chore(release): 8.0.0-beta.7 [skip ci]
semantic-release-bot May 10, 2025
35964fa
Merge branch 'main' into beta
dargmuesli May 10, 2025
6743551
chore(package): correct scripts
dargmuesli May 12, 2025
bfb3603
feat(upload)!: rework permissions
dargmuesli May 11, 2025
caa5e05
feat(upload)!: drop custom create function
dargmuesli May 12, 2025
2894a1a
Merge pull request #199 from maevsi/feat/upload/rework
dargmuesli May 12, 2025
52431bb
chore(release): 8.0.0-beta.8 [skip ci]
semantic-release-bot May 12, 2025
b26e0b7
chore: sort service secrets
dargmuesli May 12, 2025
0fbae08
feat(grafana): readd
dargmuesli May 13, 2025
49aba67
Merge pull request #200 from maevsi/feat/grafana/readd
dargmuesli May 13, 2025
9c24ddb
chore(release): 8.0.0-beta.9 [skip ci]
semantic-release-bot May 13, 2025
dec870a
fix(address): allow selects for accessible events
dargmuesli May 15, 2025
cefbdab
Merge pull request #202 from maevsi/fix/address/policy
dargmuesli May 15, 2025
ae6c49c
chore(release): 8.0.0-beta.10 [skip ci]
semantic-release-bot May 15, 2025
27164cc
Merge branch 'main' into beta
dargmuesli May 15, 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
93 changes: 93 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,96 @@
## [8.0.0-beta.10](https://github.com/maevsi/sqitch/compare/8.0.0-beta.9...8.0.0-beta.10) (2025-05-15)

### Bug Fixes

* **address:** allow selects for accessible events ([dec870a](https://github.com/maevsi/sqitch/commit/dec870a9236a44adf688a4d61444e138afb9c1bb))

## [8.0.0-beta.9](https://github.com/maevsi/sqitch/compare/8.0.0-beta.8...8.0.0-beta.9) (2025-05-13)

### Features

* **grafana:** readd ([0fbae08](https://github.com/maevsi/sqitch/commit/0fbae08feb875e51c2fc19ac18a3d9a25f4f2234))

## [8.0.0-beta.8](https://github.com/maevsi/sqitch/compare/8.0.0-beta.7...8.0.0-beta.8) (2025-05-12)

### ⚠ BREAKING CHANGES

* **upload:** drop custom create function
* **upload:** rework permissions

### Features

* **upload:** drop custom create function ([caa5e05](https://github.com/maevsi/sqitch/commit/caa5e053a85f62861e3ddaee4d366c8db7a5a81a))
* **upload:** rework permissions ([bfb3603](https://github.com/maevsi/sqitch/commit/bfb36037b1e804184dd12b18cbc2acffe4ea9519))

## [8.0.0-beta.7](https://github.com/maevsi/sqitch/compare/8.0.0-beta.6...8.0.0-beta.7) (2025-05-10)

### Bug Fixes

* schedule release ([8e1b5b8](https://github.com/maevsi/sqitch/commit/8e1b5b8f29e4de79249f693341ee42862825ced8))

## [8.0.0-beta.6](https://github.com/maevsi/sqitch/compare/8.0.0-beta.5...8.0.0-beta.6) (2025-05-09)

### ⚠ BREAKING CHANGES

* **event:** remove groups (#195)
* **event:** remove groups

### Features

* **event:** remove groups ([22cf406](https://github.com/maevsi/sqitch/commit/22cf406c924bf048fc539faea747d2936312f28b))
* **event:** remove groups ([#195](https://github.com/maevsi/sqitch/issues/195)) ([4bae6c6](https://github.com/maevsi/sqitch/commit/4bae6c67b8a427d453cc8825ec6955a55f03fe3a))

## [8.0.0-beta.5](https://github.com/maevsi/sqitch/compare/8.0.0-beta.4...8.0.0-beta.5) (2025-05-02)

### ⚠ BREAKING CHANGES

* **event-favorite:** correct smart tags (#194)

### Bug Fixes

* **event-favorite:** correct smart tags ([c977979](https://github.com/maevsi/sqitch/commit/c97797938503a3845b0b07784b1e283236b25078))
* **event-favorite:** correct smart tags ([#194](https://github.com/maevsi/sqitch/issues/194)) ([fa81e9e](https://github.com/maevsi/sqitch/commit/fa81e9ecaea39d7bf9b809835fd1303c0412325b))

## [8.0.0-beta.4](https://github.com/maevsi/sqitch/compare/8.0.0-beta.3...8.0.0-beta.4) (2025-05-02)

### ⚠ BREAKING CHANGES

* **policy:** simplify policies (#190)

### Miscellaneous Chores

* **policy:** simplify policies ([#190](https://github.com/maevsi/sqitch/issues/190)) ([7e525e1](https://github.com/maevsi/sqitch/commit/7e525e1e82cdeda035064bc8367030d0a57027e4))

## [8.0.0-beta.3](https://github.com/maevsi/sqitch/compare/8.0.0-beta.2...8.0.0-beta.3) (2025-05-02)

### ⚠ BREAKING CHANGES

* run separately from `sqitch` (#187)

### Tests

* run separately from `sqitch` ([#187](https://github.com/maevsi/sqitch/issues/187)) ([ef987b2](https://github.com/maevsi/sqitch/commit/ef987b26c615cd64c3f66d7f2947ca0347a430a4))

## [8.0.0-beta.2](https://github.com/maevsi/sqitch/compare/8.0.0-beta.1...8.0.0-beta.2) (2025-04-17)

### ⚠ BREAKING CHANGES

* **event:** remove existence validation function (#191)

### Features

* **event:** remove existence validation function ([#191](https://github.com/maevsi/sqitch/issues/191)) ([4abfcaf](https://github.com/maevsi/sqitch/commit/4abfcaf0d5a12ab93b9270d3b92d1ec44df33f60))

## [8.0.0-beta.1](https://github.com/maevsi/sqitch/compare/7.0.0...8.0.0-beta.1) (2025-04-10)

### ⚠ BREAKING CHANGES

* **account:** add imprint and description (#188)

### Features

* **account:** add imprint and description ([#188](https://github.com/maevsi/sqitch/issues/188)) ([ce8a9c9](https://github.com/maevsi/sqitch/commit/ce8a9c95f9e0dbf91d4f5df424650b1541e61461))

## [7.0.1](https://github.com/maevsi/sqitch/compare/7.0.0...7.0.1) (2025-04-26)

### Bug Fixes
Expand Down
18 changes: 10 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,31 @@ RUN apt-get update \
&& apt-get install --no-install-recommends -y \
sqitch=1.1.0000-1 \
&& mkdir -p /run/secrets \
&& echo "grafana" > /run/secrets/postgres_role_service_grafana_username \
&& echo "postgres" > /run/secrets/postgres_password \
&& echo "postgraphile" > /run/secrets/postgres_role_service_postgraphile_username \
&& echo "vibetype" > /run/secrets/postgres_role_service_vibetype_username \
&& echo "placeholder" | tee \
/run/secrets/postgres_role_service_vibetype_password \
/run/secrets/postgres_role_service_grafana_password \
/run/secrets/postgres_role_service_postgraphile_password \
/run/secrets/postgres_role_service_vibetype_password \
/dev/null

COPY ./src ./
COPY ./test/index-missing.sql ./test/
COPY ./src ./src
COPY ./test ./test

RUN docker-entrypoint.sh postgres & \
while ! pg_isready -h localhost -U ci -p 5432; do sleep 1; done \
&& sqitch deploy -t db:pg://ci:postgres@/ci_database \
&& psql -h localhost -U ci -d ci_database -f ./test/index-missing.sql -v ON_ERROR_STOP=on \
&& sqitch --chdir src deploy -t db:pg://ci:postgres@/ci_database \
&& pg_dump -s -h localhost -U ci -p 5432 ci_database | sed -e '/^-- Dumped/d' > schema.sql \
&& sqitch revert -t db:pg://ci:postgres@/ci_database

&& psql -h localhost -U ci -d ci_database -q -f ./test/logic/main.sql \
-v TEST_DIRECTORY=./test/logic -v ON_ERROR_STOP=on \
&& sqitch --chdir src revert -t db:pg://ci:postgres@/ci_database

##############################
FROM test-build AS test

COPY ./test/schema/schema.definition.sql ./
COPY ./test/fixture/schema.definition.sql ./

RUN diff schema.definition.sql schema.sql

Expand Down
4 changes: 2 additions & 2 deletions docs/onboarding/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ All tests run in a containerized environment.
You can add basic test data to your working directory by running:

```sh
git apply --3way test/data.patch
git apply --3way test/development/data.patch
```

Then, deploy the patch as described in the [Code Structure](#code-structure) section.

To persist changes to test data, stage them and run:

```sh
git diff --staged > test/data.patch
git diff --staged > test/development/data.patch
```

### Schema Fixture
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"packageManager": "pnpm@10.11.0",
"private": true,
"scripts": {
"deploy": "npm run sqitch deploy",
"deploy": "pnpm run sqitch deploy",
"prepare": "husky",
"revert": "npm run sqitch revert",
"revert": "pnpm run sqitch revert",
"sqitch": "./src/sqitch",
"test": "./test/schema/schema-update.sh",
"test:update": "npm run test --update"
"test": "./test/test.sh",
"test:update": "pnpm run test --update"
},
"type": "module",
"version": "7.0.1"
"version": "8.0.0-beta.10"
}
8 changes: 8 additions & 0 deletions src/deploy/database_grafana.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
\set role_service_grafana_username `cat /run/secrets/postgres_role_service_grafana_username`

SELECT 'CREATE DATABASE grafana OWNER "' || :'role_service_grafana_username' || '";'
WHERE NOT EXISTS (
SELECT FROM pg_database WHERE datname = 'grafana'
)\gexec

COMMENT ON DATABASE grafana IS 'The observation dashboard''s database.';
26 changes: 0 additions & 26 deletions src/deploy/function_account_email_address_verification.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,4 @@ COMMENT ON FUNCTION vibetype.account_email_address_verification(UUID) IS 'Sets t

GRANT EXECUTE ON FUNCTION vibetype.account_email_address_verification(UUID) TO vibetype_account, vibetype_anonymous;


CREATE FUNCTION vibetype_test.account_registration_verified (
_username TEXT,
_email_address TEXT
) RETURNS UUID AS $$
DECLARE
_account_id UUID;
_legal_term_id UUID;
_verification UUID;
BEGIN
_legal_term_id := vibetype_test.legal_term_singleton();
PERFORM vibetype.account_registration(_email_address, 'en', _legal_term_id, 'password', _username);

SELECT id INTO _account_id
FROM vibetype.account
WHERE username = _username;

SELECT email_address_verification INTO _verification
FROM vibetype_private.account
WHERE id = _account_id;

PERFORM vibetype.account_email_address_verification(_verification);

RETURN _account_id;
END $$ LANGUAGE plpgsql;

COMMIT;
20 changes: 0 additions & 20 deletions src/deploy/function_event_is_existing.sql

This file was deleted.

33 changes: 0 additions & 33 deletions src/deploy/function_upload_create.sql

This file was deleted.

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

\set role_service_grafana_password `cat /run/secrets/postgres_role_service_grafana_password`
\set role_service_grafana_username `cat /run/secrets/postgres_role_service_grafana_username`

DROP ROLE IF EXISTS :role_service_grafana_username;
CREATE ROLE :role_service_grafana_username LOGIN PASSWORD :'role_service_grafana_password';

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

\set role_service_grafana_username `cat /run/secrets/postgres_role_service_grafana_username`

CREATE SCHEMA vibetype_private;

COMMENT ON SCHEMA vibetype_private IS 'Contains account information and is not used by PostGraphile.';

GRANT USAGE ON SCHEMA vibetype_private TO :role_service_grafana_username;

COMMIT;
9 changes: 0 additions & 9 deletions src/deploy/schema_test.sql

This file was deleted.

10 changes: 10 additions & 0 deletions src/deploy/table_account_block.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,14 @@ COMMENT ON COLUMN vibetype.account_block.blocked_account_id IS 'The account id o
COMMENT ON COLUMN vibetype.account_block.created_at IS E'@omit create\nTimestamp of when the account block was created.';
COMMENT ON COLUMN vibetype.account_block.created_by IS 'The account id of the user who created the account block.';

GRANT INSERT, SELECT ON TABLE vibetype.account_block TO vibetype_account;
GRANT SELECT ON TABLE vibetype.account_block TO vibetype_anonymous;

ALTER TABLE vibetype.account_block ENABLE ROW LEVEL SECURITY;

CREATE POLICY account_block_all ON vibetype.account_block FOR ALL
USING (
created_by = vibetype.invoker_account_id()
);

COMMIT;
23 changes: 0 additions & 23 deletions src/deploy/table_account_block_policy.sql

This file was deleted.

9 changes: 9 additions & 0 deletions src/deploy/table_account_preference_event_category.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,13 @@ COMMENT ON TABLE vibetype.account_preference_event_category IS 'Event categories
COMMENT ON COLUMN vibetype.account_preference_event_category.account_id IS 'A user account id.';
COMMENT ON COLUMN vibetype.account_preference_event_category.category_id IS 'An event category id.';

GRANT SELECT, INSERT, DELETE ON TABLE vibetype.account_preference_event_category TO vibetype_account;

ALTER TABLE vibetype.account_preference_event_category ENABLE ROW LEVEL SECURITY;

CREATE POLICY account_preference_event_category_all ON vibetype.account_preference_event_category FOR ALL
USING (
account_id = vibetype.invoker_account_id()
);

COMMIT;
22 changes: 0 additions & 22 deletions src/deploy/table_account_preference_event_category_policy.sql

This file was deleted.

9 changes: 9 additions & 0 deletions src/deploy/table_account_preference_event_format.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@ COMMENT ON COLUMN vibetype.account_preference_event_format.account_id IS 'A user
COMMENT ON COLUMN vibetype.account_preference_event_format.format_id IS 'The id of an event format.';
COMMENT ON COLUMN vibetype.account_preference_event_format.created_at IS 'The timestammp when the record was created..';

GRANT SELECT, INSERT, DELETE ON TABLE vibetype.account_preference_event_format TO vibetype_account;

ALTER TABLE vibetype.account_preference_event_format ENABLE ROW LEVEL SECURITY;

CREATE POLICY account_preference_event_format_all ON vibetype.account_preference_event_format FOR ALL
USING (
account_id = vibetype.invoker_account_id()
);

COMMIT;
Loading
Loading