rake-db 2.3.24 → 2.3.25

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/.env.local CHANGED
@@ -1,2 +1,2 @@
1
- #DATABASE_URL=postgres://postgres:@localhost:5432/porm
2
- DATABASE_URL=postgres://romeerez:e2Y6ovIJruas@ep-autumn-tooth-279704.eu-central-1.aws.neon.tech/neondb?ssl=true
1
+ DATABASE_URL=postgres://postgres:@localhost:5432/porm
2
+ #DATABASE_URL=postgres://romeerez:e2Y6ovIJruas@ep-autumn-tooth-279704.eu-central-1.aws.neon.tech/neondb?ssl=true
@@ -2,21 +2,21 @@
2
2
  > rake-db@2.3.24 test:ci /home/romeo/dev/my/orchid-orm/packages/rake-db
3
3
  > jest --coverage --coverageReporters json-summary
4
4
 
5
- PASS src/migration/changeTable.test.ts
6
- PASS src/migration/createTable.test.ts
7
5
  PASS src/commands/createOrDrop.test.ts
8
- PASS src/pull/structureToAst.test.ts
9
6
  PASS src/common.test.ts
10
- PASS src/migration/migration.test.ts
7
+ PASS src/migration/changeTable.test.ts
8
+ PASS src/pull/structureToAst.test.ts
11
9
  PASS src/commands/migrateOrRollback.test.ts
10
+ PASS src/migration/migration.test.ts
11
+ PASS src/migration/createTable.test.ts
12
+ PASS src/pull/astToMigration.test.ts
12
13
  PASS src/commands/generate.test.ts
13
- PASS src/rakeDb.test.ts
14
14
  PASS src/pull/pull.test.ts
15
+ PASS src/rakeDb.test.ts
15
16
  PASS src/pull/dbStructure.test.ts
16
- PASS src/pull/astToMigration.test.ts
17
17
 
18
18
  Test Suites: 12 passed, 12 total
19
19
  Tests: 184 passed, 184 total
20
20
  Snapshots: 0 total
21
- Time: 4.744 s
21
+ Time: 6.736 s
22
22
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # rake-db
2
2
 
3
+ ## 2.3.25
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - pqb@0.9.14
9
+
3
10
  ## 2.3.24
4
11
 
5
12
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ declare type ChangeOptions = {
15
15
  };
16
16
  declare type TableChangeMethods = typeof tableChangeMethods;
17
17
  declare const tableChangeMethods: {
18
- raw: (sql: string, values?: false | Record<string, unknown> | undefined) => RawExpression<ColumnType<unknown, pqb.Operators, unknown>>;
18
+ raw: (sql: string, values?: false | Record<string, unknown> | undefined) => RawExpression<ColumnType<unknown, pqb.BaseOperators, unknown>>;
19
19
  add: typeof add;
20
20
  drop: typeof add;
21
21
  change(from: ColumnType | Change, to: ColumnType | Change, options?: ChangeOptions): Change;
@@ -139,8 +139,8 @@ declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, op
139
139
  record: typeof pqb.record;
140
140
  }) => Type)) => pqb.JSONColumn<Type>;
141
141
  jsonText: () => pqb.JSONTextColumn;
142
- array: <Item extends ColumnType<unknown, pqb.Operators, unknown>>(item: Item) => pqb.ArrayColumn<Item>;
143
- timestamps: <T_14 extends ColumnType<unknown, pqb.Operators, unknown>>(this: {
142
+ array: <Item extends ColumnType<unknown, pqb.BaseOperators, unknown>>(item: Item) => pqb.ArrayColumn<Item>;
143
+ timestamps: <T_14 extends ColumnType<unknown, pqb.BaseOperators, unknown>>(this: {
144
144
  timestamp(): T_14;
145
145
  }) => {
146
146
  createdAt: T_14 & {
@@ -238,8 +238,8 @@ declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, op
238
238
  record: typeof pqb.record;
239
239
  }) => Type)) => pqb.JSONColumn<Type>;
240
240
  jsonText: () => pqb.JSONTextColumn;
