Files
artcraft/_sql/migrations_squashed/idempotency_tokens.sql
T
Brandon Thomas 2d4d2c667f reference schemas
2024-01-16 19:49:08 -05:00

20 lines
564 B
SQL

-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- A form of optimistic locking
CREATE TABLE idempotency_tokens (
-- Not used for anything except replication.
id BIGINT(20) NOT NULL AUTO_INCREMENT,
-- This can be a UUID or any entropic value.
idempotency_value VARCHAR(36) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-- INDICES --
PRIMARY KEY (id),
UNIQUE KEY (idempotency_value)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;