mythix-orm-postgresql 1.2.0 → 1.2.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.
@@ -34,11 +34,6 @@ class PostgreSQLQueryGenerator extends SQLQueryGeneratorBase {
34
34
  ')',
35
35
  ];
36
36
 
37
- if (options.deferred === true) {
38
- sqlParts.push(' ');
39
- sqlParts.push('DEFERRABLE INITIALLY DEFERRED');
40
- }
41
-
42
37
  if (options.onDelete) {
43
38
  sqlParts.push(' ');
44
39
  sqlParts.push(`ON DELETE ${options.onDelete.toUpperCase()}`);
@@ -49,6 +44,15 @@ class PostgreSQLQueryGenerator extends SQLQueryGeneratorBase {
49
44
  sqlParts.push(`ON UPDATE ${options.onUpdate.toUpperCase()}`);
50
45
  }
51
46
 
47
+ if (options.deferred !== false) {
48
+ sqlParts.push(' ');
49
+
50
+ if (Nife.instanceOf(options.deferred, 'string'))
51
+ sqlParts.push(options.deferred);
52
+ else
53
+ sqlParts.push('DEFERRABLE INITIALLY DEFERRED');
54
+ }
55
+
52
56
  return sqlParts.join('');
53
57
  }
54
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mythix-orm-postgresql",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "PostgreSQL driver for Mythix ORM",
5
5
  "main": "lib/index.js",
6
6
  "type": "commonjs",