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

add database table column default value #2803

Closed
wants to merge 2 commits into from
Closed

add database table column default value #2803

wants to merge 2 commits into from

Conversation

b40yd
Copy link

@b40yd b40yd commented Nov 2, 2023

In special scenarios, data is not written through Peewee, and there are compatibility issues with writing data.

for example:

Mainly rolled back after software version upgrade, without deleting new fields,
without default values can result in data write failure.

E.g:

class DemoModel(Model):
    name = CharField()
    new_demo_test = IntegerField(default=0)
    
    class Meta:
        database = database
        table_name = 'demo'

coleifer added a commit that referenced this pull request Nov 2, 2023
@coleifer
Copy link
Owner

coleifer commented Nov 2, 2023

This patch was missing tests, docs and compatibility w/MySQL and Sqlite. See 7e2c227

@coleifer coleifer closed this Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants