typeorm 0.2.45-dev.f3cfdd2 → 0.2.45

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.
Files changed (498) hide show
  1. package/browser/cache/DbQueryResultCache.js +6 -6
  2. package/browser/cache/DbQueryResultCache.js.map +1 -1
  3. package/browser/cache/RedisQueryResultCache.js +2 -2
  4. package/browser/cache/RedisQueryResultCache.js.map +1 -1
  5. package/browser/connection/Connection.js +2 -2
  6. package/browser/connection/Connection.js.map +1 -1
  7. package/browser/connection/ConnectionOptionsReader.js +2 -2
  8. package/browser/connection/ConnectionOptionsReader.js.map +1 -1
  9. package/browser/driver/aurora-data-api/AuroraDataApiDriver.js +10 -10
  10. package/browser/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
  11. package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js +157 -157
  12. package/browser/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
  13. package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +3 -3
  14. package/browser/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
  15. package/browser/driver/better-sqlite3/BetterSqlite3Driver.js +4 -4
  16. package/browser/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
  17. package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js +2 -2
  18. package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
  19. package/browser/driver/capacitor/CapacitorDriver.js +1 -1
  20. package/browser/driver/capacitor/CapacitorDriver.js.map +1 -1
  21. package/browser/driver/capacitor/CapacitorQueryRunner.js +1 -1
  22. package/browser/driver/capacitor/CapacitorQueryRunner.js.map +1 -1
  23. package/browser/driver/cockroachdb/CockroachDriver.js +6 -6
  24. package/browser/driver/cockroachdb/CockroachDriver.js.map +1 -1
  25. package/browser/driver/cockroachdb/CockroachQueryRunner.js +153 -153
  26. package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
  27. package/browser/driver/cordova/CordovaQueryRunner.js +1 -1
  28. package/browser/driver/cordova/CordovaQueryRunner.js.map +1 -1
  29. package/browser/driver/expo/ExpoQueryRunner.js +3 -3
  30. package/browser/driver/expo/ExpoQueryRunner.js.map +1 -1
  31. package/browser/driver/mongodb/MongoDriver.js +4 -4
  32. package/browser/driver/mongodb/MongoDriver.js.map +1 -1
  33. package/browser/driver/mysql/MysqlDriver.js +11 -11
  34. package/browser/driver/mysql/MysqlDriver.js.map +1 -1
  35. package/browser/driver/mysql/MysqlQueryRunner.js +163 -163
  36. package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
  37. package/browser/driver/nativescript/NativescriptQueryRunner.js +1 -1
  38. package/browser/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
  39. package/browser/driver/oracle/OracleDriver.js +10 -10
  40. package/browser/driver/oracle/OracleDriver.js.map +1 -1
  41. package/browser/driver/oracle/OracleQueryRunner.js +124 -124
  42. package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
  43. package/browser/driver/postgres/PostgresDriver.js +18 -18
  44. package/browser/driver/postgres/PostgresDriver.js.map +1 -1
  45. package/browser/driver/postgres/PostgresQueryRunner.js +229 -229
  46. package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
  47. package/browser/driver/react-native/ReactNativeQueryRunner.js +1 -1
  48. package/browser/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
  49. package/browser/driver/sap/SapDriver.js +9 -9
  50. package/browser/driver/sap/SapDriver.js.map +1 -1
  51. package/browser/driver/sap/SapQueryRunner.js +126 -126
  52. package/browser/driver/sap/SapQueryRunner.js.map +1 -1
  53. package/browser/driver/sqlite/SqliteDriver.js +4 -4
  54. package/browser/driver/sqlite/SqliteDriver.js.map +1 -1
  55. package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js +3 -3
  56. package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
  57. package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +61 -61
  58. package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
  59. package/browser/driver/sqljs/SqljsDriver.js +3 -3
  60. package/browser/driver/sqljs/SqljsDriver.js.map +1 -1
  61. package/browser/driver/sqlserver/SqlServerDriver.js +11 -11
  62. package/browser/driver/sqlserver/SqlServerDriver.js.map +1 -1
  63. package/browser/driver/sqlserver/SqlServerQueryRunner.js +203 -203
  64. package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
  65. package/browser/entity-manager/EntityManager.js +4 -4
  66. package/browser/entity-manager/EntityManager.js.map +1 -1
  67. package/browser/entity-manager/MongoEntityManager.js +1 -1
  68. package/browser/entity-manager/MongoEntityManager.js.map +1 -1
  69. package/browser/entity-schema/EntitySchemaEmbeddedError.js +2 -2
  70. package/browser/entity-schema/EntitySchemaEmbeddedError.js.map +1 -1
  71. package/browser/error/AlreadyHasActiveConnectionError.js +1 -1
  72. package/browser/error/AlreadyHasActiveConnectionError.js.map +1 -1
  73. package/browser/error/CannotAttachTreeChildrenEntityError.js +1 -1
  74. package/browser/error/CannotAttachTreeChildrenEntityError.js.map +1 -1
  75. package/browser/error/CannotConnectAlreadyConnectedError.js +1 -1
  76. package/browser/error/CannotConnectAlreadyConnectedError.js.map +1 -1
  77. package/browser/error/CannotCreateEntityIdMapError.js +1 -1
  78. package/browser/error/CannotCreateEntityIdMapError.js.map +1 -1
  79. package/browser/error/CannotDetermineEntityError.js +1 -1
  80. package/browser/error/CannotDetermineEntityError.js.map +1 -1
  81. package/browser/error/CannotExecuteNotConnectedError.js +1 -1
  82. package/browser/error/CannotExecuteNotConnectedError.js.map +1 -1
  83. package/browser/error/CannotGetEntityManagerNotConnectedError.js +1 -1
  84. package/browser/error/CannotGetEntityManagerNotConnectedError.js.map +1 -1
  85. package/browser/error/CannotReflectMethodParameterTypeError.js +1 -1
  86. package/browser/error/CannotReflectMethodParameterTypeError.js.map +1 -1
  87. package/browser/error/CircularRelationsError.js +1 -1
  88. package/browser/error/CircularRelationsError.js.map +1 -1
  89. package/browser/error/ColumnTypeUndefinedError.js +1 -1
  90. package/browser/error/ColumnTypeUndefinedError.js.map +1 -1
  91. package/browser/error/ConnectionIsNotSetError.js +1 -1
  92. package/browser/error/ConnectionIsNotSetError.js.map +1 -1
  93. package/browser/error/ConnectionNotFoundError.js +1 -1
  94. package/browser/error/ConnectionNotFoundError.js.map +1 -1
  95. package/browser/error/CustomRepositoryCannotInheritRepositoryError.js +1 -1
  96. package/browser/error/CustomRepositoryCannotInheritRepositoryError.js.map +1 -1
  97. package/browser/error/CustomRepositoryDoesNotHaveEntityError.js +1 -1
  98. package/browser/error/CustomRepositoryDoesNotHaveEntityError.js.map +1 -1
  99. package/browser/error/CustomRepositoryNotFoundError.js +1 -1
  100. package/browser/error/CustomRepositoryNotFoundError.js.map +1 -1
  101. package/browser/error/DataTypeNotSupportedError.js +1 -1
  102. package/browser/error/DataTypeNotSupportedError.js.map +1 -1
  103. package/browser/error/DriverOptionNotSetError.js +1 -1
  104. package/browser/error/DriverOptionNotSetError.js.map +1 -1
  105. package/browser/error/DriverPackageNotInstalledError.js +2 -2
  106. package/browser/error/DriverPackageNotInstalledError.js.map +1 -1
  107. package/browser/error/EntityColumnNotFound.js +1 -1
  108. package/browser/error/EntityColumnNotFound.js.map +1 -1
  109. package/browser/error/EntityMetadataNotFoundError.js +1 -1
  110. package/browser/error/EntityMetadataNotFoundError.js.map +1 -1
  111. package/browser/error/EntityNotFoundError.js +2 -2
  112. package/browser/error/EntityNotFoundError.js.map +1 -1
  113. package/browser/error/FindRelationsNotFoundError.js +2 -2
  114. package/browser/error/FindRelationsNotFoundError.js.map +1 -1
  115. package/browser/error/InitializedRelationError.js +1 -1
  116. package/browser/error/InitializedRelationError.js.map +1 -1
  117. package/browser/error/MissingDeleteDateColumnError.js +1 -1
  118. package/browser/error/MissingDeleteDateColumnError.js.map +1 -1
  119. package/browser/error/MissingDriverError.js +2 -2
  120. package/browser/error/MissingDriverError.js.map +1 -1
  121. package/browser/error/MissingJoinColumnError.js +3 -3
  122. package/browser/error/MissingJoinColumnError.js.map +1 -1
  123. package/browser/error/MissingJoinTableError.js +3 -3
  124. package/browser/error/MissingJoinTableError.js.map +1 -1
  125. package/browser/error/MissingPrimaryColumnError.js +1 -1
  126. package/browser/error/MissingPrimaryColumnError.js.map +1 -1
  127. package/browser/error/MustBeEntityError.js +1 -1
  128. package/browser/error/MustBeEntityError.js.map +1 -1
  129. package/browser/error/NamingStrategyNotFoundError.js +2 -2
  130. package/browser/error/NamingStrategyNotFoundError.js.map +1 -1
  131. package/browser/error/NoConnectionForRepositoryError.js +1 -1
  132. package/browser/error/NoConnectionForRepositoryError.js.map +1 -1
  133. package/browser/error/NoConnectionOptionError.js +2 -2
  134. package/browser/error/NoConnectionOptionError.js.map +1 -1
  135. package/browser/error/NoVersionOrUpdateDateColumnError.js +1 -1
  136. package/browser/error/NoVersionOrUpdateDateColumnError.js.map +1 -1
  137. package/browser/error/OptimisticLockVersionMismatchError.js +1 -1
  138. package/browser/error/OptimisticLockVersionMismatchError.js.map +1 -1
  139. package/browser/error/PrimaryColumnCannotBeNullableError.js +1 -1
  140. package/browser/error/PrimaryColumnCannotBeNullableError.js.map +1 -1
  141. package/browser/error/RepositoryNotFoundError.js +2 -2
  142. package/browser/error/RepositoryNotFoundError.js.map +1 -1
  143. package/browser/error/RepositoryNotTreeError.js +1 -1
  144. package/browser/error/RepositoryNotTreeError.js.map +1 -1
  145. package/browser/error/SubjectRemovedAndUpdatedError.js +1 -1
  146. package/browser/error/SubjectRemovedAndUpdatedError.js.map +1 -1
  147. package/browser/error/SubjectWithoutIdentifierError.js +1 -1
  148. package/browser/error/SubjectWithoutIdentifierError.js.map +1 -1
  149. package/browser/error/TreeRepositoryNotSupportedError.js +1 -1
  150. package/browser/error/TreeRepositoryNotSupportedError.js.map +1 -1
  151. package/browser/error/UsingJoinColumnIsNotAllowedError.js +1 -1
  152. package/browser/error/UsingJoinColumnIsNotAllowedError.js.map +1 -1
  153. package/browser/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +1 -1
  154. package/browser/error/UsingJoinColumnOnlyOnOneSideAllowedError.js.map +1 -1
  155. package/browser/error/UsingJoinTableIsNotAllowedError.js +2 -2
  156. package/browser/error/UsingJoinTableIsNotAllowedError.js.map +1 -1
  157. package/browser/error/UsingJoinTableOnlyOnOneSideAllowedError.js +1 -1
  158. package/browser/error/UsingJoinTableOnlyOnOneSideAllowedError.js.map +1 -1
  159. package/browser/find-options/FindOptionsUtils.js +6 -6
  160. package/browser/find-options/FindOptionsUtils.js.map +1 -1
  161. package/browser/logger/FileLogger.js +3 -3
  162. package/browser/logger/FileLogger.js.map +1 -1
  163. package/browser/metadata/EmbeddedMetadata.js +1 -1
  164. package/browser/metadata/EmbeddedMetadata.js.map +1 -1
  165. package/browser/metadata/IndexMetadata.js +1 -1
  166. package/browser/metadata/IndexMetadata.js.map +1 -1
  167. package/browser/metadata/RelationCountMetadata.js +1 -1
  168. package/browser/metadata/RelationCountMetadata.js.map +1 -1
  169. package/browser/metadata/RelationIdMetadata.js +1 -1
  170. package/browser/metadata/RelationIdMetadata.js.map +1 -1
  171. package/browser/metadata/UniqueMetadata.js +1 -1
  172. package/browser/metadata/UniqueMetadata.js.map +1 -1
  173. package/browser/metadata-builder/EntityMetadataBuilder.js +1 -1
  174. package/browser/metadata-builder/EntityMetadataBuilder.js.map +1 -1
  175. package/browser/metadata-builder/EntityMetadataValidator.js +9 -9
  176. package/browser/metadata-builder/EntityMetadataValidator.js.map +1 -1
  177. package/browser/metadata-builder/JunctionEntityMetadataBuilder.js +2 -2
  178. package/browser/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
  179. package/browser/metadata-builder/RelationJoinColumnBuilder.js +1 -1
  180. package/browser/metadata-builder/RelationJoinColumnBuilder.js.map +1 -1
  181. package/browser/migration/MigrationExecutor.js +16 -16
  182. package/browser/migration/MigrationExecutor.js.map +1 -1
  183. package/browser/naming-strategy/DefaultNamingStrategy.js +11 -11
  184. package/browser/naming-strategy/DefaultNamingStrategy.js.map +1 -1
  185. package/browser/persistence/tree/ClosureSubjectExecutor.js +17 -17
  186. package/browser/persistence/tree/ClosureSubjectExecutor.js.map +1 -1
  187. package/browser/persistence/tree/MaterializedPathSubjectExecutor.js +2 -2
  188. package/browser/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
  189. package/browser/persistence/tree/NestedSetSubjectExecutor.js +44 -44
  190. package/browser/persistence/tree/NestedSetSubjectExecutor.js.map +1 -1
  191. package/browser/platform/BrowserPlatformTools.js +9 -9
  192. package/browser/platform/BrowserPlatformTools.js.map +1 -1
  193. package/browser/platform/PlatformTools.js +1 -1
  194. package/browser/platform/PlatformTools.js.map +1 -1
  195. package/browser/query-builder/Alias.js +1 -1
  196. package/browser/query-builder/Alias.js.map +1 -1
  197. package/browser/query-builder/DeleteQueryBuilder.js +3 -3
  198. package/browser/query-builder/DeleteQueryBuilder.js.map +1 -1
  199. package/browser/query-builder/InsertQueryBuilder.js +22 -22
  200. package/browser/query-builder/InsertQueryBuilder.js.map +1 -1
  201. package/browser/query-builder/JoinAttribute.js +1 -1
  202. package/browser/query-builder/JoinAttribute.js.map +1 -1
  203. package/browser/query-builder/QueryBuilder.js +39 -39
  204. package/browser/query-builder/QueryBuilder.js.map +1 -1
  205. package/browser/query-builder/QueryExpressionMap.js +2 -2
  206. package/browser/query-builder/QueryExpressionMap.js.map +1 -1
  207. package/browser/query-builder/RelationLoader.js +7 -7
  208. package/browser/query-builder/RelationLoader.js.map +1 -1
  209. package/browser/query-builder/RelationQueryBuilder.js +3 -3
  210. package/browser/query-builder/RelationQueryBuilder.js.map +1 -1
  211. package/browser/query-builder/RelationRemover.js +4 -4
  212. package/browser/query-builder/RelationRemover.js.map +1 -1
  213. package/browser/query-builder/RelationUpdater.js +1 -1
  214. package/browser/query-builder/RelationUpdater.js.map +1 -1
  215. package/browser/query-builder/SelectQueryBuilder.js +23 -23
  216. package/browser/query-builder/SelectQueryBuilder.js.map +1 -1
  217. package/browser/query-builder/SoftDeleteQueryBuilder.js +4 -4
  218. package/browser/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
  219. package/browser/query-builder/UpdateQueryBuilder.js +8 -8
  220. package/browser/query-builder/UpdateQueryBuilder.js.map +1 -1
  221. package/browser/query-builder/relation-count/RelationCountAttribute.js +1 -1
  222. package/browser/query-builder/relation-count/RelationCountAttribute.js.map +1 -1
  223. package/browser/query-builder/relation-id/RelationIdAttribute.js +1 -1
  224. package/browser/query-builder/relation-id/RelationIdAttribute.js.map +1 -1
  225. package/browser/query-builder/relation-id/RelationIdLoader.js +4 -4
  226. package/browser/query-builder/relation-id/RelationIdLoader.js.map +1 -1
  227. package/browser/query-runner/BaseQueryRunner.js +7 -7
  228. package/browser/query-runner/BaseQueryRunner.js.map +1 -1
  229. package/browser/repository/TreeRepository.js +7 -7
  230. package/browser/repository/TreeRepository.js.map +1 -1
  231. package/browser/schema-builder/RdbmsSchemaBuilder.js +19 -19
  232. package/browser/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
  233. package/browser/subscriber/Broadcaster.js +1 -1
  234. package/browser/subscriber/Broadcaster.js.map +1 -1
  235. package/browser/util/DateUtils.js +1 -1
  236. package/browser/util/DateUtils.js.map +1 -1
  237. package/browser/util/DepGraph.js +7 -7
  238. package/browser/util/DepGraph.js.map +1 -1
  239. package/browser/util/DirectoryExportedClassesLoader.js +2 -2
  240. package/browser/util/DirectoryExportedClassesLoader.js.map +1 -1
  241. package/browser/util/PathUtils.js +1 -1
  242. package/browser/util/PathUtils.js.map +1 -1
  243. package/cache/DbQueryResultCache.js +6 -6
  244. package/cache/DbQueryResultCache.js.map +1 -1
  245. package/cache/RedisQueryResultCache.js +2 -2
  246. package/cache/RedisQueryResultCache.js.map +1 -1
  247. package/cli.js +0 -0
  248. package/commands/CommandUtils.js +1 -1
  249. package/commands/CommandUtils.js.map +1 -1
  250. package/commands/EntityCreateCommand.js +3 -3
  251. package/commands/EntityCreateCommand.js.map +1 -1
  252. package/commands/InitCommand.js +6 -6
  253. package/commands/InitCommand.js.map +1 -1
  254. package/commands/MigrationCreateCommand.js +3 -3
  255. package/commands/MigrationCreateCommand.js.map +1 -1
  256. package/commands/MigrationGenerateCommand.js +8 -8
  257. package/commands/MigrationGenerateCommand.js.map +1 -1
  258. package/commands/SchemaLogCommand.js +1 -1
  259. package/commands/SchemaLogCommand.js.map +1 -1
  260. package/commands/SubscriberCreateCommand.js +2 -2
  261. package/commands/SubscriberCreateCommand.js.map +1 -1
  262. package/connection/Connection.js +2 -2
  263. package/connection/Connection.js.map +1 -1
  264. package/connection/ConnectionOptionsReader.js +2 -2
  265. package/connection/ConnectionOptionsReader.js.map +1 -1
  266. package/driver/aurora-data-api/AuroraDataApiDriver.js +10 -10
  267. package/driver/aurora-data-api/AuroraDataApiDriver.js.map +1 -1
  268. package/driver/aurora-data-api/AuroraDataApiQueryRunner.js +157 -157
  269. package/driver/aurora-data-api/AuroraDataApiQueryRunner.js.map +1 -1
  270. package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js +3 -3
  271. package/driver/aurora-data-api-pg/AuroraDataApiPostgresQueryRunner.js.map +1 -1
  272. package/driver/better-sqlite3/BetterSqlite3Driver.js +4 -4
  273. package/driver/better-sqlite3/BetterSqlite3Driver.js.map +1 -1
  274. package/driver/better-sqlite3/BetterSqlite3QueryRunner.js +2 -2
  275. package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
  276. package/driver/capacitor/CapacitorDriver.js +1 -1
  277. package/driver/capacitor/CapacitorDriver.js.map +1 -1
  278. package/driver/capacitor/CapacitorQueryRunner.js +1 -1
  279. package/driver/capacitor/CapacitorQueryRunner.js.map +1 -1
  280. package/driver/cockroachdb/CockroachDriver.js +6 -6
  281. package/driver/cockroachdb/CockroachDriver.js.map +1 -1
  282. package/driver/cockroachdb/CockroachQueryRunner.js +153 -153
  283. package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
  284. package/driver/cordova/CordovaQueryRunner.js +1 -1
  285. package/driver/cordova/CordovaQueryRunner.js.map +1 -1
  286. package/driver/expo/ExpoQueryRunner.js +3 -3
  287. package/driver/expo/ExpoQueryRunner.js.map +1 -1
  288. package/driver/mongodb/MongoDriver.js +4 -4
  289. package/driver/mongodb/MongoDriver.js.map +1 -1
  290. package/driver/mysql/MysqlDriver.js +11 -11
  291. package/driver/mysql/MysqlDriver.js.map +1 -1
  292. package/driver/mysql/MysqlQueryRunner.js +163 -163
  293. package/driver/mysql/MysqlQueryRunner.js.map +1 -1
  294. package/driver/nativescript/NativescriptQueryRunner.js +1 -1
  295. package/driver/nativescript/NativescriptQueryRunner.js.map +1 -1
  296. package/driver/oracle/OracleDriver.js +10 -10
  297. package/driver/oracle/OracleDriver.js.map +1 -1
  298. package/driver/oracle/OracleQueryRunner.js +124 -124
  299. package/driver/oracle/OracleQueryRunner.js.map +1 -1
  300. package/driver/postgres/PostgresDriver.js +18 -18
  301. package/driver/postgres/PostgresDriver.js.map +1 -1
  302. package/driver/postgres/PostgresQueryRunner.js +229 -229
  303. package/driver/postgres/PostgresQueryRunner.js.map +1 -1
  304. package/driver/react-native/ReactNativeQueryRunner.js +1 -1
  305. package/driver/react-native/ReactNativeQueryRunner.js.map +1 -1
  306. package/driver/sap/SapDriver.js +9 -9
  307. package/driver/sap/SapDriver.js.map +1 -1
  308. package/driver/sap/SapQueryRunner.js +126 -126
  309. package/driver/sap/SapQueryRunner.js.map +1 -1
  310. package/driver/sqlite/SqliteDriver.js +4 -4
  311. package/driver/sqlite/SqliteDriver.js.map +1 -1
  312. package/driver/sqlite-abstract/AbstractSqliteDriver.js +3 -3
  313. package/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
  314. package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +61 -61
  315. package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
  316. package/driver/sqljs/SqljsDriver.js +3 -3
  317. package/driver/sqljs/SqljsDriver.js.map +1 -1
  318. package/driver/sqlserver/SqlServerDriver.js +11 -11
  319. package/driver/sqlserver/SqlServerDriver.js.map +1 -1
  320. package/driver/sqlserver/SqlServerQueryRunner.js +203 -203
  321. package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
  322. package/entity-manager/EntityManager.js +4 -4
  323. package/entity-manager/EntityManager.js.map +1 -1
  324. package/entity-manager/MongoEntityManager.js +1 -1
  325. package/entity-manager/MongoEntityManager.js.map +1 -1
  326. package/entity-schema/EntitySchemaEmbeddedError.js +2 -2
  327. package/entity-schema/EntitySchemaEmbeddedError.js.map +1 -1
  328. package/error/AlreadyHasActiveConnectionError.js +1 -1
  329. package/error/AlreadyHasActiveConnectionError.js.map +1 -1
  330. package/error/CannotAttachTreeChildrenEntityError.js +1 -1
  331. package/error/CannotAttachTreeChildrenEntityError.js.map +1 -1
  332. package/error/CannotConnectAlreadyConnectedError.js +1 -1
  333. package/error/CannotConnectAlreadyConnectedError.js.map +1 -1
  334. package/error/CannotCreateEntityIdMapError.js +1 -1
  335. package/error/CannotCreateEntityIdMapError.js.map +1 -1
  336. package/error/CannotDetermineEntityError.js +1 -1
  337. package/error/CannotDetermineEntityError.js.map +1 -1
  338. package/error/CannotExecuteNotConnectedError.js +1 -1
  339. package/error/CannotExecuteNotConnectedError.js.map +1 -1
  340. package/error/CannotGetEntityManagerNotConnectedError.js +1 -1
  341. package/error/CannotGetEntityManagerNotConnectedError.js.map +1 -1
  342. package/error/CannotReflectMethodParameterTypeError.js +1 -1
  343. package/error/CannotReflectMethodParameterTypeError.js.map +1 -1
  344. package/error/CircularRelationsError.js +1 -1
  345. package/error/CircularRelationsError.js.map +1 -1
  346. package/error/ColumnTypeUndefinedError.js +1 -1
  347. package/error/ColumnTypeUndefinedError.js.map +1 -1
  348. package/error/ConnectionIsNotSetError.js +1 -1
  349. package/error/ConnectionIsNotSetError.js.map +1 -1
  350. package/error/ConnectionNotFoundError.js +1 -1
  351. package/error/ConnectionNotFoundError.js.map +1 -1
  352. package/error/CustomRepositoryCannotInheritRepositoryError.js +1 -1
  353. package/error/CustomRepositoryCannotInheritRepositoryError.js.map +1 -1
  354. package/error/CustomRepositoryDoesNotHaveEntityError.js +1 -1
  355. package/error/CustomRepositoryDoesNotHaveEntityError.js.map +1 -1
  356. package/error/CustomRepositoryNotFoundError.js +1 -1
  357. package/error/CustomRepositoryNotFoundError.js.map +1 -1
  358. package/error/DataTypeNotSupportedError.js +1 -1
  359. package/error/DataTypeNotSupportedError.js.map +1 -1
  360. package/error/DriverOptionNotSetError.js +1 -1
  361. package/error/DriverOptionNotSetError.js.map +1 -1
  362. package/error/DriverPackageNotInstalledError.js +2 -2
  363. package/error/DriverPackageNotInstalledError.js.map +1 -1
  364. package/error/EntityColumnNotFound.js +1 -1
  365. package/error/EntityColumnNotFound.js.map +1 -1
  366. package/error/EntityMetadataNotFoundError.js +1 -1
  367. package/error/EntityMetadataNotFoundError.js.map +1 -1
  368. package/error/EntityNotFoundError.js +2 -2
  369. package/error/EntityNotFoundError.js.map +1 -1
  370. package/error/FindRelationsNotFoundError.js +2 -2
  371. package/error/FindRelationsNotFoundError.js.map +1 -1
  372. package/error/InitializedRelationError.js +1 -1
  373. package/error/InitializedRelationError.js.map +1 -1
  374. package/error/MissingDeleteDateColumnError.js +1 -1
  375. package/error/MissingDeleteDateColumnError.js.map +1 -1
  376. package/error/MissingDriverError.js +2 -2
  377. package/error/MissingDriverError.js.map +1 -1
  378. package/error/MissingJoinColumnError.js +3 -3
  379. package/error/MissingJoinColumnError.js.map +1 -1
  380. package/error/MissingJoinTableError.js +3 -3
  381. package/error/MissingJoinTableError.js.map +1 -1
  382. package/error/MissingPrimaryColumnError.js +1 -1
  383. package/error/MissingPrimaryColumnError.js.map +1 -1
  384. package/error/MustBeEntityError.js +1 -1
  385. package/error/MustBeEntityError.js.map +1 -1
  386. package/error/NamingStrategyNotFoundError.js +2 -2
  387. package/error/NamingStrategyNotFoundError.js.map +1 -1
  388. package/error/NoConnectionForRepositoryError.js +1 -1
  389. package/error/NoConnectionForRepositoryError.js.map +1 -1
  390. package/error/NoConnectionOptionError.js +2 -2
  391. package/error/NoConnectionOptionError.js.map +1 -1
  392. package/error/NoVersionOrUpdateDateColumnError.js +1 -1
  393. package/error/NoVersionOrUpdateDateColumnError.js.map +1 -1
  394. package/error/OptimisticLockVersionMismatchError.js +1 -1
  395. package/error/OptimisticLockVersionMismatchError.js.map +1 -1
  396. package/error/PrimaryColumnCannotBeNullableError.js +1 -1
  397. package/error/PrimaryColumnCannotBeNullableError.js.map +1 -1
  398. package/error/RepositoryNotFoundError.js +2 -2
  399. package/error/RepositoryNotFoundError.js.map +1 -1
  400. package/error/RepositoryNotTreeError.js +1 -1
  401. package/error/RepositoryNotTreeError.js.map +1 -1
  402. package/error/SubjectRemovedAndUpdatedError.js +1 -1
  403. package/error/SubjectRemovedAndUpdatedError.js.map +1 -1
  404. package/error/SubjectWithoutIdentifierError.js +1 -1
  405. package/error/SubjectWithoutIdentifierError.js.map +1 -1
  406. package/error/TreeRepositoryNotSupportedError.js +1 -1
  407. package/error/TreeRepositoryNotSupportedError.js.map +1 -1
  408. package/error/UsingJoinColumnIsNotAllowedError.js +1 -1
  409. package/error/UsingJoinColumnIsNotAllowedError.js.map +1 -1
  410. package/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +1 -1
  411. package/error/UsingJoinColumnOnlyOnOneSideAllowedError.js.map +1 -1
  412. package/error/UsingJoinTableIsNotAllowedError.js +2 -2
  413. package/error/UsingJoinTableIsNotAllowedError.js.map +1 -1
  414. package/error/UsingJoinTableOnlyOnOneSideAllowedError.js +1 -1
  415. package/error/UsingJoinTableOnlyOnOneSideAllowedError.js.map +1 -1
  416. package/find-options/FindOptionsUtils.js +6 -6
  417. package/find-options/FindOptionsUtils.js.map +1 -1
  418. package/logger/FileLogger.js +3 -3
  419. package/logger/FileLogger.js.map +1 -1
  420. package/metadata/EmbeddedMetadata.js +1 -1
  421. package/metadata/EmbeddedMetadata.js.map +1 -1
  422. package/metadata/IndexMetadata.js +1 -1
  423. package/metadata/IndexMetadata.js.map +1 -1
  424. package/metadata/RelationCountMetadata.js +1 -1
  425. package/metadata/RelationCountMetadata.js.map +1 -1
  426. package/metadata/RelationIdMetadata.js +1 -1
  427. package/metadata/RelationIdMetadata.js.map +1 -1
  428. package/metadata/UniqueMetadata.js +1 -1
  429. package/metadata/UniqueMetadata.js.map +1 -1
  430. package/metadata-builder/EntityMetadataBuilder.js +1 -1
  431. package/metadata-builder/EntityMetadataBuilder.js.map +1 -1
  432. package/metadata-builder/EntityMetadataValidator.js +9 -9
  433. package/metadata-builder/EntityMetadataValidator.js.map +1 -1
  434. package/metadata-builder/JunctionEntityMetadataBuilder.js +2 -2
  435. package/metadata-builder/JunctionEntityMetadataBuilder.js.map +1 -1
  436. package/metadata-builder/RelationJoinColumnBuilder.js +1 -1
  437. package/metadata-builder/RelationJoinColumnBuilder.js.map +1 -1
  438. package/migration/MigrationExecutor.js +16 -16
  439. package/migration/MigrationExecutor.js.map +1 -1
  440. package/naming-strategy/DefaultNamingStrategy.js +11 -11
  441. package/naming-strategy/DefaultNamingStrategy.js.map +1 -1
  442. package/package.json +260 -1
  443. package/persistence/tree/ClosureSubjectExecutor.js +17 -17
  444. package/persistence/tree/ClosureSubjectExecutor.js.map +1 -1
  445. package/persistence/tree/MaterializedPathSubjectExecutor.js +2 -2
  446. package/persistence/tree/MaterializedPathSubjectExecutor.js.map +1 -1
  447. package/persistence/tree/NestedSetSubjectExecutor.js +44 -44
  448. package/persistence/tree/NestedSetSubjectExecutor.js.map +1 -1
  449. package/platform/PlatformTools.js +1 -1
  450. package/platform/PlatformTools.js.map +1 -1
  451. package/query-builder/Alias.js +1 -1
  452. package/query-builder/Alias.js.map +1 -1
  453. package/query-builder/DeleteQueryBuilder.js +3 -3
  454. package/query-builder/DeleteQueryBuilder.js.map +1 -1
  455. package/query-builder/InsertQueryBuilder.js +22 -22
  456. package/query-builder/InsertQueryBuilder.js.map +1 -1
  457. package/query-builder/JoinAttribute.js +1 -1
  458. package/query-builder/JoinAttribute.js.map +1 -1
  459. package/query-builder/QueryBuilder.js +39 -39
  460. package/query-builder/QueryBuilder.js.map +1 -1
  461. package/query-builder/QueryExpressionMap.js +2 -2
  462. package/query-builder/QueryExpressionMap.js.map +1 -1
  463. package/query-builder/RelationLoader.js +7 -7
  464. package/query-builder/RelationLoader.js.map +1 -1
  465. package/query-builder/RelationQueryBuilder.js +3 -3
  466. package/query-builder/RelationQueryBuilder.js.map +1 -1
  467. package/query-builder/RelationRemover.js +4 -4
  468. package/query-builder/RelationRemover.js.map +1 -1
  469. package/query-builder/RelationUpdater.js +1 -1
  470. package/query-builder/RelationUpdater.js.map +1 -1
  471. package/query-builder/SelectQueryBuilder.js +23 -23
  472. package/query-builder/SelectQueryBuilder.js.map +1 -1
  473. package/query-builder/SoftDeleteQueryBuilder.js +4 -4
  474. package/query-builder/SoftDeleteQueryBuilder.js.map +1 -1
  475. package/query-builder/UpdateQueryBuilder.js +8 -8
  476. package/query-builder/UpdateQueryBuilder.js.map +1 -1
  477. package/query-builder/relation-count/RelationCountAttribute.js +1 -1
  478. package/query-builder/relation-count/RelationCountAttribute.js.map +1 -1
  479. package/query-builder/relation-id/RelationIdAttribute.js +1 -1
  480. package/query-builder/relation-id/RelationIdAttribute.js.map +1 -1
  481. package/query-builder/relation-id/RelationIdLoader.js +4 -4
  482. package/query-builder/relation-id/RelationIdLoader.js.map +1 -1
  483. package/query-runner/BaseQueryRunner.js +7 -7
  484. package/query-runner/BaseQueryRunner.js.map +1 -1
  485. package/repository/TreeRepository.js +7 -7
  486. package/repository/TreeRepository.js.map +1 -1
  487. package/schema-builder/RdbmsSchemaBuilder.js +19 -19
  488. package/schema-builder/RdbmsSchemaBuilder.js.map +1 -1
  489. package/subscriber/Broadcaster.js +1 -1
  490. package/subscriber/Broadcaster.js.map +1 -1
  491. package/util/DateUtils.js +1 -1
  492. package/util/DateUtils.js.map +1 -1
  493. package/util/DepGraph.js +7 -7
  494. package/util/DepGraph.js.map +1 -1
  495. package/util/DirectoryExportedClassesLoader.js +2 -2
  496. package/util/DirectoryExportedClassesLoader.js.map +1 -1
  497. package/util/PathUtils.js +1 -1
  498. package/util/PathUtils.js.map +1 -1
