@mastra/pg 1.17.0-alpha.3 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -20596,6 +20596,10 @@ var PgFactoryStorage = class extends FactoryStorage {
20596
20596
  for (const [name, spec] of Object.entries(schema.columns)) {
20597
20597
  await this.#pool.query(`ALTER TABLE "${schema.name}" ADD COLUMN IF NOT EXISTS ${this.#columnDdl(name, spec)}`);
20598
20598
  }
20599
+ for (const [name, spec] of Object.entries(schema.columns)) {
20600
+ if (!spec.nullable || spec.type === "uuid-pk" || spec.primaryKey) continue;
20601
+ await this.#pool.query(`ALTER TABLE "${schema.name}" ALTER COLUMN "${name}" DROP NOT NULL`);
20602
+ }
20599
20603
  for (const index of schema.uniqueIndexes ?? []) {
20600
20604
  assertIdentifier("index", index.name);
20601
20605
  index.columns.forEach((column) => assertIdentifier("column", column));