rake-db 2.3.0 → 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 +8 -0
- package/db.ts +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +680 -146
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +679 -144
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/generate.ts +14 -6
- package/src/common.ts +14 -3
- package/src/pull/astToMigration.test.ts +115 -0
- package/src/pull/astToMigration.ts +65 -0
- package/src/pull/pull.test.ts +92 -0
- package/src/pull/pull.ts +18 -0
- package/src/pull/structureToAst.test.ts +65 -0
- package/src/pull/structureToAst.ts +40 -2
- package/src/rakeDb.test.ts +100 -0
- package/src/rakeDb.ts +4 -1
package/CHANGELOG.md
CHANGED
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(
|
|
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:
|
|
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
|
@@ -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 };
|