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

Create Database for Notification Tracking #2387

Closed
tobi-bams opened this issue Jan 10, 2025 · 4 comments
Closed

Create Database for Notification Tracking #2387

tobi-bams opened this issue Jan 10, 2025 · 4 comments
Labels

Comments

@tobi-bams
Copy link
Contributor

Description:
We need to create a database table to store notification details for the notification system. This table will ensure notifications are tracked, retried, and processed effectively. The table should include fields for tracking event type, public key, notification content, retry attempts, status, and other relevant details.

Acceptance Criteria:

  1. A database table named notifications is created with the following schema:

    CREATE TABLE notifications (
      id SERIAL PRIMARY KEY,
      event VARCHAR(50) NOT NULL,         -- Event type (e.g., bounty_assigned)
      pubkey VARCHAR(100) NOT NULL,       -- User's pubkey
      content TEXT NOT NULL,              -- Notification content
      retries INT DEFAULT 0,              -- Retry count
      status VARCHAR(20) DEFAULT 'PENDING', -- Status: PENDING, COMPLETE, FAILED, WAITING_KEY_EXCHANGE
      uuid UUID NOT NULL,                 -- Unique identifier for the notification
      created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
      updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    );
  2. The table should support the following statuses:

    • PENDING
    • COMPLETE
    • FAILED
    • WAITING_KEY_EXCHANGE
  3. Ensure the uuid column is indexed for efficient querying by notification ID.

  4. Verify that the table is successfully created in the database.

Additional Notes:

  • This table is foundational for the notification system and will be used to track the state of notifications as they are processed.
@Ekep-Obasi
Copy link
Contributor

Ekep-Obasi commented Jan 10, 2025

@tobi-bams @humansinstitute please assign me

@aliraza556
Copy link
Contributor

@tobi-bams @humansinstitute Please assign me?

@saithsab877
Copy link
Contributor

@humansinstitute Please assign me?

@MahtabBukhari
Copy link
Contributor

@humansinstitute please assign me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants