photoprism/internal/migrate/mysql/20220927-000200.sql
Michael Mayer 4c516cac38 Auth: Rename database tables and delete temporary tables #98 #782
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-10-02 22:09:02 +02:00

1 line
408 B
SQL

REPLACE INTO auth_users (id, user_uid, super_admin, can_login, can_sync, user_role, display_name, user_name, user_email, login_at, created_at, updated_at) SELECT id, user_uid, role_admin, 1, 1, 'admin', full_name, user_name, primary_email, login_at, created_at, updated_at FROM users WHERE role_admin = 1 AND user_name NOT IN (SELECT user_name FROM auth_users) AND user_name <> '' AND user_name IS NOT NULL;