Skip to content

Commit cb9fc09

Browse files
authored
Merge pull request #45 from constructive-io/devin/1772327585-sync-all-packages
chore: sync all packages from constructive-db/pgpm-modules
2 parents 3f9731d + 4bbce53 commit cb9fc09

File tree

92 files changed

+1457
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1457
-269
lines changed

packages/achievements/deploy/schemas/status_public/tables/level_requirements/table.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ CREATE TABLE status_public.level_requirements (
1515
);
1616

1717
COMMENT ON TABLE status_public.level_requirements IS 'Requirements to achieve a level';
18+
COMMENT ON COLUMN status_public.level_requirements.id IS 'Unique identifier for this requirement';
19+
COMMENT ON COLUMN status_public.level_requirements.name IS 'Requirement name (e.g. posts_created, logins); matches user_steps.name';
20+
COMMENT ON COLUMN status_public.level_requirements.level IS 'Level this requirement belongs to (references levels.name)';
21+
COMMENT ON COLUMN status_public.level_requirements.required_count IS 'Number of steps needed to satisfy this requirement (default 1)';
22+
COMMENT ON COLUMN status_public.level_requirements.priority IS 'Display/evaluation order; lower numbers are checked first (default 100)';
23+
1824
CREATE INDEX ON status_public.level_requirements (name, level, priority);
1925
GRANT SELECT ON TABLE status_public.levels TO authenticated;
2026

packages/achievements/deploy/schemas/status_public/tables/levels/table.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CREATE TABLE status_public.levels (
99
);
1010

1111
COMMENT ON TABLE status_public.levels IS 'Levels for achievement';
12+
COMMENT ON COLUMN status_public.levels.name IS 'Unique level name used as the primary key (e.g. bronze, silver, gold)';
1213

1314
GRANT SELECT ON TABLE status_public.levels TO public;
1415

packages/achievements/deploy/schemas/status_public/tables/user_achievements/table.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ CREATE TABLE status_public.user_achievements (
1414
);
1515

1616
COMMENT ON TABLE status_public.user_achievements IS 'This table represents the users progress for particular level requirements, tallying the total count. This table is updated via triggers and should not be updated maually.';
17+
COMMENT ON COLUMN status_public.user_achievements.id IS 'Unique identifier for this achievement progress record';
18+
COMMENT ON COLUMN status_public.user_achievements.user_id IS 'User whose progress is being tracked';
19+
COMMENT ON COLUMN status_public.user_achievements.name IS 'Name of the level requirement this progress relates to';
20+
COMMENT ON COLUMN status_public.user_achievements.count IS 'Accumulated count toward the requirement (updated by triggers)';
21+
COMMENT ON COLUMN status_public.user_achievements.created_at IS 'Timestamp when this progress record was first created';
1722

1823
CREATE INDEX ON status_public.user_achievements (user_id, name);
1924

packages/achievements/deploy/schemas/status_public/tables/user_steps/table.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ CREATE TABLE status_public.user_steps (
1313
);
1414

1515
COMMENT ON TABLE status_public.user_steps IS 'The user achieving a requirement for a level. Log table that has every single step ever taken.';
16+
COMMENT ON COLUMN status_public.user_steps.id IS 'Unique identifier for this step record';
17+
COMMENT ON COLUMN status_public.user_steps.user_id IS 'User who performed this step';
18+
COMMENT ON COLUMN status_public.user_steps.name IS 'Name of the level requirement this step counts toward';
19+
COMMENT ON COLUMN status_public.user_steps.count IS 'Number of units this step contributes (default 1)';
20+
COMMENT ON COLUMN status_public.user_steps.created_at IS 'Timestamp when this step was recorded';
21+
1622
CREATE INDEX ON status_public.user_steps (user_id, name);
1723

1824
COMMIT;

