...

Text file src/github.com/ory/x/popx/stub/migrations/legacy/20200812160551_add_session_revoke.sqlite3.down.sql

Documentation: github.com/ory/x/popx/stub/migrations/legacy

     1DROP INDEX IF EXISTS "sessions_token_idx";
     2DROP INDEX IF EXISTS "sessions_token_uq_idx";
     3CREATE TABLE "_sessions_tmp" (
     4"id" TEXT PRIMARY KEY,
     5"issued_at" DATETIME NOT NULL DEFAULT 'CURRENT_TIMESTAMP',
     6"expires_at" DATETIME NOT NULL,
     7"authenticated_at" DATETIME NOT NULL,
     8"identity_id" char(36) NOT NULL,
     9"created_at" DATETIME NOT NULL,
    10"updated_at" DATETIME NOT NULL,
    11"token" TEXT,
    12FOREIGN KEY (identity_id) REFERENCES identities (id) ON UPDATE NO ACTION ON DELETE CASCADE
    13);
    14CREATE INDEX "sessions_token_idx" ON "_sessions_tmp" (token);
    15CREATE UNIQUE INDEX "sessions_token_uq_idx" ON "_sessions_tmp" (token);
    16INSERT INTO "_sessions_tmp" (id, issued_at, expires_at, authenticated_at, identity_id, created_at, updated_at, token) SELECT id, issued_at, expires_at, authenticated_at, identity_id, created_at, updated_at, token FROM "sessions";
    17
    18DROP TABLE "sessions";
    19ALTER TABLE "_sessions_tmp" RENAME TO "sessions";

View as plain text