Django.db.utils.ProgrammingError: cannot cast type date to integer

I am getting following error when trying to deploy my application to

django.db.utils.ProgrammingError: cannot cast type date to integer
LINE 1: ...ts" ALTER COLUMN "month" TYPE integer USING "month"::integer

As this is new for me, no idea what to correct as there is no link to file, row. etc.

And I have only one field with month in my models - mm field in MonthlyCosts:

class MonthlyCosts(models.Model):

    y = int(
    y1 = y - 1
    year_selection = (
        (y, y),
        (y1, y1),

    months_selection = (
        (1, 'January'),
        (2, 'February'),
        (3, 'March'),
        (4, 'April'), 
        (5, 'May'),
        (6, 'June'),
        (7, 'July'),
        (8, 'August'),
        (9, 'September'),
        (10, 'October'),
        (11, 'November'),
        (12, 'December')

    year = models.IntegerField("Year", choices=year_selection)
    mm = models.IntegerField("Month", choices=months_selection)

But it is the integer, so why mentioning type "date"? Then I am using column "month" in pandas tables which are part of functions for particular views, but there are also int or str types, no date. So no idea what this error means.

Thanks a lot for help.

Back to Top