@wisemen/datewise 0.1.1 → 0.1.2

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.
@@ -3,3 +3,4 @@ export * from './timezone.js';
3
3
  export * from './date-period.enum.js';
4
4
  export * from './typeorm/index.js';
5
5
  export * from './constants.js';
6
+ export { getMigration } from './migration.js';
@@ -3,4 +3,5 @@ export * from './timezone.js';
3
3
  export * from './date-period.enum.js';
4
4
  export * from './typeorm/index.js';
5
5
  export * from './constants.js';
6
+ export { getMigration } from './migration.js';
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,4 @@
1
+ export declare function getMigration(schema: string): {
2
+ query: string;
3
+ params: string[];
4
+ };
@@ -0,0 +1,21 @@
1
+ export function getMigration(schema) {
2
+ const query = `
3
+ DO $$
4
+ BEGIN
5
+ IF NOT EXISTS (
6
+ SELECT 1
7
+ FROM pg_type t
8
+ JOIN pg_namespace n ON n.oid = t.typnamespace
9
+ WHERE t.typname = 'tstzrange3'
10
+ AND n.nspname = $1
11
+ ) THEN
12
+ CREATE TYPE tstzrange3 AS RANGE (
13
+ subtype = timestamp (3) with time zone,
14
+ multirange_type_name = tstzmultirange3
15
+ );
16
+ END IF;
17
+ END $$;
18
+ `;
19
+ return { query, params: [schema] };
20
+ }
21
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.js","sourceRoot":"","sources":["../../lib/common/migration.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAE,MAAc;IAC1C,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;KAgBX,CAAA;IAEH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,CAAA;AACpC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wisemen/datewise",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",