diff --git a/devplacepy/database/schema.py b/devplacepy/database/schema.py index 69d26994..5689a071 100644 --- a/devplacepy/database/schema.py +++ b/devplacepy/database/schema.py @@ -200,6 +200,19 @@ def init_db(): ) _index(db, "messages", "idx_messages_updated_at", ["updated_at"]) _index(db, "messages", "idx_messages_dedupe", ["sender_uid", "client_id"]) + notifications = get_table("notifications") + for column, example in ( + ("uid", ""), + ("user_uid", ""), + ("type", ""), + ("message", ""), + ("related_uid", ""), + ("target_url", ""), + ("read", False), + ("created_at", ""), + ): + if not notifications.has_column(column): + notifications.create_column_by_example(column, example) _index(db, "notifications", "idx_notifications_user", ["user_uid"]) _index(db, "notifications", "idx_notifications_user_read", ["user_uid", "read"]) push_registration = get_table("push_registration") diff --git a/pyproject.toml b/pyproject.toml index aa30beb6..f5986b1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "devplacepy" -version = "1.1.30" +version = "1.1.31" description = "DevPlace - The Developer Social Network" requires-python = ">=3.12" dependencies = [ diff --git a/tests/unit/database/schema.py b/tests/unit/database/schema.py index ac89717e..898543b2 100644 --- a/tests/unit/database/schema.py +++ b/tests/unit/database/schema.py @@ -4,6 +4,7 @@ from devplacepy.database import get_table, init_db FILTERED_COLUMNS = { "messages": ("uid", "sender_uid", "receiver_uid", "content", "read", "created_at", "updated_at"), + "notifications": ("uid", "user_uid", "type", "message", "related_uid", "target_url", "read", "created_at"), "workspace_quota_rules": ("uid", "owner_kind", "owner_id", "deleted_at"), "workspace_editor_prefs": ("uid", "owner_kind", "owner_id", "deleted_at"), }