241
- array: <Item extends ColumnType<unknown, pqb.Operators, unknown>>(item: Item) => pqb.ArrayColumn<Item>;
242
- timestamps: <T_14 extends ColumnType<unknown, pqb.Operators, unknown>>(this: {
241
+ array: <Item extends ColumnType<unknown, pqb.BaseOperators, unknown>>(item: Item) => pqb.ArrayColumn<Item>;
242
+ timestamps: <T_14 extends ColumnType<unknown, pqb.BaseOperators, unknown>>(this: {
243
243
  timestamp(): T_14;
244
244
  }) => {
245
245
  createdAt: T_14 & {
@@ -336,8 +336,8 @@ declare const createMigrationInterface: (tx: TransactionAdapter, up: boolean, op
336
336
  record: typeof pqb.record;
337
337
  }) => Type)) => pqb.JSONColumn<Type>;
338
338
  jsonText: () => pqb.JSONTextColumn;
339
- array: <Item extends ColumnType<unknown, pqb.Operators, unknown>>(item: Item) => pqb.ArrayColumn<Item>;
340
- timestamps: <T_14 extends ColumnType<unknown, pqb.Operators, unknown>>(this: {
339
+ array: <Item extends ColumnType<unknown, pqb.BaseOperators, unknown>>(item: Item) => pqb.ArrayColumn<Item>;
340
+ timestamps: <T_14 extends ColumnType<unknown, pqb.BaseOperators, unknown>>(this: {
341
341
  timestamp(): T_14;
342
342
  }) => {
343
343
  createdAt: T_14 & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rake-db",
3
- "version": "2.3.24",
3
+ "version": "2.3.25",
4
4
  "description": "Migrations tool for Postgresql DB",
5
5
  "homepage": "https://orchid-orm.netlify.app/guide/migration-setup-and-overview.html",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "license": "ISC",
42
42
  "dependencies": {
43
43
  "pluralize": "^8.0.0",
44
- "pqb": "0.9.13",
44
+ "pqb": "0.9.14",
45
45
  "prompts": "^2.4.2"
46
46
  },
47
47
  "devDependencies": {
@@ -65,7 +65,8 @@
65
65
  },
66
66
  "scripts": {
67
67
  "db": "ts-node -r tsconfig-paths/register app/dbScript.ts",
68
- "test": "jest",
68
+ "test": "jest --watch --verbose false",
69
+ "check": "jest",
69
70
  "test:ci": "jest --coverage --coverageReporters json-summary",
70
71
  "build": "rimraf ./dist/ && rollup -c --rollup.config"
71
72
  }
@@ -1,5 +1,5 @@
1
1
  import { generate } from './generate';
2
- import { migrationConfigDefaults } from '../common';
2
+ import { migrationConfigDefaults, RakeDbConfig } from '../common';
3
3
  import { mkdir, writeFile } from 'fs/promises';
4
4
  import path from 'path';
5
5
 
@@ -13,9 +13,14 @@ console.log = logMock;
13
13
 
14
14
  const migrationsPath = migrationConfigDefaults.migrationsPath;
15
15
 
16
+ const config: RakeDbConfig = {
17
+ ...migrationConfigDefaults,
18
+ basePath: __dirname,
19
+ };
20
+
16
21
  const testGenerate = async (args: string[], content: string) => {
17
22
  const name = args[0];
18
- await generate(migrationConfigDefaults, args);
23
+ await generate(config, args);
19
24
 
20
25
  expect(mkdir).toHaveBeenCalledWith(migrationsPath, { recursive: true });
21
26
 
@@ -32,9 +37,7 @@ describe('generate', () => {
32
37
  });
33
38
 
34
39
  it('should throw if migration name is not provided', async () => {
35
- expect(generate(migrationConfigDefaults, [])).rejects.toThrow(
36
- 'Migration name is missing',
37
- );
40
+ expect(generate(config, [])).rejects.toThrow('Migration name is missing');
38
41
  });
39
42
 
40
43
  it('should create a file for create table migration', async () => {