@@ -143,7 +143,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
143
143
  _a.sent();
144
144
  _a.label = 7;
145
145
  case 7: return [3 /*break*/, 10];
146
- case 8: return [4 /*yield*/, this.query("SAVEPOINT typeorm_" + this.transactionDepth)];
146
+ case 8: return [4 /*yield*/, this.query("SAVEPOINT typeorm_".concat(this.transactionDepth))];
147
147
  case 9:
148
148
  _a.sent();
149
149
  _a.label = 10;
@@ -172,7 +172,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
172
172
  case 1:
173
173
  _a.sent();
174
174
  if (!(this.transactionDepth > 1)) return [3 /*break*/, 3];
175
- return [4 /*yield*/, this.query("RELEASE SAVEPOINT typeorm_" + (this.transactionDepth - 1))];
175
+ return [4 /*yield*/, this.query("RELEASE SAVEPOINT typeorm_".concat(this.transactionDepth - 1))];
176
176
  case 2:
177
177
  _a.sent();
178
178
  return [3 /*break*/, 5];
@@ -206,7 +206,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
206
206
  case 1:
207
207
  _a.sent();
208
208
  if (!(this.transactionDepth > 1)) return [3 /*break*/, 3];
209
- return [4 /*yield*/, this.query("ROLLBACK TO SAVEPOINT typeorm_" + (this.transactionDepth - 1))];
209
+ return [4 /*yield*/, this.query("ROLLBACK TO SAVEPOINT typeorm_".concat(this.transactionDepth - 1))];
210
210
  case 2:
