helpyourneighbour/backend/migrations/002_idempotency_table.sql

9 lines
313 B
MySQL
Raw Normal View History

-- Migration: 002_idempotency_table
-- Description: Add idempotency_keys table for handling idempotent requests
CREATE TABLE IF NOT EXISTS idempotency_keys (
id BIGINT PRIMARY KEY AUTO_INCREMENT,
key VARCHAR(255) NOT NULL UNIQUE,
response_body TEXT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);