Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use schema migrations #54

Open
cubranic opened this issue Jul 26, 2018 · 4 comments
Open

Use schema migrations #54

cubranic opened this issue Jul 26, 2018 · 4 comments
Labels
db For database changes (schema migrations)

Comments

@cubranic
Copy link
Contributor

Docs: http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#schema-migrations

@ketiltrout
Copy link
Member

Is there no way to make new tables?

@cubranic
Copy link
Contributor Author

I suppose it's part of the core Database/Model API (http://docs.peewee-orm.com/en/latest/peewee/models.html#creating-model-tables):

# Connect to our database.
db.connect()

# Create the tables.
db.create_tables([User, Tweet])

It would be nice to be versioned, though. Maybe we should get some clarification from Peewee's author?

@ketiltrout
Copy link
Member

Ah, so the schema-migration module just provides the SQL metadata-altering statements not in base peewee. That makes sense.

My reading of the playhouse docs is that schema versioning is left to the user, which I think is fine.

@cubranic
Copy link
Contributor Author

cubranic commented Aug 6, 2018

And there is this third-party project to provide a "real" migrations framework for Peewee: https://github.com/klen/peewee_migrate

@ketiltrout ketiltrout added the db For database changes (schema migrations) label Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db For database changes (schema migrations)
Projects
None yet
Development

No branches or pull requests

2 participants