tables
tables copied to clipboard
Column with default value is not stored correctly
Steps to reproduce
1.Have a got a existing table with existing columns and rows. 2.Add a column with a default value (in my case a column called "counter" with default value 1, 0 decimals, min and max = 1) 3.The value is shown in every row but is not accessible when exporting to csv / analytics app.
Expected behavior
If a column has got a default value, which is also shown visually, the value must be exported at any time.
Actual behavior
The default value is shown visually in every existing row. But if you export the data to csv or Analytics app (in next cloud), the value only is shown in rows which were added after the column has been added.
Tables app version
No response
Browser
No response
Client operating system
No response
Operating system
No response
Web server
None
PHP engine version
None
Database
None
Additional info
No response
I think it is intended to not set a value when the default is left, but not entirely sure. @enjeck Do you know?
The thing then is that when returning the data, default values are not submitted, so the current default of the column applies. This is of course not so useful when exporting or sending it elsewhere. I suppose we could send the value… but then the client like the front end would not know it is a default, but a properly stored value. Perhaps another flag in the response data can give this clarity.
If we want to use Nextcloud/Tables with another Nextcloud app such as Analytics - which looks as an obvious use case to me - we definitely need default values stored when a line is created. It's actually the way databases works.