Defining a field as NULL or NOT NULL

Hello,

How can I define a field as nullable or not nullable?

Great tool btw!

Thanks!

Thank you, glad you like it!

Alrd added it into our roadmap!

Nice!

Thank you very much :slight_smile:

Hi there, is there a specific date for this feature release?

Kind Regards,
SK

Hi @skuang and @Art_Rodriguez, sorry for the long wait. We’ve actually just released this feature. Example code:

Table orders {
  id int [primary key]
  user_id int [not null]
  status varchar
  created_at varchar [null]
}

Let me know if this works for you?

null does not work with mysql timestamp

Hi @Edilson_Silva, thank you for your feedback. I’m Khoa from dbdiagram team, can you explain more about the problem you are having so that we can support you better?

I have a problem with timestamp too. Actually I never had the need to define any other field as NULL, but for timestamp is necessary in order to make it default: NULL.
I wrote "column" timestamp [null, default: null] and I expected the result (in MySQL) to be 'column' timestamp NULL DEFAULT NULL but it was 'column timestamp DEFAULT NULL without the attribute.
I haven’t test with any other type, but the not null specification worked, for me.
Is there a solution?