211
211
  _a.sent();
212
212
  return [3 /*break*/, 5];
@@ -339,7 +339,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
339
339
  var result;
340
340
  return (0, tslib_1.__generator)(this, function (_a) {
341
341
  switch (_a.label) {
342
- case 0: return [4 /*yield*/, this.query("SELECT * FROM pg_database WHERE datname='" + database + "';")];
342
+ case 0: return [4 /*yield*/, this.query("SELECT * FROM pg_database WHERE datname='".concat(database, "';"))];
343
343
  case 1:
344
344
  result = _a.sent();
345
345
  return [2 /*return*/, result.length ? true : false];
@@ -371,7 +371,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
371
371
  var result;
372
372
  return (0, tslib_1.__generator)(this, function (_a) {
373
373
  switch (_a.label) {
374
- case 0: return [4 /*yield*/, this.query("SELECT * FROM \"information_schema\".\"schemata\" WHERE \"schema_name\" = '" + schema + "'")];
374
+ case 0: return [4 /*yield*/, this.query("SELECT * FROM \"information_schema\".\"schemata\" WHERE \"schema_name\" = '".concat(schema, "'"))];
375
375
  case 1:
376
376
  result = _a.sent();
377
377
  return [2 /*return*/, result.length ? true : false];
@@ -412,7 +412,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
412
412
  _a.schema = _b.sent();
413
413
  _b.label = 2;
414
414
  case 2:
415
- sql = "SELECT * FROM \"information_schema\".\"tables\" WHERE \"table_schema\" = '" + parsedTableName.schema + "' AND \"table_name\" = '" + parsedTableName.tableName + "'";
415
+ sql = "SELECT * FROM \"information_schema\".\"tables\" WHERE \"table_schema\" = '".concat(parsedTableName.schema, "' AND \"table_name\" = '").concat(parsedTableName.tableName, "'");
416
416
  return [4 /*yield*/, this.query(sql)];
417
417
  case 3:
418
418
  result = _b.sent();
@@ -438,7 +438,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
438
438
  _a.schema = _b.sent();
439
439
  _b.label = 2;
440
440
  case 2:
441
- sql = "SELECT * FROM \"information_schema\".\"columns\" WHERE \"table_schema\" = '" + parsedTableName.schema + "' AND \"table_name\" = '" + parsedTableName.tableName + "' AND \"column_name\" = '" + columnName + "'";
441
+ sql = "SELECT * FROM \"information_schema\".\"columns\" WHERE \"table_schema\" = '".concat(parsedTableName.schema, "' AND \"table_name\" = '").concat(parsedTableName.tableName, "' AND \"column_name\" = '").concat(columnName, "'");
442
442
  return [4 /*yield*/, this.query(sql)];
443
443
  case 3:
444
444
  result = _b.sent();
@@ -465,8 +465,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
465
465
  return [2 /*return*/, Promise.resolve()];
466
466
  _a.label = 2;
467
467
  case 2:
468
- up = "CREATE DATABASE \"" + database + "\"";
469
- down = "DROP DATABASE \"" + database + "\"";
468
+ up = "CREATE DATABASE \"".concat(database, "\"");
469
+ down = "DROP DATABASE \"".concat(database, "\"");
470
470
  return [4 /*yield*/, this.executeQueries(new Query_1.Query(up), new Query_1.Query(down))];
471
471
  case 3:
472
472
  _a.sent();
@@ -485,8 +485,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
485
485
  return (0, tslib_1.__generator)(this, function (_a) {
486
486
  switch (_a.label) {
487
487
  case 0:
488
- up = ifExist ? "DROP DATABASE IF EXISTS \"" + database + "\"" : "DROP DATABASE \"" + database + "\"";
489
- down = "CREATE DATABASE \"" + database + "\"";
488
+ up = ifExist ? "DROP DATABASE IF EXISTS \"".concat(database, "\"") : "DROP DATABASE \"".concat(database, "\"");
489
+ down = "CREATE DATABASE \"".concat(database, "\"");
490
490
  return [4 /*yield*/, this.executeQueries(new Query_1.Query(up), new Query_1.Query(down))];
491
491
  case 1:
492
492
  _a.sent();
@@ -505,8 +505,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
505
505
  switch (_a.label) {
506
506
  case 0:
507
507
  schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[1];
508
- up = ifNotExist ? "CREATE SCHEMA IF NOT EXISTS \"" + schema + "\"" : "CREATE SCHEMA \"" + schema + "\"";
509
- down = "DROP SCHEMA \"" + schema + "\" CASCADE";
508
+ up = ifNotExist ? "CREATE SCHEMA IF NOT EXISTS \"".concat(schema, "\"") : "CREATE SCHEMA \"".concat(schema, "\"");
509
+ down = "DROP SCHEMA \"".concat(schema, "\" CASCADE");
510
510
  return [4 /*yield*/, this.executeQueries(new Query_1.Query(up), new Query_1.Query(down))];
511
511
  case 1:
512
512
  _a.sent();
@@ -525,8 +525,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
525
525
  switch (_a.label) {
526
526
  case 0:
527
527
  schema = schemaPath.indexOf(".") === -1 ? schemaPath : schemaPath.split(".")[1];
528
- up = ifExist ? "DROP SCHEMA IF EXISTS \"" + schema + "\" " + (isCascade ? "CASCADE" : "") : "DROP SCHEMA \"" + schema + "\" " + (isCascade ? "CASCADE" : "");
529
- down = "CREATE SCHEMA \"" + schema + "\"";
528
+ up = ifExist ? "DROP SCHEMA IF EXISTS \"".concat(schema, "\" ").concat(isCascade ? "CASCADE" : "") : "DROP SCHEMA \"".concat(schema, "\" ").concat(isCascade ? "CASCADE" : "");
529
+ down = "CREATE SCHEMA \"".concat(schema, "\"");
530
530
  return [4 /*yield*/, this.executeQueries(new Query_1.Query(up), new Query_1.Query(down))];
531
531
  case 1:
532
532
  _a.sent();
@@ -797,16 +797,16 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
797
797
  oldTable = _a;
798
798
  newTable = oldTable.clone();
799
799
  _b = this.driver.parseTableName(oldTable), schemaName = _b.schema, oldTableName = _b.tableName;
800
- newTable.name = schemaName ? schemaName + "." + newTableName : newTableName;
801
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(oldTable) + " RENAME TO \"" + newTableName + "\""));
802
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(newTable) + " RENAME TO \"" + oldTableName + "\""));
800
+ newTable.name = schemaName ? "".concat(schemaName, ".").concat(newTableName) : newTableName;
801
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(oldTable), " RENAME TO \"").concat(newTableName, "\"")));
802
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(newTable), " RENAME TO \"").concat(oldTableName, "\"")));
803
803
  // rename column primary key constraint
804
804
  if (newTable.primaryColumns.length > 0) {
805
805
  columnNames = newTable.primaryColumns.map(function (column) { return column.name; });
806
806
  oldPkName = this.connection.namingStrategy.primaryKeyName(oldTable, columnNames);
807
807
  newPkName = this.connection.namingStrategy.primaryKeyName(newTable, columnNames);
808
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(newTable) + " RENAME CONSTRAINT \"" + oldPkName + "\" TO \"" + newPkName + "\""));
809
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(newTable) + " RENAME CONSTRAINT \"" + newPkName + "\" TO \"" + oldPkName + "\""));
808
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(newTable), " RENAME CONSTRAINT \"").concat(oldPkName, "\" TO \"").concat(newPkName, "\"")));
809
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(newTable), " RENAME CONSTRAINT \"").concat(newPkName, "\" TO \"").concat(oldPkName, "\"")));
810
810
  }
811
811
  // rename sequences
812
812
  newTable.columns.map(function (col) {
@@ -815,8 +815,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
815
815
  var sequenceName = _this.buildSequenceName(oldTable, col.name);
816
816
  var newSequencePath = _this.buildSequencePath(newTable, col.name);
817
817
  var newSequenceName = _this.buildSequenceName(newTable, col.name);
818
- var up = "ALTER SEQUENCE " + _this.escapePath(sequencePath) + " RENAME TO \"" + newSequenceName + "\"";
819
- var down = "ALTER SEQUENCE " + _this.escapePath(newSequencePath) + " RENAME TO \"" + sequenceName + "\"";
818
+ var up = "ALTER SEQUENCE ".concat(_this.escapePath(sequencePath), " RENAME TO \"").concat(newSequenceName, "\"");
819
+ var down = "ALTER SEQUENCE ".concat(_this.escapePath(newSequencePath), " RENAME TO \"").concat(sequenceName, "\"");
820
820
  upQueries.push(new Query_1.Query(up));
821
821
  downQueries.push(new Query_1.Query(down));
822
822
  }
@@ -826,8 +826,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
826
826
  // build new constraint name
827
827
  var newUniqueName = _this.connection.namingStrategy.uniqueConstraintName(newTable, unique.columnNames);
828
828
  // build queries
829
- upQueries.push(new Query_1.Query("ALTER TABLE " + _this.escapePath(newTable) + " RENAME CONSTRAINT \"" + unique.name + "\" TO \"" + newUniqueName + "\""));
830
- downQueries.push(new Query_1.Query("ALTER TABLE " + _this.escapePath(newTable) + " RENAME CONSTRAINT \"" + newUniqueName + "\" TO \"" + unique.name + "\""));
829
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(_this.escapePath(newTable), " RENAME CONSTRAINT \"").concat(unique.name, "\" TO \"").concat(newUniqueName, "\"")));
830
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(_this.escapePath(newTable), " RENAME CONSTRAINT \"").concat(newUniqueName, "\" TO \"").concat(unique.name, "\"")));
831
831
  // replace constraint name
832
832
  unique.name = newUniqueName;
833
833
  });
@@ -837,8 +837,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
837
837
  var schema = _this.driver.parseTableName(newTable).schema;
838
838
  var newIndexName = _this.connection.namingStrategy.indexName(newTable, index.columnNames, index.where);
839
839
  // build queries
840
- var up = schema ? "ALTER INDEX \"" + schema + "\".\"" + index.name + "\" RENAME TO \"" + newIndexName + "\"" : "ALTER INDEX \"" + index.name + "\" RENAME TO \"" + newIndexName + "\"";
841
- var down = schema ? "ALTER INDEX \"" + schema + "\".\"" + newIndexName + "\" RENAME TO \"" + index.name + "\"" : "ALTER INDEX \"" + newIndexName + "\" RENAME TO \"" + index.name + "\"";
840
+ var up = schema ? "ALTER INDEX \"".concat(schema, "\".\"").concat(index.name, "\" RENAME TO \"").concat(newIndexName, "\"") : "ALTER INDEX \"".concat(index.name, "\" RENAME TO \"").concat(newIndexName, "\"");
841
+ var down = schema ? "ALTER INDEX \"".concat(schema, "\".\"").concat(newIndexName, "\" RENAME TO \"").concat(index.name, "\"") : "ALTER INDEX \"".concat(newIndexName, "\" RENAME TO \"").concat(index.name, "\"");
842
842
  upQueries.push(new Query_1.Query(up));
843
843
  downQueries.push(new Query_1.Query(down));
844
844
  // replace constraint name
@@ -849,8 +849,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
849
849
  // build new constraint name
850
850
  var newForeignKeyName = _this.connection.namingStrategy.foreignKeyName(newTable, foreignKey.columnNames, _this.getTablePath(foreignKey), foreignKey.referencedColumnNames);
851
851
  // build queries
852
- upQueries.push(new Query_1.Query("ALTER TABLE " + _this.escapePath(newTable) + " RENAME CONSTRAINT \"" + foreignKey.name + "\" TO \"" + newForeignKeyName + "\""));
853
- downQueries.push(new Query_1.Query("ALTER TABLE " + _this.escapePath(newTable) + " RENAME CONSTRAINT \"" + newForeignKeyName + "\" TO \"" + foreignKey.name + "\""));
852
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(_this.escapePath(newTable), " RENAME CONSTRAINT \"").concat(foreignKey.name, "\" TO \"").concat(newForeignKeyName, "\"")));
853
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(_this.escapePath(newTable), " RENAME CONSTRAINT \"").concat(newForeignKeyName, "\" TO \"").concat(foreignKey.name, "\"")));
854
854
  // replace constraint name
855
855
  foreignKey.name = newForeignKeyName;
856
856
  });
@@ -869,8 +869,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
869
869
  return [4 /*yield*/, this.getUserDefinedTypeName(oldTable, column)];
870
870
  case 6:
871
871
  oldEnumType = _d.sent();
872
- upQueries.push(new Query_1.Query("ALTER TYPE \"" + oldEnumType.schema + "\".\"" + oldEnumType.name + "\" RENAME TO " + this.buildEnumName(newTable, column, false)));
873
- downQueries.push(new Query_1.Query("ALTER TYPE " + this.buildEnumName(newTable, column) + " RENAME TO \"" + oldEnumType.name + "\""));
872
+ upQueries.push(new Query_1.Query("ALTER TYPE \"".concat(oldEnumType.schema, "\".\"").concat(oldEnumType.name, "\" RENAME TO ").concat(this.buildEnumName(newTable, column, false))));
873
+ downQueries.push(new Query_1.Query("ALTER TYPE ".concat(this.buildEnumName(newTable, column), " RENAME TO \"").concat(oldEnumType.name, "\"")));
874
874
  _d.label = 7;
875
875
  case 7:
876
876
  enumColumns_2_1 = enumColumns_2.next();
@@ -925,23 +925,23 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
925
925
  }
926
926
  _b.label = 5;
927
927
  case 5:
928
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD " + this.buildCreateColumnSql(table, column)));
929
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP COLUMN \"" + column.name + "\""));
928
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD ").concat(this.buildCreateColumnSql(table, column))));
929
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP COLUMN \"").concat(column.name, "\"")));
930
930
  // create or update primary key constraint
931
931
  if (column.isPrimary) {
932
932
  primaryColumns = clonedTable.primaryColumns;
933
933
  // if table already have primary key, me must drop it and recreate again
934
934
  if (primaryColumns.length > 0) {
935
935
  pkName_1 = this.connection.namingStrategy.primaryKeyName(clonedTable, primaryColumns.map(function (column) { return column.name; }));
936
- columnNames_1 = primaryColumns.map(function (column) { return "\"" + column.name + "\""; }).join(", ");
937
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + pkName_1 + "\""));
938
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + pkName_1 + "\" PRIMARY KEY (" + columnNames_1 + ")"));
936
+ columnNames_1 = primaryColumns.map(function (column) { return "\"".concat(column.name, "\""); }).join(", ");
937
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(pkName_1, "\"")));
938
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(pkName_1, "\" PRIMARY KEY (").concat(columnNames_1, ")")));
939
939
  }
940
940
  primaryColumns.push(column);
941
941
  pkName = this.connection.namingStrategy.primaryKeyName(clonedTable, primaryColumns.map(function (column) { return column.name; }));
942
- columnNames = primaryColumns.map(function (column) { return "\"" + column.name + "\""; }).join(", ");
943
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + pkName + "\" PRIMARY KEY (" + columnNames + ")"));
944
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + pkName + "\""));
942
+ columnNames = primaryColumns.map(function (column) { return "\"".concat(column.name, "\""); }).join(", ");
943
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(pkName, "\" PRIMARY KEY (").concat(columnNames, ")")));
944
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(pkName, "\"")));
945
945
  }
