# Asking to confirm 'useraccesstokens' table contents

**URL:** <https://forum.mattermost.com/t/asking-to-confirm-useraccesstokens-table-contents/26110>\
**Category:** Unanswered\
**Created:** [September 3, 2026, 8:16pm UTC](https://forum.mattermost.com/t/asking-to-confirm-useraccesstokens-table-contents/26110 "2026-09-03T20:16:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RRCJF](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@RRCJF](https://forum.mattermost.com/u/RRCJF)\
**Post date:** [September 3, 2026, 8:16pm UTC](https://forum.mattermost.com/t/asking-to-confirm-useraccesstokens-table-contents/26110/1 "2026-09-03T20:16:44Z")

</div>

I detected an error reported by postgresql.log:

```auto
 mmuser@mattermost ERROR: relation "useraccesstokens" does not exist at character 139

```

I didn’t find the error in Mattermost logs maybe because we are not using this table!?

The problem is there since the migration from mysql to postgresql.

I renamed the table from user\_access\_tokens to useraccesstokens, then create 2 missing columns and recreate the indexes accordingly the information that I got…but I would like if someone can confirm that the following set for this table is correct:

```auto
mattermost=> \d+ useraccesstokens
                                                Table "public.useraccesstokens"
     Column | Type | Collation | Nullable | Default | Storage |
----------------+-----------------------+-----------+----------+---------+----------+ ...
 id | character varying(26) | | not null | | extended |             
 token | character varying(26) | | | | extended |             
 userid | character varying(26) | | | | extended |             
 description | text | | | | extended |             
 isactive | boolean | | | | plain |             
 expiresat | bigint | | | 0 | plain |             
 lastnotifiedat | bigint | | | 0 | plain |             
Indexes:
    "useraccesstokens_pkey" PRIMARY KEY, btree (id)
    "idx_user_access_tokens_user_id" btree (userid)
    "idx_useraccesstokens_expiresat" btree (expiresat) WHERE expiresat <> 0
    "useraccesstokens_token_key" UNIQUE, btree (token)
Access method: heap

```

Thank you.

---

<div class="post-metadata">

**Author:** ![gdelia-pm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/gdelia-pm/32/7305_2.png) [@gdelia-pm](https://forum.mattermost.com/u/gdelia-pm)\
**Post date:** [September 8, 2026, 5:48pm UTC](https://forum.mattermost.com/t/asking-to-confirm-useraccesstokens-table-contents/26110/2 "2026-09-08T17:48:32Z")

</div>

Hey there, not clear to me what version you’re running from, I may have missed it. This is what I have on my system running 11.7.10

```auto
REATE TABLE IF NOT EXISTS public.useraccesstokens
(
    id character varying(26) COLLATE pg_catalog."default" NOT NULL,
    token character varying(26) COLLATE pg_catalog."default",
    userid character varying(26) COLLATE pg_catalog."default",
    description character varying(512) COLLATE pg_catalog."default",
    isactive boolean,
    CONSTRAINT useraccesstokens_pkey PRIMARY KEY (id),
    CONSTRAINT useraccesstokens_token_key UNIQUE (token)
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public.useraccesstokens
    OWNER to !!YOUCANTSEETHIS!!;
-- Index: idx_user_access_tokens_user_id

-- DROP INDEX IF EXISTS public.idx_user_access_tokens_user_id;

CREATE INDEX IF NOT EXISTS idx_user_access_tokens_user_id
    ON public.useraccesstokens USING btree
    (userid COLLATE pg_catalog."default" ASC NULLS LAST)
    TABLESPACE pg_default;

```

---

<div class="post-metadata">

**Author:** ![john.combs](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/john.combs/32/7118_2.png) [@john.combs](https://forum.mattermost.com/u/john.combs)\
**Post date:** [September 8, 2026, 11:58pm UTC](https://forum.mattermost.com/t/asking-to-confirm-useraccesstokens-table-contents/26110/3 "2026-09-08T23:58:33Z")

</div>

Thanks for the details, CJF, and the comparison, @gdelia-pm; could you confirm your Mattermost version and migration method, since the [v11 changelog](https://docs.mattermost.com/product-overview/mattermost-v11-changelog) confirms `expiresat` was added in v11.9 and `lastnotifiedat` in v11.10, so we’ll need to check your exact release before confirming the table definition?

---

<div class="post-metadata">

**Author:** ![RRCJF](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@RRCJF](https://forum.mattermost.com/u/RRCJF)\
**Post date:** [September 28, 2026, 6:52pm UTC](https://forum.mattermost.com/t/asking-to-confirm-useraccesstokens-table-contents/26110/5 "2026-09-28T18:52:08Z")

</div>

Thanks for the response John and sorry for the late reply.  
The migration to postgresql was made when we were at version 10.11.19 (Now we are at 11.7.10).  
I used Limetric pgloader. I tried to use the script provided by mattermost github but never worked, so I did many corrections in database following as much possible the instructions as preparation of the database, `simulating` manually what the script should do, and fixing posterior required changes to the postgresql database. The above is the last change that I did(Already on 11.7.10 mattermost version).  
The logs seem to be good now.

---

<div class="post-metadata">

**Author:** ![RRCJF](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@RRCJF](https://forum.mattermost.com/u/RRCJF)\
**Post date:** [September 29, 2026, 7:18pm UTC](https://forum.mattermost.com/t/asking-to-confirm-useraccesstokens-table-contents/26110/6 "2026-09-29T19:18:43Z")

</div>

Thank you gdelia-pm. I have the same version as you, 11.7.10 .
