Gitea: Which table does gitea store its users when using postgres?

Created on 7 Jul 2018  路  5Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): 1.4.3
  • Git version: 2.18.0
  • Operating system: Arch Linux
  • Database (use [x]):

    • [x] PostgreSQL

    • [ ] MySQL

    • [ ] MSSQL

    • [ ] SQLite

  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)

    • [ ] No

    • [x] Not relevant

Description

I'd like to know which table gitea stores its users in. I've been trying to migrate from mysql to postgres, but for the life of me I don't understand where gitea stores its users. To check where it stores users, I launched two different instances of gitea, with one using mysql and the other using postgresql. I then added a user during installation for both. I checked the user table in both mysql and postgres. The mysql one is populated as I expect it to, but I don't see the postgres user table being populated when I add a new user.

This is quite vexing, because my production instance has all its users in the user table in mysql which I cannot migrate over: I don't know where users get stored in postgres. Every other table is migrating over perfectly fine.

kinquestion

Most helpful comment

Hello,
I had the same issue (user table seems unpopulated), which is more postgres related, but I solved by doing this:

$ sudo -u postgres psql
postgres=#  \c gitea
gitea=# SELECT * FROM public.user;

All 5 comments

maybe do a fresh install and and just purge db after install (e.g. in VM/docker)? this probably will answer all other questions like "where is X stored"

I found it, sorry, I overlooked something silly. Now the only problem is that it tells me my password is wrong. :/

@savyajha you can reset password via command line: https://docs.gitea.io/en-us/command-line/

I'm going to close this ticket now as you've discovered the table.

Hello,
I had the same issue (user table seems unpopulated), which is more postgres related, but I solved by doing this:

$ sudo -u postgres psql
postgres=#  \c gitea
gitea=# SELECT * FROM public.user;

Yeah, thanks. Another way is to quote "user". My problem is that the tool I used for import from mysql didn't associate the tables with the public schema, which meant that gitea couldn't really access them.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adpande picture adpande  路  3Comments

thehowl picture thehowl  路  3Comments

jakimfett picture jakimfett  路  3Comments

lunny picture lunny  路  3Comments

jorise7 picture jorise7  路  3Comments