946
946
  columnIndex = clonedTable.indices.find(function (index) { return index.columnNames.length === 1 && index.columnNames[0] === column.name; });
947
947
  if (columnIndex) {
@@ -955,8 +955,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
955
955
  columnNames: [column.name]
956
956
  });
957
957
  clonedTable.uniques.push(uniqueConstraint);
958
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + uniqueConstraint.name + "\" UNIQUE (\"" + column.name + "\")"));
959
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + uniqueConstraint.name + "\""));
958
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(uniqueConstraint.name, "\" UNIQUE (\"").concat(column.name, "\")")));
959
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(uniqueConstraint.name, "\"")));
960
960
  }
961
961
  if (!(column.generatedType === "STORED" && column.asExpression)) return [3 /*break*/, 7];
962
962
  return [4 /*yield*/, this.getTableNameWithSchema(table.name)];
@@ -986,8 +986,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
986
986
  case 7:
987
987
  // create column's comment
988
988
  if (column.comment) {
989
- upQueries.push(new Query_1.Query("COMMENT ON COLUMN " + this.escapePath(table) + ".\"" + column.name + "\" IS " + this.escapeComment(column.comment)));
990
- downQueries.push(new Query_1.Query("COMMENT ON COLUMN " + this.escapePath(table) + ".\"" + column.name + "\" IS " + this.escapeComment(column.comment)));
989
+ upQueries.push(new Query_1.Query("COMMENT ON COLUMN ".concat(this.escapePath(table), ".\"").concat(column.name, "\" IS ").concat(this.escapeComment(column.comment))));
990
+ downQueries.push(new Query_1.Query("COMMENT ON COLUMN ".concat(this.escapePath(table), ".\"").concat(column.name, "\" IS ").concat(this.escapeComment(column.comment))));
991
991
  }
992
992
  return [4 /*yield*/, this.executeQueries(upQueries, downQueries)];
993
993
  case 8:
@@ -1058,7 +1058,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1058
1058
  table = _a;
1059
1059
  oldColumn = oldTableColumnOrName instanceof TableColumn_1.TableColumn ? oldTableColumnOrName : table.columns.find(function (c) { return c.name === oldTableColumnOrName; });
1060
1060
  if (!oldColumn)
1061
- throw new error_1.TypeORMError("Column \"" + oldTableColumnOrName + "\" was not found in the \"" + table.name + "\" table.");
1061
+ throw new error_1.TypeORMError("Column \"".concat(oldTableColumnOrName, "\" was not found in the \"").concat(table.name, "\" table."));
1062
1062
  if (newTableColumnOrName instanceof TableColumn_1.TableColumn) {
1063
1063
  newColumn = newTableColumnOrName;
1064
1064
  }
@@ -1098,7 +1098,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1098
1098
  ? oldTableColumnOrName
1099
1099
  : table.columns.find(function (column) { return column.name === oldTableColumnOrName; });
1100
1100
  if (!oldColumn)
1101
- throw new error_1.TypeORMError("Column \"" + oldTableColumnOrName + "\" was not found in the \"" + table.name + "\" table.");
1101
+ throw new error_1.TypeORMError("Column \"".concat(oldTableColumnOrName, "\" was not found in the \"").concat(table.name, "\" table."));
1102
1102
  if (!(oldColumn.type !== newColumn.type
1103
1103
  || oldColumn.length !== newColumn.length
1104
1104
  || newColumn.isArray !== oldColumn.isArray
@@ -1118,14 +1118,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1118
1118
  case 6:
1119
1119
  if (!(oldColumn.name !== newColumn.name)) return [3 /*break*/, 9];
1120
1120
  // rename column
1121
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " RENAME COLUMN \"" + oldColumn.name + "\" TO \"" + newColumn.name + "\""));
1122
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " RENAME COLUMN \"" + newColumn.name + "\" TO \"" + oldColumn.name + "\""));
1121
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " RENAME COLUMN \"").concat(oldColumn.name, "\" TO \"").concat(newColumn.name, "\"")));
1122
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " RENAME COLUMN \"").concat(newColumn.name, "\" TO \"").concat(oldColumn.name, "\"")));
1123
1123
  if (!(oldColumn.type === "enum" || oldColumn.type === "simple-enum")) return [3 /*break*/, 8];
1124
1124
  return [4 /*yield*/, this.getUserDefinedTypeName(table, oldColumn)];
1125
1125
  case 7:
1126
1126
  oldEnumType = _b.sent();
1127
- upQueries.push(new Query_1.Query("ALTER TYPE \"" + oldEnumType.schema + "\".\"" + oldEnumType.name + "\" RENAME TO " + this.buildEnumName(table, newColumn, false)));
1128
- downQueries.push(new Query_1.Query("ALTER TYPE " + this.buildEnumName(table, newColumn) + " RENAME TO \"" + oldEnumType.name + "\""));
1127
+ upQueries.push(new Query_1.Query("ALTER TYPE \"".concat(oldEnumType.schema, "\".\"").concat(oldEnumType.name, "\" RENAME TO ").concat(this.buildEnumName(table, newColumn, false))));
1128
+ downQueries.push(new Query_1.Query("ALTER TYPE ".concat(this.buildEnumName(table, newColumn), " RENAME TO \"").concat(oldEnumType.name, "\"")));
1129
1129
  _b.label = 8;
1130
1130
  case 8:
1131
1131
  // rename column primary key constraint
@@ -1137,8 +1137,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1137
1137
  columnNames.splice(columnNames.indexOf(oldColumn.name), 1);
1138
1138
  columnNames.push(newColumn.name);
1139
1139
  newPkName = this.connection.namingStrategy.primaryKeyName(clonedTable, columnNames);
1140
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " RENAME CONSTRAINT \"" + oldPkName + "\" TO \"" + newPkName + "\""));
1141
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " RENAME CONSTRAINT \"" + newPkName + "\" TO \"" + oldPkName + "\""));
1140
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " RENAME CONSTRAINT \"").concat(oldPkName, "\" TO \"").concat(newPkName, "\"")));
1141
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " RENAME CONSTRAINT \"").concat(newPkName, "\" TO \"").concat(oldPkName, "\"")));
1142
1142
  }
1143
1143
  // rename column sequence
1144
1144
  if (oldColumn.isGenerated === true && newColumn.generationStrategy === "increment") {
@@ -1146,8 +1146,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1146
1146
  sequenceName = this.buildSequenceName(table, oldColumn.name);
1147
1147
  newSequencePath = this.buildSequencePath(table, newColumn.name);
1148
1148
  newSequenceName = this.buildSequenceName(table, newColumn.name);
1149
- up = "ALTER SEQUENCE " + this.escapePath(sequencePath) + " RENAME TO \"" + newSequenceName + "\"";
1150
- down = "ALTER SEQUENCE " + this.escapePath(newSequencePath) + " RENAME TO \"" + sequenceName + "\"";
1149
+ up = "ALTER SEQUENCE ".concat(this.escapePath(sequencePath), " RENAME TO \"").concat(newSequenceName, "\"");
1150
+ down = "ALTER SEQUENCE ".concat(this.escapePath(newSequencePath), " RENAME TO \"").concat(sequenceName, "\"");
1151
1151
  upQueries.push(new Query_1.Query(up));
1152
1152
  downQueries.push(new Query_1.Query(down));
1153
1153
  }
@@ -1158,8 +1158,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1158
1158
  unique.columnNames.push(newColumn.name);
1159
1159
  var newUniqueName = _this.connection.namingStrategy.uniqueConstraintName(clonedTable, unique.columnNames);
1160
1160
  // build queries
1161
- upQueries.push(new Query_1.Query("ALTER TABLE " + _this.escapePath(table) + " RENAME CONSTRAINT \"" + unique.name + "\" TO \"" + newUniqueName + "\""));
1162
- downQueries.push(new Query_1.Query("ALTER TABLE " + _this.escapePath(table) + " RENAME CONSTRAINT \"" + newUniqueName + "\" TO \"" + unique.name + "\""));
1161
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(_this.escapePath(table), " RENAME CONSTRAINT \"").concat(unique.name, "\" TO \"").concat(newUniqueName, "\"")));
1162
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(_this.escapePath(table), " RENAME CONSTRAINT \"").concat(newUniqueName, "\" TO \"").concat(unique.name, "\"")));
1163
1163
  // replace constraint name
1164
1164
  unique.name = newUniqueName;
1165
1165
  });
@@ -1171,8 +1171,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1171
1171
  var schema = _this.driver.parseTableName(table).schema;
1172
1172
  var newIndexName = _this.connection.namingStrategy.indexName(clonedTable, index.columnNames, index.where);
1173
1173
  // build queries
1174
- var up = schema ? "ALTER INDEX \"" + schema + "\".\"" + index.name + "\" RENAME TO \"" + newIndexName + "\"" : "ALTER INDEX \"" + index.name + "\" RENAME TO \"" + newIndexName + "\"";
1175
- var down = schema ? "ALTER INDEX \"" + schema + "\".\"" + newIndexName + "\" RENAME TO \"" + index.name + "\"" : "ALTER INDEX \"" + newIndexName + "\" RENAME TO \"" + index.name + "\"";
1174
+ var up = schema ? "ALTER INDEX \"".concat(schema, "\".\"").concat(index.name, "\" RENAME TO \"").concat(newIndexName, "\"") : "ALTER INDEX \"".concat(index.name, "\" RENAME TO \"").concat(newIndexName, "\"");
1175
+ var down = schema ? "ALTER INDEX \"".concat(schema, "\".\"").concat(newIndexName, "\" RENAME TO \"").concat(index.name, "\"") : "ALTER INDEX \"".concat(newIndexName, "\" RENAME TO \"").concat(index.name, "\"");
1176
1176
  upQueries.push(new Query_1.Query(up));
1177
1177
  downQueries.push(new Query_1.Query(down));
1178
1178
  // replace constraint name
@@ -1185,8 +1185,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1185
1185
  foreignKey.columnNames.push(newColumn.name);
1186
1186
  var newForeignKeyName = _this.connection.namingStrategy.foreignKeyName(clonedTable, foreignKey.columnNames, _this.getTablePath(foreignKey), foreignKey.referencedColumnNames);
1187
1187
  // build queries
1188
- upQueries.push(new Query_1.Query("ALTER TABLE " + _this.escapePath(table) + " RENAME CONSTRAINT \"" + foreignKey.name + "\" TO \"" + newForeignKeyName + "\""));
1189
- downQueries.push(new Query_1.Query("ALTER TABLE " + _this.escapePath(table) + " RENAME CONSTRAINT \"" + newForeignKeyName + "\" TO \"" + foreignKey.name + "\""));
1188
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(_this.escapePath(table), " RENAME CONSTRAINT \"").concat(foreignKey.name, "\" TO \"").concat(newForeignKeyName, "\"")));
1189
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(_this.escapePath(table), " RENAME CONSTRAINT \"").concat(newForeignKeyName, "\" TO \"").concat(foreignKey.name, "\"")));
1190
1190
  // replace constraint name
1191
1191
  foreignKey.name = newForeignKeyName;
1192
1192
  });
@@ -1196,8 +1196,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1196
1196
  _b.label = 9;
1197
1197
  case 9:
1198
1198
  if (newColumn.precision !== oldColumn.precision || newColumn.scale !== oldColumn.scale) {
1199
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" TYPE " + this.driver.createFullType(newColumn)));
1200
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" TYPE " + this.driver.createFullType(oldColumn)));
1199
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" TYPE ").concat(this.driver.createFullType(newColumn))));
1200
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" TYPE ").concat(this.driver.createFullType(oldColumn))));
1201
1201
  }
1202
1202
  if ((newColumn.type === "enum" || newColumn.type === "simple-enum")
1203
1203
  && (oldColumn.type === "enum" || oldColumn.type === "simple-enum")
@@ -1209,8 +1209,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1209
1209
  oldEnumNameWithSchema_old = this.buildEnumName(table, oldColumn, true, false, true);
1210
1210
  oldEnumNameWithoutSchema_old = this.buildEnumName(table, oldColumn, false, false, true);
1211
1211
  // rename old ENUM
1212
- upQueries.push(new Query_1.Query("ALTER TYPE " + oldEnumName + " RENAME TO " + oldEnumNameWithoutSchema_old));
1213
- downQueries.push(new Query_1.Query("ALTER TYPE " + oldEnumNameWithSchema_old + " RENAME TO " + oldEnumNameWithoutSchema));
1212
+ upQueries.push(new Query_1.Query("ALTER TYPE ".concat(oldEnumName, " RENAME TO ").concat(oldEnumNameWithoutSchema_old)));
1213
+ downQueries.push(new Query_1.Query("ALTER TYPE ".concat(oldEnumNameWithSchema_old, " RENAME TO ").concat(oldEnumNameWithoutSchema)));
1214
1214
  // create new ENUM
1215
1215
  upQueries.push(this.createEnumTypeSql(table, newColumn, newEnumName));
1216
1216
  downQueries.push(this.dropEnumTypeSql(table, newColumn, newEnumName));
@@ -1218,18 +1218,18 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1218
1218
  if (oldColumn.default !== null && oldColumn.default !== undefined) {
1219
1219
  // mark default as changed to prevent double update
1220
1220
  defaultValueChanged = true;
1221
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + oldColumn.name + "\" DROP DEFAULT"));
1222
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + oldColumn.name + "\" SET DEFAULT " + oldColumn.default));
1221
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(oldColumn.name, "\" DROP DEFAULT")));
1222
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(oldColumn.name, "\" SET DEFAULT ").concat(oldColumn.default)));
1223
1223
  }
1224
- upType = "" + newEnumName + arraySuffix + " USING \"" + newColumn.name + "\"::\"text\"::" + newEnumName + arraySuffix;
1225
- downType = "" + oldEnumNameWithSchema_old + arraySuffix + " USING \"" + newColumn.name + "\"::\"text\"::" + oldEnumNameWithSchema_old + arraySuffix;
1224
+ upType = "".concat(newEnumName).concat(arraySuffix, " USING \"").concat(newColumn.name, "\"::\"text\"::").concat(newEnumName).concat(arraySuffix);
1225
+ downType = "".concat(oldEnumNameWithSchema_old).concat(arraySuffix, " USING \"").concat(newColumn.name, "\"::\"text\"::").concat(oldEnumNameWithSchema_old).concat(arraySuffix);
1226
1226
  // update column to use new type
1227
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" TYPE " + upType));
1228
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" TYPE " + downType));
1227
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" TYPE ").concat(upType)));
1228
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" TYPE ").concat(downType)));
1229
1229
  // restore column default or create new one
1230
1230
  if (newColumn.default !== null && newColumn.default !== undefined) {
1231
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" SET DEFAULT " + newColumn.default));
1232
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" DROP DEFAULT"));
1231
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" SET DEFAULT ").concat(newColumn.default)));
1232
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" DROP DEFAULT")));
1233
1233
  }
1234
1234
  // remove old ENUM
1235
1235
  upQueries.push(this.dropEnumTypeSql(table, oldColumn, oldEnumNameWithSchema_old));
@@ -1237,35 +1237,35 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1237
1237
  }
1238
1238
  if (oldColumn.isNullable !== newColumn.isNullable) {
1239
1239
  if (newColumn.isNullable) {
1240
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + oldColumn.name + "\" DROP NOT NULL"));
1241
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + oldColumn.name + "\" SET NOT NULL"));
1240
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(oldColumn.name, "\" DROP NOT NULL")));
1241
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(oldColumn.name, "\" SET NOT NULL")));
1242
1242
  }
1243
1243
  else {
1244
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + oldColumn.name + "\" SET NOT NULL"));
1245
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + oldColumn.name + "\" DROP NOT NULL"));
1244
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(oldColumn.name, "\" SET NOT NULL")));
1245
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(oldColumn.name, "\" DROP NOT NULL")));
1246
1246
  }
1247
1247
  }
1248
1248
  if (oldColumn.comment !== newColumn.comment) {
1249
- upQueries.push(new Query_1.Query("COMMENT ON COLUMN " + this.escapePath(table) + ".\"" + oldColumn.name + "\" IS " + this.escapeComment(newColumn.comment)));
1250
- downQueries.push(new Query_1.Query("COMMENT ON COLUMN " + this.escapePath(table) + ".\"" + newColumn.name + "\" IS " + this.escapeComment(oldColumn.comment)));
1249
+ upQueries.push(new Query_1.Query("COMMENT ON COLUMN ".concat(this.escapePath(table), ".\"").concat(oldColumn.name, "\" IS ").concat(this.escapeComment(newColumn.comment))));
1250
+ downQueries.push(new Query_1.Query("COMMENT ON COLUMN ".concat(this.escapePath(table), ".\"").concat(newColumn.name, "\" IS ").concat(this.escapeComment(oldColumn.comment))));
1251
1251
  }
1252
1252
  if (newColumn.isPrimary !== oldColumn.isPrimary) {
1253
1253
  primaryColumns = clonedTable.primaryColumns;
1254
1254
  // if primary column state changed, we must always drop existed constraint.
1255
1255
  if (primaryColumns.length > 0) {
1256
1256
  pkName = this.connection.namingStrategy.primaryKeyName(clonedTable, primaryColumns.map(function (column) { return column.name; }));
1257
- columnNames = primaryColumns.map(function (column) { return "\"" + column.name + "\""; }).join(", ");
1258
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + pkName + "\""));
1259
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + pkName + "\" PRIMARY KEY (" + columnNames + ")"));
1257
+ columnNames = primaryColumns.map(function (column) { return "\"".concat(column.name, "\""); }).join(", ");
1258
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(pkName, "\"")));
1259
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(pkName, "\" PRIMARY KEY (").concat(columnNames, ")")));
1260
1260
  }
