casker-cli 1.0.2 → 1.0.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/shared/infrastructure/config/data-source.d.ts.map +1 -1
- package/dist/shared/infrastructure/config/data-source.js +5 -1
- package/dist/shared/infrastructure/config/data-source.js.map +1 -1
- package/dist/shared/presentation/hooks/init/DataSourceInitialize.d.ts.map +1 -1
- package/dist/shared/presentation/hooks/init/DataSourceInitialize.js +2 -0
- package/dist/shared/presentation/hooks/init/DataSourceInitialize.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-source.d.ts","sourceRoot":"","sources":["../../../../src/shared/infrastructure/config/data-source.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"data-source.d.ts","sourceRoot":"","sources":["../../../../src/shared/infrastructure/config/data-source.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,eAAO,MAAM,aAAa,YAWxB,CAAC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import { DataSource } from 'typeorm';
|
|
3
3
|
import { BackupResultModel } from '../../../backup/infrastructure/persistance/entities/BackupResultModel.js';
|
|
4
|
+
import path from 'node:path';
|
|
4
5
|
export const AppDataSource = new DataSource({
|
|
5
6
|
type: 'better-sqlite3',
|
|
6
7
|
database: 'casker',
|
|
7
8
|
synchronize: false,
|
|
8
9
|
logging: false,
|
|
9
10
|
entities: [BackupResultModel],
|
|
10
|
-
migrations: [
|
|
11
|
+
migrations: [
|
|
12
|
+
path.join(import.meta.dirname, '../../../backup/infrastructure/persistance/migrations/*.js'),
|
|
13
|
+
],
|
|
14
|
+
migrationsRun: true,
|
|
11
15
|
subscribers: [],
|
|
12
16
|
});
|
|
13
17
|
//# sourceMappingURL=data-source.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-source.js","sourceRoot":"","sources":["../../../../src/shared/infrastructure/config/data-source.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0EAA0E,CAAC;
|
|
1
|
+
{"version":3,"file":"data-source.js","sourceRoot":"","sources":["../../../../src/shared/infrastructure/config/data-source.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0EAA0E,CAAC;AAC7G,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,UAAU,CAAC;IAC1C,IAAI,EAAE,gBAAgB;IACtB,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,CAAC,iBAAiB,CAAC;IAC7B,UAAU,EAAE;QACV,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,4DAA4D,CAAC;KAC7F;IACD,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,EAAE;CAChB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataSourceInitialize.d.ts","sourceRoot":"","sources":["../../../../../src/shared/presentation/hooks/init/DataSourceInitialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"DataSourceInitialize.d.ts","sourceRoot":"","sources":["../../../../../src/shared/presentation/hooks/init/DataSourceInitialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,MAAM,CAKtB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -2,6 +2,8 @@ import { AppDataSource } from '../../../infrastructure/config/data-source.js';
|
|
|
2
2
|
const hook = async function () {
|
|
3
3
|
await AppDataSource.initialize();
|
|
4
4
|
await AppDataSource.runMigrations();
|
|
5
|
+
console.log(AppDataSource.options.database, AppDataSource.isInitialized);
|
|
6
|
+
console.log('hook done, initialized:', AppDataSource.isInitialized);
|
|
5
7
|
};
|
|
6
8
|
export default hook;
|
|
7
9
|
//# sourceMappingURL=DataSourceInitialize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataSourceInitialize.js","sourceRoot":"","sources":["../../../../../src/shared/presentation/hooks/init/DataSourceInitialize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAE9E,MAAM,IAAI,GAAiB,KAAK;IAC9B,MAAM,aAAa,CAAC,UAAU,EAAE,CAAC;IACjC,MAAM,aAAa,CAAC,aAAa,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"DataSourceInitialize.js","sourceRoot":"","sources":["../../../../../src/shared/presentation/hooks/init/DataSourceInitialize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAE9E,MAAM,IAAI,GAAiB,KAAK;IAC9B,MAAM,aAAa,CAAC,UAAU,EAAE,CAAC;IACjC,MAAM,aAAa,CAAC,aAAa,EAAE,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;AACtE,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "casker-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "A database backup CLI",
|
|
5
5
|
"main": "./src/shared/presentation/bin/run.js",
|
|
6
6
|
"scripts": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"flagSortOrder": "none"
|
|
93
93
|
},
|
|
94
94
|
"hooks": {
|
|
95
|
-
"init": ["./dist/shared/presentation/hooks/init/
|
|
95
|
+
"init": ["./dist/shared/presentation/hooks/init/DataSourceInitialize"]
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|