Modify

Ticket #151 (closed defect: wontfix)

Opened 5 years ago

Last modified 5 years ago

Auto resets my databases default for datetime values everytime I migrate

Reported by: erik@… Owned by: andrew
Priority: major Milestone: 0.6
Component: migrations Version: 0.6-pre
Keywords: default auto Cc:

Description

Hi,

Everytime I run an "auto" migration, South updates my DateTimeField? default value in my database to the current datetime.

My model is setup like this:
created = models.DateTimeField?(default=datetime.datetime.now, editable=False)

South should ignore the default in this case.

Attachments

example.py (1.6 KB) - added by erik@… 5 years ago.

Change History

comment:1 Changed 5 years ago by andrew

  • Status changed from new to assigned

Do you mean it makes a migration with alter_column in it each time? Could you attach one?

comment:2 Changed 5 years ago by andrew

  • Milestone set to 0.6

Changed 5 years ago by erik@…

comment:3 Changed 5 years ago by andrew

  • Status changed from assigned to closed
  • Resolution set to wontfix

We won't fix this, as we don't like special cases. The recommended fix is to use auto_now or auto_now_add, or a pre_save signal.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.