1261
1261
  if (newColumn.isPrimary === true) {
1262
1262
  primaryColumns.push(newColumn);
1263
1263
  column = clonedTable.columns.find(function (column) { return column.name === newColumn.name; });
1264
1264
  column.isPrimary = true;
1265
1265
  pkName = this.connection.namingStrategy.primaryKeyName(clonedTable, primaryColumns.map(function (column) { return column.name; }));
1266
- columnNames = primaryColumns.map(function (column) { return "\"" + column.name + "\""; }).join(", ");
1267
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + pkName + "\" PRIMARY KEY (" + columnNames + ")"));
1268
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + pkName + "\""));
1266
+ columnNames = primaryColumns.map(function (column) { return "\"".concat(column.name, "\""); }).join(", ");
1267
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(pkName, "\" PRIMARY KEY (").concat(columnNames, ")")));
1268
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(pkName, "\"")));
1269
1269
  }
1270
1270
  else {
1271
1271
  primaryColumn = primaryColumns.find(function (c) { return c.name === newColumn.name; });
@@ -1275,9 +1275,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1275
1275
  // if we have another primary keys, we must recreate constraint.
1276
1276
  if (primaryColumns.length > 0) {
1277
1277
  pkName = this.connection.namingStrategy.primaryKeyName(clonedTable, primaryColumns.map(function (column) { return column.name; }));
1278
- columnNames = primaryColumns.map(function (column) { return "\"" + column.name + "\""; }).join(", ");
1279
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + pkName + "\" PRIMARY KEY (" + columnNames + ")"));
1280
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + pkName + "\""));
1278
+ columnNames = primaryColumns.map(function (column) { return "\"".concat(column.name, "\""); }).join(", ");
1279
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(pkName, "\" PRIMARY KEY (").concat(columnNames, ")")));
1280
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(pkName, "\"")));
1281
1281
  }
1282
1282
  }
1283
1283
  }
@@ -1288,76 +1288,76 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1288
1288
  columnNames: [newColumn.name]
1289
1289
  });
1290
1290
  clonedTable.uniques.push(uniqueConstraint);
1291
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + uniqueConstraint.name + "\" UNIQUE (\"" + newColumn.name + "\")"));
1292
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + uniqueConstraint.name + "\""));
1291
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(uniqueConstraint.name, "\" UNIQUE (\"").concat(newColumn.name, "\")")));
1292
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(uniqueConstraint.name, "\"")));
1293
1293
  }
1294
1294
  else {
1295
1295
  uniqueConstraint = clonedTable.uniques.find(function (unique) {
1296
1296
  return unique.columnNames.length === 1 && !!unique.columnNames.find(function (columnName) { return columnName === newColumn.name; });
1297
1297
  });
1298
1298
  clonedTable.uniques.splice(clonedTable.uniques.indexOf(uniqueConstraint), 1);
1299
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + uniqueConstraint.name + "\""));
1300
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + uniqueConstraint.name + "\" UNIQUE (\"" + newColumn.name + "\")"));
1299
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(uniqueConstraint.name, "\"")));
1300
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(uniqueConstraint.name, "\" UNIQUE (\"").concat(newColumn.name, "\")")));
1301
1301
  }
1302
1302
  }
1303
1303
  if (oldColumn.isGenerated !== newColumn.isGenerated) {
1304
1304
  // if old column was "generated", we should clear defaults
1305
1305
  if (oldColumn.isGenerated) {
1306
1306
  if (oldColumn.generationStrategy === "uuid") {
1307
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + oldColumn.name + "\" DROP DEFAULT"));
1308
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + oldColumn.name + "\" SET DEFAULT " + this.driver.uuidGenerator));
1307
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(oldColumn.name, "\" DROP DEFAULT")));
1308
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(oldColumn.name, "\" SET DEFAULT ").concat(this.driver.uuidGenerator)));
1309
1309
  }
1310
1310
  else if (oldColumn.generationStrategy === "increment") {
1311
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" DROP DEFAULT"));
1312
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" SET DEFAULT nextval('" + this.escapePath(this.buildSequencePath(table, newColumn)) + "')"));
1313
- upQueries.push(new Query_1.Query("DROP SEQUENCE " + this.escapePath(this.buildSequencePath(table, newColumn))));
1314
- downQueries.push(new Query_1.Query("CREATE SEQUENCE IF NOT EXISTS " + this.escapePath(this.buildSequencePath(table, newColumn)) + " OWNED BY " + this.escapePath(table) + ".\"" + newColumn.name + "\""));
1311
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" DROP DEFAULT")));
1312
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" SET DEFAULT nextval('").concat(this.escapePath(this.buildSequencePath(table, newColumn)), "')")));
1313
+ upQueries.push(new Query_1.Query("DROP SEQUENCE ".concat(this.escapePath(this.buildSequencePath(table, newColumn)))));
1314
+ downQueries.push(new Query_1.Query("CREATE SEQUENCE IF NOT EXISTS ".concat(this.escapePath(this.buildSequencePath(table, newColumn)), " OWNED BY ").concat(this.escapePath(table), ".\"").concat(newColumn.name, "\"")));
1315
1315
  }
1316
1316
  }
1317
1317
  if (newColumn.generationStrategy === "uuid") {
1318
1318
  if (newColumn.isGenerated === true) {
1319
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" SET DEFAULT " + this.driver.uuidGenerator));
1320
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" DROP DEFAULT"));
1319
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" SET DEFAULT ").concat(this.driver.uuidGenerator)));
1320
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" DROP DEFAULT")));
1321
1321
  }
1322
1322
  else {
1323
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" DROP DEFAULT"));
1324
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" SET DEFAULT " + this.driver.uuidGenerator));
1323
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" DROP DEFAULT")));
1324
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" SET DEFAULT ").concat(this.driver.uuidGenerator)));
1325
1325
  }
1326
1326
  }
1327
1327
  else if (newColumn.generationStrategy === "increment") {
1328
1328
  if (newColumn.isGenerated === true) {
1329
- upQueries.push(new Query_1.Query("CREATE SEQUENCE IF NOT EXISTS " + this.escapePath(this.buildSequencePath(table, newColumn)) + " OWNED BY " + this.escapePath(table) + ".\"" + newColumn.name + "\""));
1330
- downQueries.push(new Query_1.Query("DROP SEQUENCE " + this.escapePath(this.buildSequencePath(table, newColumn))));
1331
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" SET DEFAULT nextval('" + this.escapePath(this.buildSequencePath(table, newColumn)) + "')"));
1332
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" DROP DEFAULT"));
1329
+ upQueries.push(new Query_1.Query("CREATE SEQUENCE IF NOT EXISTS ".concat(this.escapePath(this.buildSequencePath(table, newColumn)), " OWNED BY ").concat(this.escapePath(table), ".\"").concat(newColumn.name, "\"")));
1330
+ downQueries.push(new Query_1.Query("DROP SEQUENCE ".concat(this.escapePath(this.buildSequencePath(table, newColumn)))));
1331
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" SET DEFAULT nextval('").concat(this.escapePath(this.buildSequencePath(table, newColumn)), "')")));
1332
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" DROP DEFAULT")));
1333
1333
  }
1334
1334
  else {
1335
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" DROP DEFAULT"));
1336
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" SET DEFAULT nextval('" + this.escapePath(this.buildSequencePath(table, newColumn)) + "')"));
1337
- upQueries.push(new Query_1.Query("DROP SEQUENCE " + this.escapePath(this.buildSequencePath(table, newColumn))));
1338
- downQueries.push(new Query_1.Query("CREATE SEQUENCE IF NOT EXISTS " + this.escapePath(this.buildSequencePath(table, newColumn)) + " OWNED BY " + this.escapePath(table) + ".\"" + newColumn.name + "\""));
1335
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" DROP DEFAULT")));
1336
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" SET DEFAULT nextval('").concat(this.escapePath(this.buildSequencePath(table, newColumn)), "')")));
1337
+ upQueries.push(new Query_1.Query("DROP SEQUENCE ".concat(this.escapePath(this.buildSequencePath(table, newColumn)))));
1338
+ downQueries.push(new Query_1.Query("CREATE SEQUENCE IF NOT EXISTS ".concat(this.escapePath(this.buildSequencePath(table, newColumn)), " OWNED BY ").concat(this.escapePath(table), ".\"").concat(newColumn.name, "\"")));
1339
1339
  }
1340
1340
  }
1341
1341
  }
1342
1342
  // the default might have changed when the enum changed
1343
1343
  if (newColumn.default !== oldColumn.default && !defaultValueChanged) {
1344
1344
  if (newColumn.default !== null && newColumn.default !== undefined) {
1345
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" SET DEFAULT " + newColumn.default));
1345
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" SET DEFAULT ").concat(newColumn.default)));
1346
1346
  if (oldColumn.default !== null && oldColumn.default !== undefined) {
1347
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" SET DEFAULT " + oldColumn.default));
1347
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" SET DEFAULT ").concat(oldColumn.default)));
1348
1348
  }
1349
1349
  else {
1350
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" DROP DEFAULT"));
1350
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" DROP DEFAULT")));
1351
1351
  }
1352
1352
  }
1353
1353
  else if (oldColumn.default !== null && oldColumn.default !== undefined) {
1354
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" DROP DEFAULT"));
1355
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" SET DEFAULT " + oldColumn.default));
1354
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" DROP DEFAULT")));
1355
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" SET DEFAULT ").concat(oldColumn.default)));
1356
1356
  }
1357
1357
  }
1358
1358
  if ((newColumn.spatialFeatureType || "").toLowerCase() !== (oldColumn.spatialFeatureType || "").toLowerCase() || newColumn.srid !== oldColumn.srid) {
1359
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" TYPE " + this.driver.createFullType(newColumn)));
1360
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ALTER COLUMN \"" + newColumn.name + "\" TYPE " + this.driver.createFullType(oldColumn)));
1359
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" TYPE ").concat(this.driver.createFullType(newColumn))));
1360
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ALTER COLUMN \"").concat(newColumn.name, "\" TYPE ").concat(this.driver.createFullType(oldColumn))));
1361
1361
  }
1362
1362
  if (!(newColumn.generatedType !== oldColumn.generatedType)) return [3 /*break*/, 11];
1363
1363
  if (!(!newColumn.generatedType || newColumn.generatedType === "VIRTUAL")) return [3 /*break*/, 11];
@@ -1366,10 +1366,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1366
1366
  tableNameWithSchema = (_b.sent()).split('.');
1367
1367
  tableName = tableNameWithSchema[1];
1368
1368
  schema = tableNameWithSchema[0];
1369
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " RENAME COLUMN \"" + oldColumn.name + "\" TO \"TEMP_OLD_" + oldColumn.name + "\""));
1370
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD " + this.buildCreateColumnSql(table, newColumn)));
1371
- upQueries.push(new Query_1.Query("UPDATE " + this.escapePath(table) + " SET \"" + newColumn.name + "\" = \"TEMP_OLD_" + oldColumn.name + "\""));
1372
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP COLUMN \"TEMP_OLD_" + oldColumn.name + "\""));
1369
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " RENAME COLUMN \"").concat(oldColumn.name, "\" TO \"TEMP_OLD_").concat(oldColumn.name, "\"")));
1370
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD ").concat(this.buildCreateColumnSql(table, newColumn))));
1371
+ upQueries.push(new Query_1.Query("UPDATE ".concat(this.escapePath(table), " SET \"").concat(newColumn.name, "\" = \"TEMP_OLD_").concat(oldColumn.name, "\"")));
1372
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP COLUMN \"TEMP_OLD_").concat(oldColumn.name, "\"")));
1373
1373
  upQueries.push(this.deleteTypeormMetadataSql({
1374
1374
  database: this.driver.database,
1375
1375
  schema: schema,
@@ -1378,8 +1378,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1378
1378
  name: oldColumn.name
1379
1379
  }));
1380
1380
  // However, we can't copy it back on downgrade. It needs to regenerate.
1381
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP COLUMN \"" + newColumn.name + "\""));
1382
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD " + this.buildCreateColumnSql(table, oldColumn)));
1381
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP COLUMN \"").concat(newColumn.name, "\"")));
1382
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD ").concat(this.buildCreateColumnSql(table, oldColumn))));
1383
1383
  downQueries.push(this.deleteTypeormMetadataSql({
1384
1384
  database: this.driver.database,
1385
1385
  schema: schema,
@@ -1464,24 +1464,24 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1464
1464
  table = _a;
1465
1465
  column = columnOrName instanceof TableColumn_1.TableColumn ? columnOrName : table.findColumnByName(columnOrName);
1466
1466
  if (!column)
1467
- throw new error_1.TypeORMError("Column \"" + columnOrName + "\" was not found in table \"" + table.name + "\"");
1467
+ throw new error_1.TypeORMError("Column \"".concat(columnOrName, "\" was not found in table \"").concat(table.name, "\""));
1468
1468
  clonedTable = table.clone();
1469
1469
  upQueries = [];
1470
1470
  downQueries = [];
1471
1471
  // drop primary key constraint
1472
1472
  if (column.isPrimary) {
1473
1473
  pkName = this.connection.namingStrategy.primaryKeyName(clonedTable, clonedTable.primaryColumns.map(function (column) { return column.name; }));
1474
- columnNames = clonedTable.primaryColumns.map(function (primaryColumn) { return "\"" + primaryColumn.name + "\""; }).join(", ");
1475
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(clonedTable) + " DROP CONSTRAINT \"" + pkName + "\""));
1476
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(clonedTable) + " ADD CONSTRAINT \"" + pkName + "\" PRIMARY KEY (" + columnNames + ")"));
1474
+ columnNames = clonedTable.primaryColumns.map(function (primaryColumn) { return "\"".concat(primaryColumn.name, "\""); }).join(", ");
1475
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(clonedTable), " DROP CONSTRAINT \"").concat(pkName, "\"")));
1476
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(clonedTable), " ADD CONSTRAINT \"").concat(pkName, "\" PRIMARY KEY (").concat(columnNames, ")")));
1477
1477
  tableColumn = clonedTable.findColumnByName(column.name);
1478
1478
  tableColumn.isPrimary = false;
1479
1479
  // if primary key have multiple columns, we must recreate it without dropped column
1480
1480
  if (clonedTable.primaryColumns.length > 0) {
1481
1481
  pkName_2 = this.connection.namingStrategy.primaryKeyName(clonedTable, clonedTable.primaryColumns.map(function (column) { return column.name; }));
1482
- columnNames_2 = clonedTable.primaryColumns.map(function (primaryColumn) { return "\"" + primaryColumn.name + "\""; }).join(", ");
1483
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(clonedTable) + " ADD CONSTRAINT \"" + pkName_2 + "\" PRIMARY KEY (" + columnNames_2 + ")"));
1484
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(clonedTable) + " DROP CONSTRAINT \"" + pkName_2 + "\""));
1482
+ columnNames_2 = clonedTable.primaryColumns.map(function (primaryColumn) { return "\"".concat(primaryColumn.name, "\""); }).join(", ");
1483
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(clonedTable), " ADD CONSTRAINT \"").concat(pkName_2, "\" PRIMARY KEY (").concat(columnNames_2, ")")));
1484
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(clonedTable), " DROP CONSTRAINT \"").concat(pkName_2, "\"")));
1485
1485
  }
1486
1486
  }
1487
1487
  columnIndex = clonedTable.indices.find(function (index) { return index.columnNames.length === 1 && index.columnNames[0] === column.name; });
@@ -1502,8 +1502,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1502
1502
  upQueries.push(this.dropUniqueConstraintSql(table, columnUnique));
1503
1503
  downQueries.push(this.createUniqueConstraintSql(table, columnUnique));
1504
1504
  }
1505
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP COLUMN \"" + column.name + "\""));
1506
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD " + this.buildCreateColumnSql(table, column)));
1505
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP COLUMN \"").concat(column.name, "\"")));
1506
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD ").concat(this.buildCreateColumnSql(table, column))));
1507
1507
  if (!(column.type === "enum" || column.type === "simple-enum")) return [3 /*break*/, 6];
1508
1508
  return [4 /*yield*/, this.hasEnumType(table, column)];
1509
1509
  case 4:
@@ -1512,7 +1512,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1512
1512
  return [4 /*yield*/, this.getUserDefinedTypeName(table, column)];
1513
1513
  case 5:
1514
1514
  enumType = _b.sent();
1515
- escapedEnumName = "\"" + enumType.schema + "\".\"" + enumType.name + "\"";
1515
+ escapedEnumName = "\"".concat(enumType.schema, "\".\"").concat(enumType.name, "\"");
1516
1516
  upQueries.push(this.dropEnumTypeSql(table, column, escapedEnumName));
1517
1517
  downQueries.push(this.createEnumTypeSql(table, column, escapedEnumName));
1518
1518
  _b.label = 6;
@@ -1650,18 +1650,18 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1650
1650
  primaryColumns = clonedTable.primaryColumns;
