bun-query-builder 0.2.3 → 0.2.4

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/bin/cli.js CHANGED
@@ -18389,12 +18389,14 @@ class PostgresDriver {
18389
18389
  const table = this.quoteIdentifier(tableName);
18390
18390
  const name = this.quoteIdentifier(column.name);
18391
18391
  const statements = [
18392
+ `ALTER TABLE ${table} ALTER COLUMN ${name} DROP DEFAULT;`,
18392
18393
  `ALTER TABLE ${table} ALTER COLUMN ${name} TYPE ${typeSql} USING ${name}::${typeSql};`
18393
18394
  ];
18394
18395
  if (!column.isPrimaryKey)
18395
18396
  statements.push(`ALTER TABLE ${table} ALTER COLUMN ${name} ${column.isNullable ? "DROP NOT NULL" : "SET NOT NULL"};`);
18396
18397
  const defaultValue = this.getDefaultValue(column);
18397
- statements.push(defaultValue ? `ALTER TABLE ${table} ALTER COLUMN ${name} SET ${defaultValue};` : `ALTER TABLE ${table} ALTER COLUMN ${name} DROP DEFAULT;`);
18398
+ if (defaultValue)
18399
+ statements.push(`ALTER TABLE ${table} ALTER COLUMN ${name} SET ${defaultValue};`);
18398
18400
  return statements.join(`
18399
18401
  `);
18400
18402
  }
@@ -31462,7 +31464,7 @@ function getPrefix() {
31462
31464
  }
31463
31465
  var prefix = getPrefix();
31464
31466
  // package.json
31465
- var version2 = "0.2.3";
31467
+ var version2 = "0.2.4";
31466
31468
 
31467
31469
  // bin/cli.ts
31468
31470
  init_actions();
package/dist/src/index.js CHANGED
@@ -18388,12 +18388,14 @@ class PostgresDriver {
18388
18388
  const table = this.quoteIdentifier(tableName);
18389
18389
  const name = this.quoteIdentifier(column.name);
18390
18390
  const statements = [
18391
+ `ALTER TABLE ${table} ALTER COLUMN ${name} DROP DEFAULT;`,
18391
18392
  `ALTER TABLE ${table} ALTER COLUMN ${name} TYPE ${typeSql} USING ${name}::${typeSql};`
18392
18393
  ];
18393
18394
  if (!column.isPrimaryKey)
18394
18395
  statements.push(`ALTER TABLE ${table} ALTER COLUMN ${name} ${column.isNullable ? "DROP NOT NULL" : "SET NOT NULL"};`);
18395
18396
  const defaultValue = this.getDefaultValue(column);
18396
- statements.push(defaultValue ? `ALTER TABLE ${table} ALTER COLUMN ${name} SET ${defaultValue};` : `ALTER TABLE ${table} ALTER COLUMN ${name} DROP DEFAULT;`);
18397
+ if (defaultValue)
18398
+ statements.push(`ALTER TABLE ${table} ALTER COLUMN ${name} SET ${defaultValue};`);
18397
18399
  return statements.join(`
18398
18400
  `);
18399
18401
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-query-builder",
3
3
  "type": "module",
4
- "version": "0.2.3",
4
+ "version": "0.2.4",
5
5
  "description": "A simple yet performant query builder for TypeScript. Built with Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",