CREATE TABLE "core_message_queue" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"raingull_id" char(32) NOT NULL,
"priority" integer NOT NULL,
"status" varchar(20) NOT NULL,
"retry_count" integer NOT NULL,
"last_retry_at" datetime NULL,
"error_message" text NULL,
"created_at" datetime NOT NULL,
"updated_at" datetime NOT NULL,
"completed_at" datetime NULL,
"formatted_message_id" bigint NOT NULL REFERENCES "core_formatted_messages" ("id") DEFERRABLE INITIALLY DEFERRED,
"user_id" varchar(8) NOT NULL REFERENCES "core_users" ("uuid") DEFERRABLE INITIALLY DEFERRED,
"service_id" bigint NOT NULL REFERENCES "core_services" ("id") DEFERRABLE INITIALLY DEFERRED
)