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

[Need a fix] Migrations fails when date column's default is specified as None #39

Closed
dashsatish opened this issue Jan 8, 2021 · 2 comments · Fixed by #40
Closed

[Need a fix] Migrations fails when date column's default is specified as None #39

dashsatish opened this issue Jan 8, 2021 · 2 comments · Fixed by #40

Comments

@dashsatish
Copy link

Hi,
When column type is Date(null=True, default=None). Migration fails!

Snippet:

Running migrations ...
All migration ids = ['2020-12-15T18:55:12', '2020-12-16T19:54:32', '2020-12-17T10:58:36', '2020-12-17T16:01:04', '2020-12-17T16:15:15', '2020-12-17T16:19:27', '2020-12-17T20:23:06', '2020-12-22T16:44:03', '2021-01-05T13:56:22', '2021-01-07T19:52:45', '2021-01-08T12:52:56', '2021-01-08T21:26:24', '2021-01-08T22:05:10']
Haven't run = ['2021-01-08T22:05:10']
Running MigrationManager ...
The command failed.
syntax error at or near "DEFAULT"

Content of migration file that failed:

manager.alter_column(
        table_class_name="Summary",
        tablename="summary",
        column_name="due_date",
        params={"default": None},
        old_params={"default": DateNow()},
    )
@dantownsend
Copy link
Member

@dashsatish Thanks for reporting this. There's an error in the SQL generated by the migration. I've got a fix, and will release it soon.

@dantownsend
Copy link
Member

@dashsatish It's fixed now - v0.14.13 on PyPI. Thanks!

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 a pull request may close this issue.

2 participants