mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-25 18:49:38 +00:00
20 lines
564 B
SQL
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;
|