1651
1651
  if (primaryColumns.length > 0) {
1652
1652
  pkName_3 = this.connection.namingStrategy.primaryKeyName(clonedTable, primaryColumns.map(function (column) { return column.name; }));
1653
- columnNamesString_1 = primaryColumns.map(function (column) { return "\"" + column.name + "\""; }).join(", ");
1654
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + pkName_3 + "\""));
1655
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + pkName_3 + "\" PRIMARY KEY (" + columnNamesString_1 + ")"));
1653
+ columnNamesString_1 = primaryColumns.map(function (column) { return "\"".concat(column.name, "\""); }).join(", ");
1654
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(pkName_3, "\"")));
1655
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(pkName_3, "\" PRIMARY KEY (").concat(columnNamesString_1, ")")));
1656
1656
  }
1657
1657
  // update columns in table.
1658
1658
  clonedTable.columns
1659
1659
  .filter(function (column) { return columnNames.indexOf(column.name) !== -1; })
1660
1660
  .forEach(function (column) { return column.isPrimary = true; });
1661
1661
  pkName = this.connection.namingStrategy.primaryKeyName(clonedTable, columnNames);
1662
- columnNamesString = columnNames.map(function (columnName) { return "\"" + columnName + "\""; }).join(", ");
1663
- upQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + pkName + "\" PRIMARY KEY (" + columnNamesString + ")"));
1664
- downQueries.push(new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + pkName + "\""));
1662
+ columnNamesString = columnNames.map(function (columnName) { return "\"".concat(columnName, "\""); }).join(", ");
1663
+ upQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(pkName, "\" PRIMARY KEY (").concat(columnNamesString, ")")));
1664
+ downQueries.push(new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(pkName, "\"")));
1665
1665
  return [4 /*yield*/, this.executeQueries(upQueries, downQueries)];
1666
1666
  case 4:
1667
1667
  _b.sent();
@@ -1793,7 +1793,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1793
1793
  table = _a;
1794
1794
  uniqueConstraint = uniqueOrName instanceof TableUnique_1.TableUnique ? uniqueOrName : table.uniques.find(function (u) { return u.name === uniqueOrName; });
1795
1795
  if (!uniqueConstraint)
1796
- throw new error_1.TypeORMError("Supplied unique constraint was not found in table " + table.name);
1796
+ throw new error_1.TypeORMError("Supplied unique constraint was not found in table ".concat(table.name));
1797
1797
  up = this.dropUniqueConstraintSql(table, uniqueConstraint);
1798
1798
  down = this.createUniqueConstraintSql(table, uniqueConstraint);
1799
1799
  return [4 /*yield*/, this.executeQueries(up, down)];
@@ -1915,7 +1915,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
1915
1915
  table = _a;
1916
1916
  checkConstraint = checkOrName instanceof TableCheck_1.TableCheck ? checkOrName : table.checks.find(function (c) { return c.name === checkOrName; });
1917
1917
  if (!checkConstraint)
1918
- throw new error_1.TypeORMError("Supplied check constraint was not found in table " + table.name);
1918
+ throw new error_1.TypeORMError("Supplied check constraint was not found in table ".concat(table.name));
1919
1919
  up = this.dropCheckConstraintSql(table, checkConstraint);
1920
1920
  down = this.createCheckConstraintSql(table, checkConstraint);
1921
1921
  return [4 /*yield*/, this.executeQueries(up, down)];
@@ -2017,7 +2017,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2017
2017
  table = _a;
2018
2018
  exclusionConstraint = exclusionOrName instanceof TableExclusion_1.TableExclusion ? exclusionOrName : table.exclusions.find(function (c) { return c.name === exclusionOrName; });
2019
2019
  if (!exclusionConstraint)
2020
- throw new error_1.TypeORMError("Supplied exclusion constraint was not found in table " + table.name);
2020
+ throw new error_1.TypeORMError("Supplied exclusion constraint was not found in table ".concat(table.name));
2021
2021
  up = this.dropExclusionConstraintSql(table, exclusionConstraint);
2022
2022
  down = this.createExclusionConstraintSql(table, exclusionConstraint);
2023
2023
  return [4 /*yield*/, this.executeQueries(up, down)];
@@ -2139,7 +2139,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2139
2139
  table = _a;
2140
2140
  foreignKey = foreignKeyOrName instanceof TableForeignKey_1.TableForeignKey ? foreignKeyOrName : table.foreignKeys.find(function (fk) { return fk.name === foreignKeyOrName; });
2141
2141
  if (!foreignKey)
2142
- throw new error_1.TypeORMError("Supplied foreign key was not found in table " + table.name);
2142
+ throw new error_1.TypeORMError("Supplied foreign key was not found in table ".concat(table.name));
2143
2143
  up = this.dropForeignKeySql(table, foreignKey);
2144
2144
  down = this.createForeignKeySql(table, foreignKey);
2145
2145
  return [4 /*yield*/, this.executeQueries(up, down)];
@@ -2281,7 +2281,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2281
2281
  table = _a;
2282
2282
  index = indexOrName instanceof TableIndex_1.TableIndex ? indexOrName : table.indices.find(function (i) { return i.name === indexOrName; });
2283
2283
  if (!index)
2284
- throw new error_1.TypeORMError("Supplied index " + indexOrName + " was not found in table " + table.name);
2284
+ throw new error_1.TypeORMError("Supplied index ".concat(indexOrName, " was not found in table ").concat(table.name));
2285
2285
  up = this.dropIndexSql(table, index);
2286
2286
  down = this.createIndexSql(table, index);
2287
2287
  return [4 /*yield*/, this.executeQueries(up, down)];
