mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-22 00:37:36 -06:00
Modified the bulk insert logic to the user table in the migration file.
This commit is contained in:
parent
b2205fc6e1
commit
eb658a75ab
@ -7,6 +7,7 @@ Create Date: 2021-06-04 14:42:12.843116
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
from pgadmin.model import db, User
|
from pgadmin.model import db, User
|
||||||
|
from sqlalchemy.sql import text
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
|
||||||
@ -42,7 +43,13 @@ def upgrade():
|
|||||||
'confirmed_at, masterpass_check, auth_source '
|
'confirmed_at, masterpass_check, auth_source '
|
||||||
'from user_old')
|
'from user_old')
|
||||||
|
|
||||||
db.engine.execute(User.__table__.insert(), [
|
statement = text("""
|
||||||
|
INSERT INTO user(id, username, email, password, active,
|
||||||
|
confirmed_at, masterpass_check, auth_source, fs_uniquifier)
|
||||||
|
VALUES(:id, :username, :email, :password, :active, :confirmed_at,
|
||||||
|
:masterpass_check, :auth_source, :fs_uniquifier)""")
|
||||||
|
|
||||||
|
db.engine.execute(statement, [
|
||||||
{
|
{
|
||||||
**row,
|
**row,
|
||||||
'fs_uniquifier': uuid.uuid4().hex
|
'fs_uniquifier': uuid.uuid4().hex
|
||||||
|
Loading…
Reference in New Issue
Block a user