Skip to content

Create table automatically #7

@harshitsinghai77

Description

@harshitsinghai77

In the article you're creating the table manually.

It might be more convenient to do it automatically when the code is run.

In the main.py maybe replace this ?

register_tortoise(
    app,
    config=DB_CONFIG,
    generate_schemas=False,
)

with

register_tortoise(
    app,
    config=DB_CONFIG,
    generate_schemas=True,
)

Not sure why
generate_schemas=False ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions