trilium/db/migrations/0190__change_to_etapi_tokens.sql

16 lines
566 B
MySQL
Raw Normal View History

2022-01-11 00:09:20 +08:00
CREATE TABLE IF NOT EXISTS "etapi_tokens"
(
etapiTokenId TEXT PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
tokenHash TEXT NOT NULL,
utcDateCreated TEXT NOT NULL,
utcDateModified TEXT NOT NULL,
isDeleted INT NOT NULL DEFAULT 0);
2022-01-11 04:24:07 +08:00
INSERT INTO etapi_tokens (etapiTokenId, name, tokenHash, utcDateCreated, utcDateModified, isDeleted)
2022-01-11 00:09:20 +08:00
SELECT apiTokenId, 'Trilium Sender', token, utcDateCreated, utcDateCreated, isDeleted FROM api_tokens;
DROP TABLE api_tokens;
2022-01-11 04:24:07 +08:00
UPDATE entity_changes SET entityName = 'etapi_tokens' WHERE entityName = 'api_tokens';