@@ -2340,7 +2340,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2340
2340
  return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {
2341
2341
  return (0, tslib_1.__generator)(this, function (_a) {
2342
2342
  switch (_a.label) {
2343
- case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE " + this.escapePath(tableName))];
2343
+ case 0: return [4 /*yield*/, this.query("TRUNCATE TABLE ".concat(this.escapePath(tableName)))];
2344
2344
  case 1:
2345
2345
  _a.sent();
2346
2346
  return [2 /*return*/];
@@ -2384,7 +2384,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2384
2384
  case 3:
2385
2385
  version = _a.sent();
2386
2386
  selectViewDropsQuery = "SELECT 'DROP VIEW IF EXISTS \"' || schemaname || '\".\"' || viewname || '\" CASCADE;' as \"query\" " +
2387
- ("FROM \"pg_views\" WHERE \"schemaname\" IN (" + schemaNamesString + ") AND \"viewname\" NOT IN ('geography_columns', 'geometry_columns', 'raster_columns', 'raster_overviews')");
2387
+ "FROM \"pg_views\" WHERE \"schemaname\" IN (".concat(schemaNamesString, ") AND \"viewname\" NOT IN ('geography_columns', 'geometry_columns', 'raster_columns', 'raster_overviews')");
2388
2388
  return [4 /*yield*/, this.query(selectViewDropsQuery)];
2389
2389
  case 4:
2390
2390
  dropViewQueries = _a.sent();
@@ -2393,7 +2393,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2393
2393
  _a.sent();
2394
2394
  if (!VersionUtils_1.VersionUtils.isGreaterOrEqual(version, "9.3")) return [3 /*break*/, 8];
2395
2395
  selectMatViewDropsQuery = "SELECT 'DROP MATERIALIZED VIEW IF EXISTS \"' || schemaname || '\".\"' || matviewname || '\" CASCADE;' as \"query\" " +
2396
- ("FROM \"pg_matviews\" WHERE \"schemaname\" IN (" + schemaNamesString + ")");
2396
+ "FROM \"pg_matviews\" WHERE \"schemaname\" IN (".concat(schemaNamesString, ")");
2397
2397
  return [4 /*yield*/, this.query(selectMatViewDropsQuery)];
2398
2398
  case 6:
2399
2399
  dropMatViewQueries = _a.sent();
@@ -2402,7 +2402,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2402
2402
  _a.sent();
2403
2403
  _a.label = 8;
2404
2404
  case 8:
2405
- selectTableDropsQuery = "SELECT 'DROP TABLE IF EXISTS \"' || schemaname || '\".\"' || tablename || '\" CASCADE;' as \"query\" FROM \"pg_tables\" WHERE \"schemaname\" IN (" + schemaNamesString + ") AND \"tablename\" NOT IN ('spatial_ref_sys')";
2405
+ selectTableDropsQuery = "SELECT 'DROP TABLE IF EXISTS \"' || schemaname || '\".\"' || tablename || '\" CASCADE;' as \"query\" FROM \"pg_tables\" WHERE \"schemaname\" IN (".concat(schemaNamesString, ") AND \"tablename\" NOT IN ('spatial_ref_sys')");
2406
2406
  return [4 /*yield*/, this.query(selectTableDropsQuery)];
2407
2407
  case 9:
2408
2408
  dropTableQueries = _a.sent();
@@ -2470,12 +2470,12 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2470
2470
  if (!schema) {
2471
2471
  schema = _this.driver.options.schema || currentSchema;
2472
2472
  }
2473
- return "(\"t\".\"schema\" = '" + schema + "' AND \"t\".\"name\" = '" + tableName + "')";
2473
+ return "(\"t\".\"schema\" = '".concat(schema, "' AND \"t\".\"name\" = '").concat(tableName, "')");
2474
2474
  }).join(" OR ");
2475
- query = "SELECT \"t\".* FROM " + this.escapePath(this.getTypeormMetadataTableName()) + " \"t\" " +
2475
+ query = "SELECT \"t\".* FROM ".concat(this.escapePath(this.getTypeormMetadataTableName()), " \"t\" ") +
2476
2476
  "INNER JOIN \"pg_catalog\".\"pg_class\" \"c\" ON \"c\".\"relname\" = \"t\".\"name\" " +
2477
2477
  "INNER JOIN \"pg_namespace\" \"n\" ON \"n\".\"oid\" = \"c\".\"relnamespace\" AND \"n\".\"nspname\" = \"t\".\"schema\" " +
2478
- ("WHERE \"t\".\"type\" IN ('" + MetadataTableType_1.MetadataTableType.VIEW + "', '" + MetadataTableType_1.MetadataTableType.MATERIALIZED_VIEW + "') " + (viewsCondition ? "AND (" + viewsCondition + ")" : ""));
2478
+ "WHERE \"t\".\"type\" IN ('".concat(MetadataTableType_1.MetadataTableType.VIEW, "', '").concat(MetadataTableType_1.MetadataTableType.MATERIALIZED_VIEW, "') ").concat(viewsCondition ? "AND (".concat(viewsCondition, ")") : "");
2479
2479
  return [4 /*yield*/, this.query(query)];
2480
2480
  case 4:
2481
2481
  dbViews = _a.sent();
@@ -2528,7 +2528,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2528
2528
  .map(function (tableName) { return _this.driver.parseTableName(tableName); })
2529
2529
  .map(function (_a) {
2530
2530
  var schema = _a.schema, tableName = _a.tableName;
2531
- return "(\"table_schema\" = '" + (schema || currentSchema) + "' AND \"table_name\" = '" + tableName + "')";
2531
+ return "(\"table_schema\" = '".concat(schema || currentSchema, "' AND \"table_name\" = '").concat(tableName, "')");
2532
2532
  }).join(" OR ");
2533
2533
  tablesSql = "SELECT \"table_schema\", \"table_name\" FROM \"information_schema\".\"tables\" WHERE " + tablesCondition;
2534
2534
  _f = (_e = dbTables.push).apply;
@@ -2545,7 +2545,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2545
2545
  }
2546
2546
  columnsCondition = dbTables.map(function (_a) {
2547
2547
  var table_schema = _a.table_schema, table_name = _a.table_name;
2548
- return "(\"table_schema\" = '" + table_schema + "' AND \"table_name\" = '" + table_name + "')";
2548
+ return "(\"table_schema\" = '".concat(table_schema, "' AND \"table_name\" = '").concat(table_name, "')");
2549
2549
  }).join(" OR ");
2550
2550
  columnsSql = "SELECT columns.*, pg_catalog.col_description(('\"' || table_catalog || '\".\"' || table_schema || '\".\"' || table_name || '\"')::regclass::oid, ordinal_position) AS description, " +
2551
2551
  "('\"' || \"udt_schema\" || '\".\"' || \"udt_name\" || '\"')::\"regtype\" AS \"regtype\", pg_catalog.format_type(\"col_attr\".\"atttypid\", \"col_attr\".\"atttypmod\") AS \"format_type\" " +
@@ -2560,7 +2560,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2560
2560
  "WHERE " + columnsCondition;
2561
2561
  constraintsCondition = dbTables.map(function (_a) {
2562
2562
  var table_schema = _a.table_schema, table_name = _a.table_name;
2563
- return "(\"ns\".\"nspname\" = '" + table_schema + "' AND \"t\".\"relname\" = '" + table_name + "')";
2563
+ return "(\"ns\".\"nspname\" = '".concat(table_schema, "' AND \"t\".\"relname\" = '").concat(table_name, "')");
2564
2564
  }).join(" OR ");
2565
2565
  constraintsSql = "SELECT \"ns\".\"nspname\" AS \"table_schema\", \"t\".\"relname\" AS \"table_name\", \"cnst\".\"conname\" AS \"constraint_name\", " +
2566
2566
  "pg_get_constraintdef(\"cnst\".\"oid\") AS \"expression\", " +
@@ -2569,7 +2569,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2569
2569
  "INNER JOIN \"pg_class\" \"t\" ON \"t\".\"oid\" = \"cnst\".\"conrelid\" " +
2570
2570
  "INNER JOIN \"pg_namespace\" \"ns\" ON \"ns\".\"oid\" = \"cnst\".\"connamespace\" " +
2571
2571
  "LEFT JOIN \"pg_attribute\" \"a\" ON \"a\".\"attrelid\" = \"cnst\".\"conrelid\" AND \"a\".\"attnum\" = ANY (\"cnst\".\"conkey\") " +
2572
- ("WHERE \"t\".\"relkind\" IN ('r', 'p') AND (" + constraintsCondition + ")");
2572
+ "WHERE \"t\".\"relkind\" IN ('r', 'p') AND (".concat(constraintsCondition, ")");
2573
2573
  indicesSql = "SELECT \"ns\".\"nspname\" AS \"table_schema\", \"t\".\"relname\" AS \"table_name\", \"i\".\"relname\" AS \"constraint_name\", \"a\".\"attname\" AS \"column_name\", " +
2574
2574
  "CASE \"ix\".\"indisunique\" WHEN 't' THEN 'TRUE' ELSE'FALSE' END AS \"is_unique\", pg_get_expr(\"ix\".\"indpred\", \"ix\".\"indrelid\") AS \"condition\", " +
2575
2575
  "\"types\".\"typname\" AS \"type_name\" " +
@@ -2580,10 +2580,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2580
2580
  "INNER JOIN \"pg_class\" \"i\" ON \"i\".\"oid\" = \"ix\".\"indexrelid\" " +
2581
2581
  "INNER JOIN \"pg_type\" \"types\" ON \"types\".\"oid\" = \"a\".\"atttypid\" " +
2582
2582
  "LEFT JOIN \"pg_constraint\" \"cnst\" ON \"cnst\".\"conname\" = \"i\".\"relname\" " +
2583
- ("WHERE \"t\".\"relkind\" IN ('r', 'p') AND \"cnst\".\"contype\" IS NULL AND (" + constraintsCondition + ")");
2583
+ "WHERE \"t\".\"relkind\" IN ('r', 'p') AND \"cnst\".\"contype\" IS NULL AND (".concat(constraintsCondition, ")");
2584
2584
  foreignKeysCondition = dbTables.map(function (_a) {
2585
2585
  var table_schema = _a.table_schema, table_name = _a.table_name;
2586
- return "(\"ns\".\"nspname\" = '" + table_schema + "' AND \"cl\".\"relname\" = '" + table_name + "')";
2586
+ return "(\"ns\".\"nspname\" = '".concat(table_schema, "' AND \"cl\".\"relname\" = '").concat(table_name, "')");
2587
2587
  }).join(" OR ");
2588
2588
  return [4 /*yield*/, this.hasSupportForPartitionedTables()];
2589
2589
  case 7:
@@ -2601,10 +2601,10 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2601
2601
  "FROM \"pg_class\" \"cl\" " +
2602
2602
  "INNER JOIN \"pg_namespace\" \"ns\" ON \"cl\".\"relnamespace\" = \"ns\".\"oid\" " +
2603
2603
  "INNER JOIN \"pg_constraint\" \"con1\" ON \"con1\".\"conrelid\" = \"cl\".\"oid\" " +
2604
- ("WHERE \"con1\".\"contype\" = 'f' AND (" + foreignKeysCondition + ") ") +
2604
+ "WHERE \"con1\".\"contype\" = 'f' AND (".concat(foreignKeysCondition, ") ") +
2605
2605
  ") \"con\" " +
2606
2606
  "INNER JOIN \"pg_attribute\" \"att\" ON \"att\".\"attrelid\" = \"con\".\"confrelid\" AND \"att\".\"attnum\" = \"con\".\"child\" " +
2607
- ("INNER JOIN \"pg_class\" \"cl\" ON \"cl\".\"oid\" = \"con\".\"confrelid\" " + isPartitionCondition) +
2607
+ "INNER JOIN \"pg_class\" \"cl\" ON \"cl\".\"oid\" = \"con\".\"confrelid\" ".concat(isPartitionCondition) +
2608
2608
  "INNER JOIN \"pg_namespace\" \"ns\" ON \"cl\".\"relnamespace\" = \"ns\".\"oid\" " +
2609
2609
  "INNER JOIN \"pg_attribute\" \"att2\" ON \"att2\".\"attrelid\" = \"con\".\"conrelid\" AND \"att2\".\"attnum\" = \"con\".\"parent\"";
2610
2610
  return [4 /*yield*/, Promise.all([
@@ -2683,7 +2683,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2683
2683
  sql = "SELECT \"e\".\"enumlabel\" AS \"value\" FROM \"pg_enum\" \"e\" " +
2684
2684
  "INNER JOIN \"pg_type\" \"t\" ON \"t\".\"oid\" = \"e\".\"enumtypid\" " +
2685
2685
  "INNER JOIN \"pg_namespace\" \"n\" ON \"n\".\"oid\" = \"t\".\"typnamespace\" " +
2686
- ("WHERE \"n\".\"nspname\" = '" + dbTable["table_schema"] + "' AND \"t\".\"typname\" = '" + (enumName || name) + "'");
2686
+ "WHERE \"n\".\"nspname\" = '".concat(dbTable["table_schema"], "' AND \"t\".\"typname\" = '").concat(enumName || name, "'");
2687
2687
  return [4 /*yield*/, this.query(sql)];
2688
2688
  case 2:
2689
2689
  results = _a.sent();
@@ -2700,7 +2700,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2700
2700
  _a.label = 3;
2701
2701
  case 3:
2702
2702
  if (!(tableColumn.type === "geometry")) return [3 /*break*/, 5];
2703
- geometryColumnSql = "SELECT * FROM (\n SELECT\n \"f_table_schema\" \"table_schema\",\n \"f_table_name\" \"table_name\",\n \"f_geometry_column\" \"column_name\",\n \"srid\",\n \"type\"\n FROM \"geometry_columns\"\n ) AS _\n WHERE\n \"column_name\" = '" + dbColumn["column_name"] + "' AND\n \"table_schema\" = '" + dbColumn["table_schema"] + "' AND\n \"table_name\" = '" + dbColumn["table_name"] + "'";
2703
+ geometryColumnSql = "SELECT * FROM (\n SELECT\n \"f_table_schema\" \"table_schema\",\n \"f_table_name\" \"table_name\",\n \"f_geometry_column\" \"column_name\",\n \"srid\",\n \"type\"\n FROM \"geometry_columns\"\n ) AS _\n WHERE\n \"column_name\" = '".concat(dbColumn["column_name"], "' AND\n \"table_schema\" = '").concat(dbColumn["table_schema"], "' AND\n \"table_name\" = '").concat(dbColumn["table_name"], "'");
2704
2704
  return [4 /*yield*/, this.query(geometryColumnSql)];
2705
2705
  case 4:
2706
2706
  results = _a.sent();
@@ -2711,7 +2711,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2711
2711
  _a.label = 5;
2712
2712
  case 5:
2713
2713
  if (!(tableColumn.type === "geography")) return [3 /*break*/, 7];
2714
- geographyColumnSql = "SELECT * FROM (\n SELECT\n \"f_table_schema\" \"table_schema\",\n \"f_table_name\" \"table_name\",\n \"f_geography_column\" \"column_name\",\n \"srid\",\n \"type\"\n FROM \"geography_columns\"\n ) AS _\n WHERE\n \"column_name\" = '" + dbColumn["column_name"] + "' AND\n \"table_schema\" = '" + dbColumn["table_schema"] + "' AND\n \"table_name\" = '" + dbColumn["table_name"] + "'";
2714
+ geographyColumnSql = "SELECT * FROM (\n SELECT\n \"f_table_schema\" \"table_schema\",\n \"f_table_name\" \"table_name\",\n \"f_geography_column\" \"column_name\",\n \"srid\",\n \"type\"\n FROM \"geography_columns\"\n ) AS _\n WHERE\n \"column_name\" = '".concat(dbColumn["column_name"], "' AND\n \"table_schema\" = '").concat(dbColumn["table_schema"], "' AND\n \"table_name\" = '").concat(dbColumn["table_name"], "'");
2715
2715
  return [4 /*yield*/, this.query(geographyColumnSql)];
2716
2716
  case 6:
2717
2717
  results = _a.sent();
@@ -2750,8 +2750,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2750
2750
  tableColumn.generatedIdentity = dbColumn.identity_generation;
2751
2751
  }
2752
2752
  else if (dbColumn["column_default"] !== null && dbColumn["column_default"] !== undefined) {
2753
- serialDefaultName = "nextval('" + this.buildSequenceName(table, dbColumn["column_name"]) + "'::regclass)";
2754
- serialDefaultPath = "nextval('" + this.buildSequencePath(table, dbColumn["column_name"]) + "'::regclass)";
2753
+ serialDefaultName = "nextval('".concat(this.buildSequenceName(table, dbColumn["column_name"]), "'::regclass)");
2754
+ serialDefaultPath = "nextval('".concat(this.buildSequencePath(table, dbColumn["column_name"]), "'::regclass)");
2755
2755
  defaultWithoutQuotes = dbColumn["column_default"].replace(/"/g, "");
2756
2756
  if (defaultWithoutQuotes === serialDefaultName || defaultWithoutQuotes === serialDefaultPath) {
2757
2757
  tableColumn.isGenerated = true;
@@ -2772,12 +2772,12 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2772
2772
  if (!(dbColumn["is_generated"] === "ALWAYS" && dbColumn["generation_expression"])) return [3 /*break*/, 9];
2773
2773
  // In postgres there is no VIRTUAL generated column type
2774
2774
  tableColumn.generatedType = "STORED";
2775
- asExpressionQuery = "SELECT * FROM \"" + this.connection.metadataTableName + "\" "
2776
- + (" WHERE \"table\" = '" + dbTable["table_name"] + "'")
2777
- + (" AND \"name\" = '" + tableColumn.name + "'")
2778
- + (" AND \"schema\" = '" + dbTable["table_schema"] + "'")
2779
- + (" AND \"database\" = '" + this.driver.database + "'")
2780
- + (" AND \"type\" = '" + MetadataTableType_1.MetadataTableType.GENERATED_COLUMN + "'");
2775
+ asExpressionQuery = "SELECT * FROM \"".concat(this.connection.metadataTableName, "\" ")
2776
+ + " WHERE \"table\" = '".concat(dbTable["table_name"], "'")
2777
+ + " AND \"name\" = '".concat(tableColumn.name, "'")
2778
+ + " AND \"schema\" = '".concat(dbTable["table_schema"], "'")
2779
+ + " AND \"database\" = '".concat(this.driver.database, "'")
2780
+ + " AND \"type\" = '".concat(MetadataTableType_1.MetadataTableType.GENERATED_COLUMN, "'");
2781
2781
  return [4 /*yield*/, this.query(asExpressionQuery)];
2782
2782
  case 8:
2783
2783
  results = _a.sent();
@@ -2892,7 +2892,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2892
2892
  PostgresQueryRunner.prototype.createTableSql = function (table, createForeignKeys) {
2893
2893
  var _this = this;
2894
2894
  var columnDefinitions = table.columns.map(function (column) { return _this.buildCreateColumnSql(table, column); }).join(", ");
2895
- var sql = "CREATE TABLE " + this.escapePath(table) + " (" + columnDefinitions;
2895
+ var sql = "CREATE TABLE ".concat(this.escapePath(table), " (").concat(columnDefinitions);
2896
2896
  table.columns
2897
2897
  .filter(function (column) { return column.isUnique; })
2898
2898
  .forEach(function (column) {
@@ -2906,55 +2906,55 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2906
2906
  if (table.uniques.length > 0) {
2907
2907
  var uniquesSql = table.uniques.map(function (unique) {
2908
2908
  var uniqueName = unique.name ? unique.name : _this.connection.namingStrategy.uniqueConstraintName(table, unique.columnNames);
2909
- var columnNames = unique.columnNames.map(function (columnName) { return "\"" + columnName + "\""; }).join(", ");
2910
- var constraint = "CONSTRAINT \"" + uniqueName + "\" UNIQUE (" + columnNames + ")";
2909
+ var columnNames = unique.columnNames.map(function (columnName) { return "\"".concat(columnName, "\""); }).join(", ");
2910
+ var constraint = "CONSTRAINT \"".concat(uniqueName, "\" UNIQUE (").concat(columnNames, ")");
2911
2911
  if (unique.deferrable)
2912
- constraint += " DEFERRABLE " + unique.deferrable;
2912
+ constraint += " DEFERRABLE ".concat(unique.deferrable);
2913
2913
  return constraint;
2914
2914
  }).join(", ");
2915
- sql += ", " + uniquesSql;
2915
+ sql += ", ".concat(uniquesSql);
2916
2916
  }
2917
2917
  if (table.checks.length > 0) {
2918
2918
  var checksSql = table.checks.map(function (check) {
2919
2919
  var checkName = check.name ? check.name : _this.connection.namingStrategy.checkConstraintName(table, check.expression);
2920
- return "CONSTRAINT \"" + checkName + "\" CHECK (" + check.expression + ")";
2920
+ return "CONSTRAINT \"".concat(checkName, "\" CHECK (").concat(check.expression, ")");
2921
2921
  }).join(", ");
2922
- sql += ", " + checksSql;
2922
+ sql += ", ".concat(checksSql);
2923
2923
  }
2924
2924
  if (table.exclusions.length > 0) {
2925
2925
  var exclusionsSql = table.exclusions.map(function (exclusion) {
2926
2926
  var exclusionName = exclusion.name ? exclusion.name : _this.connection.namingStrategy.exclusionConstraintName(table, exclusion.expression);
2927
- return "CONSTRAINT \"" + exclusionName + "\" EXCLUDE " + exclusion.expression;
2927
+ return "CONSTRAINT \"".concat(exclusionName, "\" EXCLUDE ").concat(exclusion.expression);
2928
2928
  }).join(", ");
2929
- sql += ", " + exclusionsSql;
2929
+ sql += ", ".concat(exclusionsSql);
2930
2930
  }
2931
2931
  if (table.foreignKeys.length > 0 && createForeignKeys) {
2932
2932
  var foreignKeysSql = table.foreignKeys.map(function (fk) {
2933
- var columnNames = fk.columnNames.map(function (columnName) { return "\"" + columnName + "\""; }).join(", ");
2933
+ var columnNames = fk.columnNames.map(function (columnName) { return "\"".concat(columnName, "\""); }).join(", ");
2934
2934
  if (!fk.name)
2935
2935
  fk.name = _this.connection.namingStrategy.foreignKeyName(table, fk.columnNames, _this.getTablePath(fk), fk.referencedColumnNames);
2936
- var referencedColumnNames = fk.referencedColumnNames.map(function (columnName) { return "\"" + columnName + "\""; }).join(", ");
2937
- var constraint = "CONSTRAINT \"" + fk.name + "\" FOREIGN KEY (" + columnNames + ") REFERENCES " + _this.escapePath(_this.getTablePath(fk)) + " (" + referencedColumnNames + ")";
2936
+ var referencedColumnNames = fk.referencedColumnNames.map(function (columnName) { return "\"".concat(columnName, "\""); }).join(", ");
2937
+ var constraint = "CONSTRAINT \"".concat(fk.name, "\" FOREIGN KEY (").concat(columnNames, ") REFERENCES ").concat(_this.escapePath(_this.getTablePath(fk)), " (").concat(referencedColumnNames, ")");
2938
2938
  if (fk.onDelete)
2939
- constraint += " ON DELETE " + fk.onDelete;
2939
+ constraint += " ON DELETE ".concat(fk.onDelete);
2940
2940
  if (fk.onUpdate)
2941
- constraint += " ON UPDATE " + fk.onUpdate;
2941
+ constraint += " ON UPDATE ".concat(fk.onUpdate);
2942
2942
  if (fk.deferrable)
2943
- constraint += " DEFERRABLE " + fk.deferrable;
2943
+ constraint += " DEFERRABLE ".concat(fk.deferrable);
2944
2944
  return constraint;
2945
2945
  }).join(", ");
2946
- sql += ", " + foreignKeysSql;
2946
+ sql += ", ".concat(foreignKeysSql);
2947
2947
  }
2948
2948
  var primaryColumns = table.columns.filter(function (column) { return column.isPrimary; });
2949
2949
  if (primaryColumns.length > 0) {
2950
2950
  var primaryKeyName = this.connection.namingStrategy.primaryKeyName(table, primaryColumns.map(function (column) { return column.name; }));
2951
- var columnNames = primaryColumns.map(function (column) { return "\"" + column.name + "\""; }).join(", ");
2952
- sql += ", CONSTRAINT \"" + primaryKeyName + "\" PRIMARY KEY (" + columnNames + ")";
2951
+ var columnNames = primaryColumns.map(function (column) { return "\"".concat(column.name, "\""); }).join(", ");
2952
+ sql += ", CONSTRAINT \"".concat(primaryKeyName, "\" PRIMARY KEY (").concat(columnNames, ")");
2953
2953
  }
2954
2954
  sql += ")";
2955
2955
  table.columns
2956
2956
  .filter(function (it) { return it.comment; })
2957
- .forEach(function (it) { return sql += "; COMMENT ON COLUMN " + _this.escapePath(table) + ".\"" + it.name + "\" IS " + _this.escapeComment(it.comment); });
2957
+ .forEach(function (it) { return sql += "; COMMENT ON COLUMN ".concat(_this.escapePath(table), ".\"").concat(it.name, "\" IS ").concat(_this.escapeComment(it.comment)); });
2958
2958
  return new Query_1.Query(sql);
2959
2959
  };
2960
2960
  /**
@@ -2977,16 +2977,16 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
2977
2977
  * Builds drop table sql.
2978
2978
  */
2979
2979
  PostgresQueryRunner.prototype.dropTableSql = function (tableOrPath) {
2980
- return new Query_1.Query("DROP TABLE " + this.escapePath(tableOrPath));
2980
+ return new Query_1.Query("DROP TABLE ".concat(this.escapePath(tableOrPath)));
2981
2981
  };
2982
2982
  PostgresQueryRunner.prototype.createViewSql = function (view) {
2983
2983
  var materializedClause = view.materialized ? "MATERIALIZED " : "";
2984
2984
  var viewName = this.escapePath(view);
2985
2985
  if (typeof view.expression === "string") {
2986
- return new Query_1.Query("CREATE " + materializedClause + "VIEW " + viewName + " AS " + view.expression);
2986
+ return new Query_1.Query("CREATE ".concat(materializedClause, "VIEW ").concat(viewName, " AS ").concat(view.expression));
2987
2987
  }
2988
2988
  else {
2989
- return new Query_1.Query("CREATE " + materializedClause + "VIEW " + viewName + " AS " + view.expression(this.connection).getQuery());
2989
+ return new Query_1.Query("CREATE ".concat(materializedClause, "VIEW ").concat(viewName, " AS ").concat(view.expression(this.connection).getQuery()));
2990
2990
  }
2991
2991
  };
2992
2992
  PostgresQueryRunner.prototype.insertViewDefinitionSql = function (view) {
@@ -3013,7 +3013,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3013
3013
  */
3014
3014
  PostgresQueryRunner.prototype.dropViewSql = function (view) {
3015
3015
  var materializedClause = view.materialized ? "MATERIALIZED " : "";
3016
- return new Query_1.Query("DROP " + materializedClause + "VIEW " + this.escapePath(view));
3016
+ return new Query_1.Query("DROP ".concat(materializedClause, "VIEW ").concat(this.escapePath(view)));
3017
3017
  };
3018
3018
  /**
3019
3019
  * Builds remove view sql.
@@ -3049,7 +3049,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3049
3049
  selectDropsQuery = "SELECT 'DROP TYPE IF EXISTS \"' || n.nspname || '\".\"' || t.typname || '\" CASCADE;' as \"query\" FROM \"pg_type\" \"t\" " +
3050
3050
  "INNER JOIN \"pg_enum\" \"e\" ON \"e\".\"enumtypid\" = \"t\".\"oid\" " +
3051
3051
  "INNER JOIN \"pg_namespace\" \"n\" ON \"n\".\"oid\" = \"t\".\"typnamespace\" " +
3052
- ("WHERE \"n\".\"nspname\" IN (" + schemaNames + ") GROUP BY \"n\".\"nspname\", \"t\".\"typname\"");
3052
+ "WHERE \"n\".\"nspname\" IN (".concat(schemaNames, ") GROUP BY \"n\".\"nspname\", \"t\".\"typname\"");
3053
3053
  return [4 /*yield*/, this.query(selectDropsQuery)];
3054
3054
  case 1:
3055
3055
  dropQueries = _a.sent();
@@ -3080,7 +3080,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3080
3080
  enumName = this.buildEnumName(table, column, false, true);
3081
3081
  sql = "SELECT \"n\".\"nspname\", \"t\".\"typname\" FROM \"pg_type\" \"t\" " +
3082
3082
  "INNER JOIN \"pg_namespace\" \"n\" ON \"n\".\"oid\" = \"t\".\"typnamespace\" " +
3083
- ("WHERE \"n\".\"nspname\" = '" + schema + "' AND \"t\".\"typname\" = '" + enumName + "'");
3083
+ "WHERE \"n\".\"nspname\" = '".concat(schema, "' AND \"t\".\"typname\" = '").concat(enumName, "'");
3084
3084
  return [4 /*yield*/, this.query(sql)];
3085
3085
  case 3:
3086
3086
  result = _a.sent();
@@ -3095,8 +3095,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3095
3095
  PostgresQueryRunner.prototype.createEnumTypeSql = function (table, column, enumName) {
3096
3096
  if (!enumName)
3097
3097
  enumName = this.buildEnumName(table, column);
3098
- var enumValues = column.enum.map(function (value) { return "'" + value.replace("'", "''") + "'"; }).join(", ");
3099
- return new Query_1.Query("CREATE TYPE " + enumName + " AS ENUM(" + enumValues + ")");
3098
+ var enumValues = column.enum.map(function (value) { return "'".concat(value.replace("'", "''"), "'"); }).join(", ");
3099
+ return new Query_1.Query("CREATE TYPE ".concat(enumName, " AS ENUM(").concat(enumValues, ")"));
3100
3100
  };
3101
3101
  /**
3102
3102
  * Builds create ENUM type sql.
@@ -3104,14 +3104,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3104
3104
  PostgresQueryRunner.prototype.dropEnumTypeSql = function (table, column, enumName) {
3105
3105
  if (!enumName)
3106
3106
  enumName = this.buildEnumName(table, column);
3107
- return new Query_1.Query("DROP TYPE " + enumName);
3107
+ return new Query_1.Query("DROP TYPE ".concat(enumName));
3108
3108
  };
3109
3109
  /**
3110
3110
  * Builds create index sql.
3111
3111
  */
3112
3112
  PostgresQueryRunner.prototype.createIndexSql = function (table, index) {
3113
- var columns = index.columnNames.map(function (columnName) { return "\"" + columnName + "\""; }).join(", ");
3114
- return new Query_1.Query("CREATE " + (index.isUnique ? "UNIQUE " : "") + "INDEX \"" + index.name + "\" ON " + this.escapePath(table) + " " + (index.isSpatial ? "USING GiST " : "") + "(" + columns + ") " + (index.where ? "WHERE " + index.where : ""));
3113
+ var columns = index.columnNames.map(function (columnName) { return "\"".concat(columnName, "\""); }).join(", ");
3114
+ return new Query_1.Query("CREATE ".concat(index.isUnique ? "UNIQUE " : "", "INDEX \"").concat(index.name, "\" ON ").concat(this.escapePath(table), " ").concat(index.isSpatial ? "USING GiST " : "", "(").concat(columns, ") ").concat(index.where ? "WHERE " + index.where : ""));
3115
3115
  };
3116
3116
  /**
3117
3117
  * Builds drop index sql.
@@ -3119,15 +3119,15 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3119
3119
  PostgresQueryRunner.prototype.dropIndexSql = function (table, indexOrName) {
3120
3120
  var indexName = indexOrName instanceof TableIndex_1.TableIndex ? indexOrName.name : indexOrName;
3121
3121
  var schema = this.driver.parseTableName(table).schema;
3122
- return schema ? new Query_1.Query("DROP INDEX \"" + schema + "\".\"" + indexName + "\"") : new Query_1.Query("DROP INDEX \"" + indexName + "\"");
3122
+ return schema ? new Query_1.Query("DROP INDEX \"".concat(schema, "\".\"").concat(indexName, "\"")) : new Query_1.Query("DROP INDEX \"".concat(indexName, "\""));
3123
3123
  };
3124
3124
  /**
3125
3125
  * Builds create primary key sql.
3126
3126
  */
3127
3127
  PostgresQueryRunner.prototype.createPrimaryKeySql = function (table, columnNames) {
3128
3128
  var primaryKeyName = this.connection.namingStrategy.primaryKeyName(table, columnNames);
3129
- var columnNamesString = columnNames.map(function (columnName) { return "\"" + columnName + "\""; }).join(", ");
3130
- return new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + primaryKeyName + "\" PRIMARY KEY (" + columnNamesString + ")");
3129
+ var columnNamesString = columnNames.map(function (columnName) { return "\"".concat(columnName, "\""); }).join(", ");
3130
+ return new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(primaryKeyName, "\" PRIMARY KEY (").concat(columnNamesString, ")"));
3131
3131
  };
3132
3132
  /**
3133
3133
  * Builds drop primary key sql.
@@ -3135,16 +3135,16 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3135
3135
  PostgresQueryRunner.prototype.dropPrimaryKeySql = function (table) {
3136
3136
  var columnNames = table.primaryColumns.map(function (column) { return column.name; });
3137
3137
  var primaryKeyName = this.connection.namingStrategy.primaryKeyName(table, columnNames);
3138
- return new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + primaryKeyName + "\"");
3138
+ return new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(primaryKeyName, "\""));
3139
3139
  };
3140
3140
  /**
3141
3141
  * Builds create unique constraint sql.
3142
3142
  */
3143
3143
  PostgresQueryRunner.prototype.createUniqueConstraintSql = function (table, uniqueConstraint) {
3144
3144
  var columnNames = uniqueConstraint.columnNames.map(function (column) { return "\"" + column + "\""; }).join(", ");
3145
- var sql = "ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + uniqueConstraint.name + "\" UNIQUE (" + columnNames + ")";
3145
+ var sql = "ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(uniqueConstraint.name, "\" UNIQUE (").concat(columnNames, ")");
3146
3146
  if (uniqueConstraint.deferrable)
3147
- sql += " DEFERRABLE " + uniqueConstraint.deferrable;
3147
+ sql += " DEFERRABLE ".concat(uniqueConstraint.deferrable);
3148
3148
  return new Query_1.Query(sql);
3149
3149
  };
3150
3150
  /**
@@ -3152,33 +3152,33 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3152
3152
  */
3153
3153
  PostgresQueryRunner.prototype.dropUniqueConstraintSql = function (table, uniqueOrName) {
3154
3154
  var uniqueName = uniqueOrName instanceof TableUnique_1.TableUnique ? uniqueOrName.name : uniqueOrName;
3155
- return new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + uniqueName + "\"");
3155
+ return new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(uniqueName, "\""));
3156
3156
  };
3157
3157
  /**
3158
3158
  * Builds create check constraint sql.
3159
3159
  */
3160
3160
  PostgresQueryRunner.prototype.createCheckConstraintSql = function (table, checkConstraint) {
3161
- return new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + checkConstraint.name + "\" CHECK (" + checkConstraint.expression + ")");
3161
+ return new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(checkConstraint.name, "\" CHECK (").concat(checkConstraint.expression, ")"));
3162
3162
  };
3163
3163
  /**
3164
3164
  * Builds drop check constraint sql.
3165
3165
  */
3166
3166
  PostgresQueryRunner.prototype.dropCheckConstraintSql = function (table, checkOrName) {
3167
3167
  var checkName = checkOrName instanceof TableCheck_1.TableCheck ? checkOrName.name : checkOrName;
3168
- return new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + checkName + "\"");
3168
+ return new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(checkName, "\""));
3169
3169
  };
