...

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

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

     1DROP INDEX IF EXISTS "sessions_token_uq_idx";
     2DROP INDEX IF EXISTS "sessions_token_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,
    11FOREIGN KEY (identity_id) REFERENCES identities (id) ON UPDATE NO ACTION ON DELETE CASCADE
    12);
    13INSERT INTO "_sessions_tmp" (id, issued_at, expires_at, authenticated_at, identity_id, created_at, updated_at) SELECT id, issued_at, expires_at, authenticated_at, identity_id, created_at, updated_at FROM "sessions";
    14
    15DROP TABLE "sessions";
    16ALTER TABLE "_sessions_tmp" RENAME TO "sessions";

View as plain text