rake-db 2.31.0 → 2.31.1

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.mjs CHANGED
@@ -1,6 +1,7 @@
1
- import { singleQuote, makeColumnTypes, defaultSchemaConfig, isRawSQL, escapeForMigration, ArrayColumn, toSnakeCase, toCamelCase, DomainColumn, toArray, EnumColumn, snakeCaseKey, getColumnTypes, parseTableData, emptyObject, escapeString, tableDataMethods, setCurrentColumnName, consumeColumnName, Column, parseTableDataInput, UnknownColumn, setDefaultLanguage, deepCompare, raw, logParamToLogObject, createDbWithAdapter, getImportPath, pathToLog, emptyArray, colors, exhaustive, codeToString, addCode, quoteObjectKey, pushTableDataCode, rawSqlToCode, primaryKeyInnerToCode, indexInnerToCode, excludeInnerToCode, constraintInnerToCode, referencesArgsToCode, backtickQuote, TimestampTZColumn, TimestampColumn, makeColumnsByType, RawSql, CustomTypeColumn, assignDbDataToColumn, PostgisGeographyPointColumn, getStackTrace } from 'pqb/internal';
1
+ import { singleQuote, makeColumnTypes, defaultSchemaConfig, isRawSQL, escapeForMigration, ArrayColumn, toSnakeCase, toCamelCase, DomainColumn, toArray, EnumColumn, snakeCaseKey, getColumnTypes, parseTableData, emptyObject, escapeString, tableDataMethods, setDefaultLanguage, consumeColumnName, setCurrentColumnName, Column, parseTableDataInput, UnknownColumn, deepCompare, raw, logParamToLogObject, getImportPath, pathToLog, emptyArray, colors, exhaustive, codeToString, addCode, backtickQuote, rawSqlToCode, referencesArgsToCode, quoteObjectKey, primaryKeyInnerToCode, indexInnerToCode, excludeInnerToCode, constraintInnerToCode, pushTableDataCode, TimestampTZColumn, TimestampColumn, RawSql, CustomTypeColumn, assignDbDataToColumn, makeColumnsByType, PostgisGeographyPointColumn, getStackTrace } from 'pqb/internal';
2
2
  import path, { join } from 'path';
3
3
  import { pathToFileURL, fileURLToPath } from 'node:url';
4
+ import { createDbWithAdapter } from 'pqb';
4
5
  import fs, { mkdir, writeFile, readdir, stat, readFile } from 'fs/promises';
5
6
  import path$1 from 'node:path';
6
7
 
@@ -158,7 +159,6 @@ const columnToSql = (schema, name, item, values, hasMultiplePrimaryKeys, snakeCa
158
159
  referencesToSql(
159
160
  schema,
160
161
  {
161
- columns: [name],
162
162
  ...foreignKey
163
163
  },
164
164
  snakeCase
@@ -2280,7 +2280,6 @@ class Migration {
2280
2280
  enumName
2281
2281
  );
2282
2282
  const ast = {
2283
- type: "renameEnumValues",
2284
2283
  schema,
2285
2284
  name,
2286
2285
  values
@@ -2696,10 +2695,7 @@ const addCheck = (migration, up, tableName, check) => {
2696
2695
  };
2697
2696
  const createSchema$1 = async (migration, up, name) => {
2698
2697
  const ast = {
2699
- type: "schema",
2700
- action: up ? "create" : "drop",
2701
- name
2702
- };
2698
+ action: up ? "create" : "drop"};
2703
2699
  await migration.adapter.query(
2704
2700
  `${ast.action === "create" ? "CREATE" : "DROP"} SCHEMA "${name}"`
2705
2701
  );
@@ -2710,7 +2706,6 @@ const createExtension = async (migration, up, fullName, options) => {
2710
2706
  fullName
2711
2707
  );
2712
2708
  const ast = {
2713
- type: "extension",
2714
2709
  action: up ? "create" : "drop",
2715
2710
  schema,
2716
2711
  name,
@@ -2730,11 +2725,9 @@ const createEnum = async (migration, up, name, values, options = {}) => {
2730
2725
  name
2731
2726
  );
2732
2727
  const ast = {
2733
- type: "enum",
2734
2728
  action: up ? "create" : "drop",
2735
2729
  schema,
2736
2730
  name: enumName,
2737
- values,
2738
2731
  ...options
2739
2732
  };
2740
2733
  let query;
@@ -2752,7 +2745,6 @@ const createDomain = async (migration, up, name, fn) => {
2752
2745
  name
2753
2746
  );
2754
2747
  const ast = {
2755
- type: "domain",
2756
2748
  action: up ? "create" : "drop",
2757
2749
  schema,
2758
2750
  name: domainName,
@@ -2785,7 +2777,6 @@ const createCollation = async (migration, up, name, options) => {
2785
2777
  name
2786
2778
  );
2787
2779
  const ast = {
2788
- type: "collation",
2789
2780
  action: up ? "create" : "drop",
2790
2781
  schema,
2791
2782
  name: collationName,
@@ -2831,7 +2822,6 @@ const renameType = async (migration, from, to, kind) => {
2831
2822
  migration.up ? to : from
2832
2823
  );
2833
2824
  const ast = {
2834
- type: "renameType",
2835
2825
  kind,
2836
2826
  fromSchema,
2837
2827
  from: f,
@@ -2870,7 +2860,6 @@ const addOrDropEnumValues = async (migration, up, enumName, values, options) =>
2870
2860
  );
2871
2861
  const quotedName = quoteTable(schema, name);
2872
2862
  const ast = {
2873
- type: "enumValues",
2874
2863
  action: up ? "add" : "drop",
2875
2864
  schema,
2876
2865
  name,
@@ -2913,10 +2902,8 @@ const changeEnumValues = async (migration, enumName, fromValues, toValues) => {
2913
2902
  toValues = values;
2914
2903
  }
2915
2904
  const ast = {
2916
- type: "changeEnumValues",
2917
2905
  schema,
2918
2906
  name,
2919
- fromValues,
2920
2907
  toValues
2921
2908
  };
2922
2909
  await recreateEnum(