Create scheduled message event (#17)
Reviewed-on: phoenix/textsender_api#17
This commit was merged in pull request #17.
This commit is contained in:
@@ -24,3 +24,22 @@ CREATE TABLE IF NOT EXISTS "scheduled_messages" (
|
||||
status TEXT CHECK (status IN ('PENDING', 'READY', 'PROCESSING', 'DONE')),
|
||||
user_id UUID NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "scheduled_message_events" (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
contact_id UUID NOT NULL,
|
||||
message_id UUID NOT NULL,
|
||||
scheduled_message_id UUID NOT NULL,
|
||||
created timestamptz DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "message_event_responses" (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
scheduled_message_event_id UUID NULL,
|
||||
response JSONB NOT NULL,
|
||||
user_id UUID NOT NULL,
|
||||
sent timestamptz NOT NULL,
|
||||
contact_id UUID NULL,
|
||||
message_id UUID NULL,
|
||||
status TEXT CHECK (status IN ('INSTANT', 'SCHEDULED'))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user