3170
3170
  /**
3171
3171
  * Builds create exclusion constraint sql.
3172
3172
  */
3173
3173
  PostgresQueryRunner.prototype.createExclusionConstraintSql = function (table, exclusionConstraint) {
3174
- return new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + exclusionConstraint.name + "\" EXCLUDE " + exclusionConstraint.expression);
3174
+ return new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(exclusionConstraint.name, "\" EXCLUDE ").concat(exclusionConstraint.expression));
3175
3175
  };
3176
3176
  /**
3177
3177
  * Builds drop exclusion constraint sql.
3178
3178
  */
3179
3179
  PostgresQueryRunner.prototype.dropExclusionConstraintSql = function (table, exclusionOrName) {
3180
3180
  var exclusionName = exclusionOrName instanceof TableExclusion_1.TableExclusion ? exclusionOrName.name : exclusionOrName;
3181
- return new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + exclusionName + "\"");
3181
+ return new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(exclusionName, "\""));
3182
3182
  };
3183
3183
  /**
3184
3184
  * Builds create foreign key sql.
@@ -3186,14 +3186,14 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3186
3186
  PostgresQueryRunner.prototype.createForeignKeySql = function (table, foreignKey) {
3187
3187
  var columnNames = foreignKey.columnNames.map(function (column) { return "\"" + column + "\""; }).join(", ");
3188
3188
  var referencedColumnNames = foreignKey.referencedColumnNames.map(function (column) { return "\"" + column + "\""; }).join(",");
3189
- var sql = "ALTER TABLE " + this.escapePath(table) + " ADD CONSTRAINT \"" + foreignKey.name + "\" FOREIGN KEY (" + columnNames + ") " +
3190
- ("REFERENCES " + this.escapePath(this.getTablePath(foreignKey)) + "(" + referencedColumnNames + ")");
3189
+ var sql = "ALTER TABLE ".concat(this.escapePath(table), " ADD CONSTRAINT \"").concat(foreignKey.name, "\" FOREIGN KEY (").concat(columnNames, ") ") +
3190
+ "REFERENCES ".concat(this.escapePath(this.getTablePath(foreignKey)), "(").concat(referencedColumnNames, ")");
3191
3191
  if (foreignKey.onDelete)
3192
- sql += " ON DELETE " + foreignKey.onDelete;
3192
+ sql += " ON DELETE ".concat(foreignKey.onDelete);
3193
3193
  if (foreignKey.onUpdate)
3194
- sql += " ON UPDATE " + foreignKey.onUpdate;
3194
+ sql += " ON UPDATE ".concat(foreignKey.onUpdate);
3195
3195
  if (foreignKey.deferrable)
3196
- sql += " DEFERRABLE " + foreignKey.deferrable;
3196
+ sql += " DEFERRABLE ".concat(foreignKey.deferrable);
3197
3197
  return new Query_1.Query(sql);
3198
3198
  };
3199
3199
  /**
@@ -3201,7 +3201,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3201
3201
  */
3202
3202
  PostgresQueryRunner.prototype.dropForeignKeySql = function (table, foreignKeyOrName) {
3203
3203
  var foreignKeyName = foreignKeyOrName instanceof TableForeignKey_1.TableForeignKey ? foreignKeyOrName.name : foreignKeyOrName;
3204
- return new Query_1.Query("ALTER TABLE " + this.escapePath(table) + " DROP CONSTRAINT \"" + foreignKeyName + "\"");
3204
+ return new Query_1.Query("ALTER TABLE ".concat(this.escapePath(table), " DROP CONSTRAINT \"").concat(foreignKeyName, "\""));
3205
3205
  };
3206
3206
  /**
3207
3207
  * Builds sequence name from given table and column.
@@ -3209,16 +3209,16 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3209
3209
  PostgresQueryRunner.prototype.buildSequenceName = function (table, columnOrName) {
3210
3210
  var tableName = this.driver.parseTableName(table).tableName;
3211
3211
  var columnName = columnOrName instanceof TableColumn_1.TableColumn ? columnOrName.name : columnOrName;
3212
- var seqName = tableName + "_" + columnName + "_seq";
3212
+ var seqName = "".concat(tableName, "_").concat(columnName, "_seq");
3213
3213
  if (seqName.length > this.connection.driver.maxAliasLength) {
3214
3214
  // note doesn't yet handle corner cases where .length differs from number of UTF-8 bytes
3215
- seqName = tableName.substring(0, 29) + "_" + columnName.substring(0, Math.max(29, 63 - (table.name.length) - 5)) + "_seq";
3215
+ seqName = "".concat(tableName.substring(0, 29), "_").concat(columnName.substring(0, Math.max(29, 63 - (table.name.length) - 5)), "_seq");
3216
3216
  }
3217
3217
  return seqName;
3218
3218
  };
3219
3219
  PostgresQueryRunner.prototype.buildSequencePath = function (table, columnOrName) {
3220
3220
  var schema = this.driver.parseTableName(table).schema;
3221
- return schema ? schema + "." + this.buildSequenceName(table, columnOrName) : this.buildSequenceName(table, columnOrName);
3221
+ return schema ? "".concat(schema, ".").concat(this.buildSequenceName(table, columnOrName)) : this.buildSequenceName(table, columnOrName);
3222
3222
  };
3223
3223
  /**
3224
3224
  * Builds ENUM type name from given table and column.
@@ -3226,13 +3226,13 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3226
3226
  PostgresQueryRunner.prototype.buildEnumName = function (table, column, withSchema, disableEscape, toOld) {
3227
3227
  if (withSchema === void 0) { withSchema = true; }
3228
3228
  var _a = this.driver.parseTableName(table), schema = _a.schema, tableName = _a.tableName;
3229
- var enumName = column.enumName ? column.enumName : tableName + "_" + column.name.toLowerCase() + "_enum";
3229
+ var enumName = column.enumName ? column.enumName : "".concat(tableName, "_").concat(column.name.toLowerCase(), "_enum");
3230
3230
  if (schema && withSchema)
3231
- enumName = schema + "." + enumName;
3231
+ enumName = "".concat(schema, ".").concat(enumName);
3232
3232
  if (toOld)
3233
3233
  enumName = enumName + "_old";
3234
3234
  return enumName.split(".").map(function (i) {
3235
- return disableEscape ? i : "\"" + i + "\"";
3235
+ return disableEscape ? i : "\"".concat(i, "\"");
3236
3236
  }).join(".");
3237
3237
  };
3238
3238
  PostgresQueryRunner.prototype.getUserDefinedTypeName = function (table, column) {
@@ -3248,7 +3248,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3248
3248
  schema = _b.sent();
3249
3249
  _b.label = 2;
3250
3250
  case 2: return [4 /*yield*/, this.query("SELECT \"udt_schema\", \"udt_name\" " +
3251
- ("FROM \"information_schema\".\"columns\" WHERE \"table_schema\" = '" + schema + "' AND \"table_name\" = '" + name + "' AND \"column_name\"='" + column.name + "'"))];
3251
+ "FROM \"information_schema\".\"columns\" WHERE \"table_schema\" = '".concat(schema, "' AND \"table_name\" = '").concat(name, "' AND \"column_name\"='").concat(column.name, "'"))];
3252
3252
  case 3:
3253
3253
  result = _b.sent();
3254
3254
  udtName = result[0]["udt_name"];
@@ -3273,7 +3273,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3273
3273
  comment = comment
3274
3274
  .replace(/'/g, "''")
3275
3275
  .replace(/\u0000/g, ""); // Null bytes aren't allowed in comments
3276
- return "'" + comment + "'";
3276
+ return "'".concat(comment, "'");
3277
3277
  };
3278
3278
  /**
3279
3279
  * Escapes given table or view path.
@@ -3281,9 +3281,9 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3281
3281
  PostgresQueryRunner.prototype.escapePath = function (target) {
3282
3282
  var _a = this.driver.parseTableName(target), schema = _a.schema, tableName = _a.tableName;
3283
3283
  if (schema && schema !== this.driver.searchSchema) {
3284
- return "\"" + schema + "\".\"" + tableName + "\"";
3284
+ return "\"".concat(schema, "\".\"").concat(tableName, "\"");
3285
3285
  }
3286
- return "\"" + tableName + "\"";
3286
+ return "\"".concat(tableName, "\"");
3287
3287
  };
3288
3288
  /**
3289
3289
  * Get the table name with table schema
@@ -3301,8 +3301,8 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3301
3301
  case 1:
3302
3302
  schemaResult = _a.sent();
3303
3303
  schema = schemaResult[0]["current_schema"];
3304
- return [2 /*return*/, schema + "." + tableName];
3305
- case 2: return [2 /*return*/, tableName.split(".")[0] + "." + tableName.split(".")[1]];
3304
+ return [2 /*return*/, "".concat(schema, ".").concat(tableName)];
3305
+ case 2: return [2 /*return*/, "".concat(tableName.split(".")[0], ".").concat(tableName.split(".")[1])];
3306
3306
  }
3307
3307
  });
3308
3308
  });
@@ -3315,7 +3315,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3315
3315
  if (column.isGenerated === true && column.generationStrategy !== "uuid") {
3316
3316
  if (column.generationStrategy === "identity") { // Postgres 10+ Identity generated column
3317
3317
  var generatedIdentityOrDefault = column.generatedIdentity || "BY DEFAULT";
3318
- c += " " + column.type + " GENERATED " + generatedIdentityOrDefault + " AS IDENTITY";
3318
+ c += " ".concat(column.type, " GENERATED ").concat(generatedIdentityOrDefault, " AS IDENTITY");
3319
3319
  }
3320
3320
  else { // classic SERIAL primary column
3321
3321
  if (column.type === "integer" || column.type === "int" || column.type === "int4")
@@ -3337,7 +3337,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3337
3337
  // CHARACTER SET, COLLATE, NOT NULL and DEFAULT do not exist on generated (virtual) columns
3338
3338
  // Also, postgres only supports the stored generated column type
3339
3339
  if (column.generatedType === "STORED" && column.asExpression) {
3340
- c += " GENERATED ALWAYS AS (" + column.asExpression + ") STORED";
3340
+ c += " GENERATED ALWAYS AS (".concat(column.asExpression, ") STORED");
3341
3341
  }
3342
3342
  else {
3343
3343
  if (column.charset)
@@ -3349,7 +3349,7 @@ var PostgresQueryRunner = /** @class */ (function (_super) {
3349
3349
  if (column.default !== undefined && column.default !== null)
3350
3350
  c += " DEFAULT " + column.default;
3351
3351
  if (column.isGenerated && column.generationStrategy === "uuid" && !column.default)
3352
- c += " DEFAULT " + this.driver.uuidGenerator;
3352
+ c += " DEFAULT ".concat(this.driver.uuidGenerator);
3353
3353
  }
3354
3354
  return c;
3355
3355
  };