Skip to content

Table field default value 0 or "" isn't interpreted as a default value #4700

@TouhoHH

Description

@TouhoHH

When adding a new field to a table that has data and the default value is a number 0 or empty string for the new field, spacetimedb checks if (defaultValue) and refuses to merge because there is no default value.

I found this from the library:

if (meta.defaultValue) {
      const writer = new BinaryWriter(16);
      builder.serialize(writer, meta.defaultValue);
      defaultValues.push({
        colId: colIds.get(name)!,
        value: writer.getBuffer(),
      });
    }

Should check if (meta.defaultValue !== undefined) or something.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions