Best practice for migrations and null?

Posted 1 year ago by ChrisF79

I'm creating my real estate site and am very new to this but loving it. I'm pulling data down from my local board of Realtors and they have fields like "CloseDate" for properties. However, if the property hasn't closed, that field is the old MySQL format of 0000-00-0000 or whatever that was. Then, I have fields that are like "GuestHouseSqFt" but if the property doesn't have a guest house, that's empty.

With that being said, do I just go through each field and mark them in my migration as ->nullable()?

What do I do about DATETIME fields?

Please sign in or create an account to participate in this conversation.