packages/achievements/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pgpm/achievements",
3-
"version": "0.17.0",
3+
"version": "0.15.5",
44
"description": "Achievement system for tracking user progress and milestones",
55
"author": "Dan Lynch <pyramation@gmail.com>",
66
"contributors": [
@@ -25,7 +25,7 @@
2525
"@pgpm/verify": "workspace:*"
2626
},
2727
"devDependencies": {
28-
"pgpm": "^4.2.1"
28+
"pgpm": "^4.2.3"
2929
},
3030
"repository": {
3131
"type": "git",

packages/achievements/sql/pgpm-achievements--0.15.3.sql

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ CREATE TABLE status_public.user_steps (
2222
);
2323

2424
COMMENT ON TABLE status_public.user_steps IS 'The user achieving a requirement for a level. Log table that has every single step ever taken.';
25+
COMMENT ON COLUMN status_public.user_steps.id IS 'Unique identifier for this step record';
26+
COMMENT ON COLUMN status_public.user_steps.user_id IS 'User who performed this step';
27+
COMMENT ON COLUMN status_public.user_steps.name IS 'Name of the level requirement this step counts toward';
28+
COMMENT ON COLUMN status_public.user_steps.count IS 'Number of units this step contributes (default 1)';
29+
COMMENT ON COLUMN status_public.user_steps.created_at IS 'Timestamp when this step was recorded';
2530

2631
CREATE INDEX ON status_public.user_steps (user_id, name);
2732

@@ -124,6 +129,11 @@ CREATE TABLE status_public.user_achievements (
124129
);
125130

126131
COMMENT ON TABLE status_public.user_achievements IS 'This table represents the users progress for particular level requirements, tallying the total count. This table is updated via triggers and should not be updated maually.';
132+
COMMENT ON COLUMN status_public.user_achievements.id IS 'Unique identifier for this achievement progress record';
133+
COMMENT ON COLUMN status_public.user_achievements.user_id IS 'User whose progress is being tracked';
134+
COMMENT ON COLUMN status_public.user_achievements.name IS 'Name of the level requirement this progress relates to';
135+
COMMENT ON COLUMN status_public.user_achievements.count IS 'Accumulated count toward the requirement (updated by triggers)';
136+
COMMENT ON COLUMN status_public.user_achievements.created_at IS 'Timestamp when this progress record was first created';
127137

128138
CREATE INDEX ON status_public.user_achievements (user_id, name);
129139

@@ -145,6 +155,7 @@ CREATE TABLE status_public.levels (
145155
);
146156

147157
COMMENT ON TABLE status_public.levels IS 'Levels for achievement';
158+
COMMENT ON COLUMN status_public.levels.name IS 'Unique level name used as the primary key (e.g. bronze, silver, gold)';
148159

149160
GRANT SELECT ON status_public.levels TO PUBLIC;
150161

@@ -158,6 +169,11 @@ CREATE TABLE status_public.level_requirements (
158169
);
159170

160171
COMMENT ON TABLE status_public.level_requirements IS 'Requirements to achieve a level';
172+
COMMENT ON COLUMN status_public.level_requirements.id IS 'Unique identifier for this requirement';
173+
COMMENT ON COLUMN status_public.level_requirements.name IS 'Requirement name (e.g. posts_created, logins); matches user_steps.name';
174+
COMMENT ON COLUMN status_public.level_requirements.level IS 'Level this requirement belongs to (references levels.name)';
175+
COMMENT ON COLUMN status_public.level_requirements.required_count IS 'Number of steps needed to satisfy this requirement (default 1)';
176+
COMMENT ON COLUMN status_public.level_requirements.priority IS 'Display/evaluation order; lower numbers are checked first (default 100)';
161177

162178
CREATE INDEX ON status_public.level_requirements (name, level, priority);
163179

@@ -261,4 +277,4 @@ CREATE TRIGGER update_achievements_tg
261277
AFTER INSERT
262278
ON status_public.user_steps
263279
FOR EACH ROW
264-
EXECUTE PROCEDURE status_private.tg_update_achievements_tg();
280+
EXECUTE PROCEDURE status_private.tg_update_achievements_tg();

packages/base32/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pgpm/base32",
3-
"version": "0.17.0",
3+
"version": "0.15.5",
44
"description": "Base32 encoding and decoding functions for PostgreSQL",
55
"author": "Dan Lynch <pyramation@gmail.com>",
66
"contributors": [
@@ -24,7 +24,7 @@
2424
"@pgpm/verify": "workspace:*"
2525
},
2626
"devDependencies": {
27-
"pgpm": "^4.2.1"
27+
"pgpm": "^4.2.3"
2828
},
2929
"repository": {
3030
"type": "git",

packages/database-jobs/deploy/schemas/app_jobs/tables/job_queues/table.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,12 @@ CREATE TABLE app_jobs.job_queues (
88
locked_at timestamptz,
99
locked_by text
1010
);
11+
12+
COMMENT ON TABLE app_jobs.job_queues IS 'Queue metadata: tracks job counts and locking state for each named queue';
13+
COMMENT ON COLUMN app_jobs.job_queues.queue_name IS 'Unique name identifying this queue';
14+
COMMENT ON COLUMN app_jobs.job_queues.job_count IS 'Number of pending jobs in this queue';
15+
COMMENT ON COLUMN app_jobs.job_queues.locked_at IS 'Timestamp when this queue was locked for batch processing';
16+
COMMENT ON COLUMN app_jobs.job_queues.locked_by IS 'Identifier of the worker that currently holds the queue lock';
17+
1118
COMMIT;
1219

packages/database-jobs/deploy/schemas/app_jobs/tables/jobs/table.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,21 @@ CREATE TABLE app_jobs.jobs (
2323
CHECK (length(locked_by) > 3),
2424
UNIQUE (key)
2525
);
26+
27+
COMMENT ON TABLE app_jobs.jobs IS 'Background job queue with database scoping: each row is a pending or in-progress task for a specific database';
28+
COMMENT ON COLUMN app_jobs.jobs.id IS 'Auto-incrementing job identifier';
29+
COMMENT ON COLUMN app_jobs.jobs.database_id IS 'Database this job belongs to, for multi-tenant job isolation';
30+
COMMENT ON COLUMN app_jobs.jobs.queue_name IS 'Name of the queue this job belongs to; used for worker routing and concurrency control';
31+
COMMENT ON COLUMN app_jobs.jobs.task_identifier IS 'Identifier for the task type (maps to a worker handler function)';
32+
COMMENT ON COLUMN app_jobs.jobs.payload IS 'JSON payload of arguments passed to the task handler';
33+
COMMENT ON COLUMN app_jobs.jobs.priority IS 'Execution priority; lower numbers run first (default 0)';
34+
COMMENT ON COLUMN app_jobs.jobs.run_at IS 'Earliest time this job should be executed; used for delayed/scheduled execution';
35+
COMMENT ON COLUMN app_jobs.jobs.attempts IS 'Number of times this job has been attempted so far';
36+
COMMENT ON COLUMN app_jobs.jobs.max_attempts IS 'Maximum retry attempts before the job is considered permanently failed';
37+
COMMENT ON COLUMN app_jobs.jobs.key IS 'Optional unique deduplication key; prevents duplicate jobs with the same key';
38+
COMMENT ON COLUMN app_jobs.jobs.last_error IS 'Error message from the most recent failed attempt';
39+
COMMENT ON COLUMN app_jobs.jobs.locked_at IS 'Timestamp when a worker locked this job for processing';
40+
COMMENT ON COLUMN app_jobs.jobs.locked_by IS 'Identifier of the worker that currently holds the lock';
41+
2642
COMMIT;
2743

packages/database-jobs/deploy/schemas/app_jobs/tables/scheduled_jobs/table.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,21 @@ CREATE TABLE app_jobs.scheduled_jobs (
2323
CHECK (length(locked_by) > 3),
2424
UNIQUE (key)
2525
);
26+
27+
COMMENT ON TABLE app_jobs.scheduled_jobs IS 'Recurring/cron-style job definitions with database scoping: each row spawns jobs on a schedule for a specific database';
28+
COMMENT ON COLUMN app_jobs.scheduled_jobs.id IS 'Auto-incrementing scheduled job identifier';
29+
COMMENT ON COLUMN app_jobs.scheduled_jobs.database_id IS 'Database this scheduled job belongs to, for multi-tenant isolation';
30+
COMMENT ON COLUMN app_jobs.scheduled_jobs.queue_name IS 'Name of the queue spawned jobs are placed into';
31+
COMMENT ON COLUMN app_jobs.scheduled_jobs.task_identifier IS 'Task type identifier for spawned jobs';
32+
COMMENT ON COLUMN app_jobs.scheduled_jobs.payload IS 'JSON payload passed to each spawned job';
33+
COMMENT ON COLUMN app_jobs.scheduled_jobs.priority IS 'Priority assigned to spawned jobs (lower = higher priority)';
34+
COMMENT ON COLUMN app_jobs.scheduled_jobs.max_attempts IS 'Max retry attempts for spawned jobs';
35+
COMMENT ON COLUMN app_jobs.scheduled_jobs.key IS 'Optional unique deduplication key';
36+
COMMENT ON COLUMN app_jobs.scheduled_jobs.locked_at IS 'Timestamp when the scheduler locked this record for processing';
37+
COMMENT ON COLUMN app_jobs.scheduled_jobs.locked_by IS 'Identifier of the scheduler worker holding the lock';
38+
COMMENT ON COLUMN app_jobs.scheduled_jobs.schedule_info IS 'JSON schedule configuration (e.g. cron expression, interval)';
39+
COMMENT ON COLUMN app_jobs.scheduled_jobs.last_scheduled IS 'Timestamp when a job was last spawned from this schedule';
40+
COMMENT ON COLUMN app_jobs.scheduled_jobs.last_scheduled_id IS 'ID of the last job spawned from this schedule';
41+
2642
COMMIT;
2743

0 commit comments

Comments
 (0)