Skip to content

piccolo migrations new user --auto does not detect changes in user/tables.py #917

Answered by sinisaos
Numbers00 asked this question in Q&A
Discussion options

You must be logged in to vote

@Numbers00 Unfortunately it's not documented, but your custom user app must go after the piccolo_admin.piccolo_app like this

APP_REGISTRY = AppRegistry(
    apps=[
        "app.piccolo.apps.emotion_log.piccolo_app",
        "app.piccolo.apps.trivia.piccolo_app",
        "piccolo_admin.piccolo_app", # you can also safely delete piccolo_admin.app
        "app.piccolo.apps.user.piccolo_app", # <- HERE
    ]
)

because if piccolo_admin.piccolo_app is before the custom user app, migrations don't happen because Piccolo Admin uses the default BaseUser from Piccolo ORM
https://github.com/piccolo-orm/piccolo_admin/blob/7f3383bfd403f07e2af4c3c2fd2437380c41360c/piccolo_admin/endpoints.py#L17
After th…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Numbers00
Comment options

@sinisaos
Comment options

sinisaos Jan 7, 2024
Collaborator

Answer selected by Numbers00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants