diff --git a/server/postgres/migrations/txSchema.sql b/server/postgres/migrations/txSchema.sql index 8c93d6f35d..8818157fa8 100644 --- a/server/postgres/migrations/txSchema.sql +++ b/server/postgres/migrations/txSchema.sql @@ -2,9 +2,6 @@ ALTER TABLE tx ADD "objectSpace" text, ADD "objectId" text; -ALTER TABLE tx -DROP COLUMN "attachedTo"; - UPDATE tx SET "objectId" = (data->>'objectId'); @@ -12,4 +9,10 @@ UPDATE tx SET "objectSpace" = (data->>'objectSpace'); ALTER TABLE tx -ALTER COLUMN "objectSpace" SET NOT NULL; \ No newline at end of file +ALTER COLUMN "objectSpace" SET NOT NULL; + +ALTER TABLE tx +ADD "attachedTo" text; + +UPDATE tx +SET "attachedTo" = (data->>'attachedTo'); \ No newline at end of file diff --git a/server/postgres/src/schemas.ts b/server/postgres/src/schemas.ts index 0a3e482db0..65086348d0 100644 --- a/server/postgres/src/schemas.ts +++ b/server/postgres/src/schemas.ts @@ -86,7 +86,7 @@ const spaceSchema: Schema = { } const txSchema: Schema = { - ...baseSchema, + ...defaultSchema, objectSpace: { type: 'text', notNull: true,