Back

Default value for relationships

  • 0
  • Databases
Infinil
28 Jun, 2023, 10:35

Will it be possible to give default values to relationship attributes in future?

TL;DR
The user wants to know if it is possible to set default values for relationship attributes in a database. They mention that currently, when a document is deleted, the field turns to null, but they would like it to have a default ID instead. The user acknowledges that it could cause trouble if the related document is deleted. They are asking if it will be possible to set default values for relationship attributes in the future. Solution: Currently, it seems that setting a default value for relationship attributes is not possible. However, the user suggests automatically setting the default value to null. If the related document is deleted, it may cause issues, so careful
Binyamin
28 Jun, 2023, 13:23

But, what you mean by default? So some relationship attributes will be related to some other document by default?

Infinil
29 Jun, 2023, 12:34

yes

Infinil
29 Jun, 2023, 12:34

i know its trouble if the other doc gets deleted

Infinil
29 Jun, 2023, 12:34

in that case default can be null automatically

Binyamin
29 Jun, 2023, 13:09

For now, for example, you can set that when a document gets deleted then the field will turn to null, And you want it to be some default ID?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more