Default values? [Feb 05]

:raising_hand_man: Shard asked

Where are the default values assigned to columns used? I have a datetime field and have specified now() as the default value, but neither form view or the table view add the current datetime automatically.

:raising_hand_man: Shard replied

I also tried submitting the form with empty field, thinking maybe the default value would be used then, but it just got submitted empty

:person_tipping_hand: o1lab replied

Could u pls check if default values is stored in schema using another tool. If not you can raise an issue on it.

:raising_hand_man: Shard replied

Here is a postgres query into the schema:

:raising_hand_man: Shard replied

default value seems to be correctly now()

:raising_hand_man: Shard replied

This is how the form looks when you open it:

:person_tipping_hand: o1lab replied

Ah this is MySQL?

:raising_hand_man: Shard replied

The database I use is PostgreSQL, if that is what you meant

:person_tipping_hand: o1lab replied

Alright

:raising_hand_man: Shard replied

Also I noticed that the “Option” field even though the type of it is text, I can only use integers as Default value. But even then it doesn’t work.

:person_tipping_hand: o1lab replied

Click on fields and enable system fields

:person_tipping_hand: o1lab replied

And see if it shows up

:person_tipping_hand: o1lab replied

I sense we aren’t showing timestamps which have now()

:person_tipping_hand: o1lab replied

But it’s a bug that now() is not being inserted

:person_tipping_hand: o1lab replied

So pls raise an issue

:raising_hand_man: Shard replied

With system fields enabled (and these options ticked) I do see this:

:raising_hand_man: Shard replied

But those fields do not appear in form at all

:raising_hand_man: Shard replied

Ok, will submit an issue. Do you know if the options column is also broken then?

:person_tipping_hand: o1lab replied

Yes

:raising_hand_man: Shard replied

Ok, so essentially all default values are broken