rake-db 2.2.6 → 2.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # rake-db
2
2
 
3
+ ## 2.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Add command for pulling database structure into a migration
8
+ - Updated dependencies
9
+ - pqb@0.9.1
10
+
11
+ ## 2.3.0
12
+
13
+ ### Minor Changes
14
+
15
+ - Change index options: column or expression is required, operator renamed to opclass
16
+
17
+ ### Patch Changes
18
+
19
+ - f1cd5db: Handle multiple indexes and foreignKeys of the column
20
+ - Updated dependencies
21
+ - Updated dependencies [f1cd5db]
22
+ - pqb@0.9.0
23
+
3
24
  ## 2.2.6
4
25
 
5
26
  ### Patch Changes
package/db.ts CHANGED
@@ -4,7 +4,7 @@ import { rakeDb } from './src/rakeDb';
4
4
  import { AdapterOptions } from 'pqb';
5
5
  import { appCodeUpdater } from '../orm/src';
6
6
 
7
- config({ path: path.resolve(process.cwd(), '.env.local') });
7
+ config({ path: path.resolve('.env.local') });
8
8
  config();
9
9
 
10
10
  const options: AdapterOptions[] = [];
@@ -22,7 +22,7 @@ if (databaseURLTest) {
22
22
  }
23
23
 
24
24
  rakeDb(options, {
25
- migrationsPath: path.resolve(process.cwd(), 'migrations'),
25
+ migrationsPath: 'migrations',
26
26
  appCodeUpdater: appCodeUpdater({
27
27
  tablePath: (tableName) => `app/tables/${tableName}.ts`,
28
28
  baseTablePath: 'app/lib/baseTable.ts',
package/dist/index.d.ts CHANGED
@@ -156,11 +156,11 @@ declare namespace RakeDbAst {
156
156
  comment?: string | null;
157
157
  compression?: string;
158
158
  primaryKey?: boolean;
159
- foreignKey?: {
159
+ foreignKeys?: ({
160
160
  table: string;
161
161
  columns: string[];
162
- } & ForeignKeyOptions;
163
- index?: Omit<SingleColumnIndexOptions, 'column'>;
162
+ } & ForeignKeyOptions)[];
163
+ indexes?: Omit<SingleColumnIndexOptions, 'column' | 'expression'>[];
164
164
  };
165
165
  type RenameTable = {
166
166
  type: 'renameTable';
@@ -204,6 +204,7 @@ declare const createDb: (arg: MaybeArray<AdapterOptions>, config: RakeDbConfig)
204
204
  declare const dropDb: (arg: MaybeArray<AdapterOptions>) => Promise<void>;
205
205
  declare const resetDb: (arg: MaybeArray<AdapterOptions>, config: RakeDbConfig) => Promise<void>;
206
206
 
207
+ declare const writeMigrationFile: (config: RakeDbConfig, name: string, content: string) => Promise<void>;
207
208
  declare const generate: (config: RakeDbConfig, args: string[]) => Promise<void>;
208
209
 
209
210
  declare const migrate: (options: MaybeArray<AdapterOptions>, config: RakeDbConfig, args?: string[]) => Promise<void>;
@@ -214,4 +215,4 @@ declare const change: (fn: ChangeCallback) => void;
214
215
 
215
216
  declare const rakeDb: (options: MaybeArray<AdapterOptions>, partialConfig?: Partial<RakeDbConfig>, args?: string[]) => Promise<void>;
216
217
 
217
- export { AppCodeUpdater, ChangeTableCallback, ChangeTableOptions, ColumnComment, ColumnsShapeCallback, DropMode, ExtensionOptions, JoinTableOptions, Migration, MigrationColumnTypes, RakeDbAst, RakeDbConfig, TableOptions, change, createDb, dropDb, generate, migrate, rakeDb, resetDb, rollback, runCodeUpdater };
218
+ export { AppCodeUpdater, ChangeTableCallback, ChangeTableOptions, ColumnComment, ColumnsShapeCallback, DropMode, ExtensionOptions, JoinTableOptions, Migration, MigrationColumnTypes, RakeDbAst, RakeDbConfig, TableOptions, change, createDb, dropDb, generate, migrate, rakeDb, resetDb, rollback, runCodeUpdater, writeMigrationFile };