fix: Author the column default an upsert writes for a null foreign key (#164)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in:
Marcelo Mendonça Soares 2026-10-08 22:48:47 -03:00 • committed by GitHub
commit ee000e348c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,68 @@
{
"__className__": "serverpod.DatabaseMigration",
"actions": [
{
"__className__": "serverpod.DatabaseMigrationAction",
"type": "alterTable",
"alterTable": {
"__className__": "serverpod.TableMigration",
"name": "unique_set_default_child",
"schema": "public",
"addColumns": [],
"deleteColumns": [],
"modifyColumns": [],
"addIndexes": [
{
"__className__": "serverpod.IndexDefinition",
"indexName": "unique_set_default_child_name",
"elements": [
{
"__className__": "serverpod.IndexElementDefinition",
"type": 0,
"definition": "spaceId"
},
{
"__className__": "serverpod.IndexElementDefinition",
"type": 0,
"definition": "name"
}
],
"type": "btree",
"isUnique": true,
"isPrimary": false
}
],
"deleteIndexes": [],
"addForeignKeys": [],
"deleteForeignKeys": [],
"warnings": [
{
"__className__": "serverpod.DatabaseMigrationWarning",
"type": "uniqueIndexCreated",
"message": "Unique index \"unique_set_default_child_name\" is added to table \"unique_set_default_child\". If there are existing rows with duplicate values, this migration will fail.",
"table": "unique_set_default_child",
"columns": [
"spaceId",
"name"
],
"destrucive": false
}
]
}
}
],
"warnings": [
{
"__className__": "serverpod.DatabaseMigrationWarning",
"type": "uniqueIndexCreated",
"message": "Unique index \"unique_set_default_child_name\" is added to table \"unique_set_default_child\". If there are existing rows with duplicate values, this migration will fail.",
"table": "unique_set_default_child",
"columns": [
"spaceId",
"name"
],
"destrucive": false
}
],
"migrationApiVersion": 1
}