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I,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC;wBACvC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,eAAe;6BACvC,aAAa;qBACrB,CAAC;oBACF,UAAU,EAAE,IAAI;oBAChB,SAAS;iBACZ;gBACD;oBACI,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC;wBACvC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,eAAe;6BACvC,YAAY;qBACpB,CAAC;oBACF,UAAU,EAAE,IAAI;oBAChB,SAAS;iBACZ;gBACD;oBACI,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC;wBACvC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,eAAe;6BACvC,aAAa;qBACrB,CAAC;oBACF,UAAU,EAAE,IAAI;oBAChB,SAAS;iBACZ;aACJ;SACJ,CAAC,EACF,IAAI,CACP,CAAA;IACL,CAAC;CACJ","file":"RdbmsSchemaBuilder.js","sourcesContent":["import { Table } from \"./table/Table\"\nimport { TableColumn } from \"./table/TableColumn\"\nimport { TableForeignKey } from \"./table/TableForeignKey\"\nimport { TableIndex } from \"./table/TableIndex\"\nimport { QueryRunner } from \"../query-runner/QueryRunner\"\nimport { ColumnMetadata } from \"../metadata/ColumnMetadata\"\nimport { EntityMetadata } from \"../metadata/EntityMetadata\"\nimport { DataSource } from \"../data-source/DataSource\"\nimport { SchemaBuilder } from \"./SchemaBuilder\"\nimport { SqlInMemory } from \"../driver/SqlInMemory\"\nimport { TableUtils } from \"./util/TableUtils\"\nimport { TableColumnOptions } from \"./options/TableColumnOptions\"\nimport { TableUnique } from \"./table/TableUnique\"\nimport { TableCheck } from \"./table/TableCheck\"\nimport { TableExclusion } from \"./table/TableExclusion\"\nimport { View } from \"./view/View\"\nimport { ViewUtils } from \"./util/ViewUtils\"\nimport { DriverUtils } from \"../driver/DriverUtils\"\nimport { PostgresQueryRunner } from \"../driver/postgres/PostgresQueryRunner\"\n\n/**\n * Creates complete tables schemas in the database based on the entity metadatas.\n *\n * Steps how schema is being built:\n * 1. load list of all tables with complete column and keys information from the db\n * 2. drop all (old) foreign keys that exist in the table, but does not exist in the metadata\n * 3. create new tables that does not exist in the db, but exist in the metadata\n * 4. drop all columns exist (left old) in the db table, but does not exist in the metadata\n * 5. add columns from metadata which does not exist in the table\n * 6. update all exist columns which metadata has changed\n * 7. update primary keys - update old and create new primary key from changed columns\n * 8. create foreign keys which does not exist in the table yet\n * 9. create indices which are missing in db yet, and drops indices which exist in the db, but does not exist in the metadata anymore\n */\nexport class RdbmsSchemaBuilder implements SchemaBuilder {\n readonly \"@instanceof\" = Symbol.for(\"RdbmsSchemaBuilder\")\n\n /**\n * Used to execute schema creation queries in a single connection.\n */\n protected queryRunner: QueryRunner\n\n private currentDatabase?: string\n\n private currentSchema?: string\n\n // -------------------------------------------------------------------------\n // Constructor\n // -------------------------------------------------------------------------\n\n constructor(protected connection: DataSource) {}\n\n // -------------------------------------------------------------------------\n // Public Methods\n // -------------------------------------------------------------------------\n\n /**\n * Creates complete schemas for the given entity metadatas.\n */\n async build(): Promise {\n this.queryRunner = this.connection.createQueryRunner()\n\n // this.connection.driver.database || this.currentDatabase;\n this.currentDatabase = this.connection.driver.database\n this.currentSchema = this.connection.driver.schema\n\n // CockroachDB implements asynchronous schema sync operations which can not been executed in transaction.\n // E.g. if you try to DROP column and ADD it again in the same transaction, crdb throws error.\n // In Spanner queries against the INFORMATION_SCHEMA can be used in a read-only transaction,\n // but not in a read-write transaction.\n const isUsingTransactions =\n !(this.connection.driver.options.type === \"cockroachdb\") &&\n !(this.connection.driver.options.type === \"spanner\") &&\n this.connection.options.migrationsTransactionMode !== \"none\"\n\n await this.queryRunner.beforeMigration()\n\n if (isUsingTransactions) {\n await this.queryRunner.startTransaction()\n }\n\n try {\n await this.createMetadataTableIfNecessary(this.queryRunner)\n // Flush the queryrunner table & view cache\n const tablePaths = this.entityToSyncMetadatas.map((metadata) =>\n this.getTablePath(metadata),\n )\n const viewPaths = this.viewEntityToSyncMetadatas.map((metadata) =>\n this.getTablePath(metadata),\n )\n\n await this.queryRunner.getTables(tablePaths)\n await this.queryRunner.getViews(viewPaths)\n\n await this.executeSchemaSyncOperationsInProperOrder()\n\n // if cache is enabled then perform cache-synchronization as well\n if (this.connection.queryResultCache)\n await this.connection.queryResultCache.synchronize(\n this.queryRunner,\n )\n\n if (isUsingTransactions) {\n await this.queryRunner.commitTransaction()\n }\n } catch (error) {\n try {\n // we throw original error even if rollback thrown an error\n if (isUsingTransactions) {\n await this.queryRunner.rollbackTransaction()\n }\n } catch (rollbackError) {}\n throw error\n } finally {\n await this.queryRunner.afterMigration()\n\n await this.queryRunner.release()\n }\n }\n\n /**\n * Create the typeorm_metadata table if necessary.\n */\n async createMetadataTableIfNecessary(\n queryRunner: QueryRunner,\n ): Promise {\n if (\n this.viewEntityToSyncMetadatas.length > 0 ||\n this.hasGeneratedColumns()\n ) {\n await this.createTypeormMetadataTable(queryRunner)\n }\n }\n\n /**\n * Returns sql queries to be executed by schema builder.\n */\n async log(): Promise {\n this.queryRunner = this.connection.createQueryRunner()\n try {\n // Flush the queryrunner table & view cache\n const tablePaths = this.entityToSyncMetadatas.map((metadata) =>\n this.getTablePath(metadata),\n )\n const viewPaths = this.viewEntityToSyncMetadatas.map((metadata) =>\n this.getTablePath(metadata),\n )\n await this.queryRunner.getTables(tablePaths)\n await this.queryRunner.getViews(viewPaths)\n\n this.queryRunner.enableSqlMemory()\n await this.executeSchemaSyncOperationsInProperOrder()\n\n // if cache is enabled then perform cache-synchronization as well\n if (this.connection.queryResultCache)\n // todo: check this functionality\n await this.connection.queryResultCache.synchronize(\n this.queryRunner,\n )\n\n return this.queryRunner.getMemorySql()\n } finally {\n // its important to disable this mode despite the fact we are release query builder\n // because there exist drivers which reuse same query runner. Also its important to disable\n // sql memory after call of getMemorySql() method because last one flushes sql memory.\n this.queryRunner.disableSqlMemory()\n await this.queryRunner.release()\n }\n }\n\n // -------------------------------------------------------------------------\n // Protected Methods\n // -------------------------------------------------------------------------\n\n /**\n * Returns only entities that should be synced in the database.\n */\n protected get entityToSyncMetadatas(): EntityMetadata[] {\n return this.connection.entityMetadatas.filter(\n (metadata) =>\n metadata.synchronize &&\n metadata.tableType !== \"entity-child\" &&\n metadata.tableType !== \"view\",\n )\n }\n\n /**\n * Returns only entities that should be synced in the database.\n */\n protected get viewEntityToSyncMetadatas(): EntityMetadata[] {\n return (\n this.connection.entityMetadatas\n .filter(\n (metadata) =>\n metadata.tableType === \"view\" && metadata.synchronize,\n )\n // sort views in creation order by dependencies\n .sort(ViewUtils.viewMetadataCmp)\n )\n }\n\n /**\n * Checks if there are at least one generated column.\n */\n protected hasGeneratedColumns(): boolean {\n return this.connection.entityMetadatas.some((entityMetadata) => {\n return entityMetadata.columns.some((column) => column.generatedType)\n })\n }\n\n /**\n * Executes schema sync operations in a proper order.\n * Order of operations matter here.\n */\n protected async executeSchemaSyncOperationsInProperOrder(): Promise {\n await this.dropOldViews()\n await this.dropOldForeignKeys()\n await this.dropOldIndices()\n await this.dropOldChecks()\n await this.dropOldExclusions()\n await this.dropCompositeUniqueConstraints()\n // await this.renameTables();\n await this.renameColumns()\n await this.changeTableComment()\n await this.createNewTables()\n await this.dropRemovedColumns()\n await this.addNewColumns()\n await this.updatePrimaryKeys()\n await this.updateExistColumns()\n await this.createNewIndices()\n await this.createNewChecks()\n await this.createNewExclusions()\n await this.createCompositeUniqueConstraints()\n await this.createForeignKeys()\n await this.createViews()\n await this.createNewViewIndices()\n }\n\n private getTablePath(\n target: EntityMetadata | Table | View | TableForeignKey | string,\n ): string {\n const parsed = this.connection.driver.parseTableName(target)\n\n return this.connection.driver.buildTableName(\n parsed.tableName,\n parsed.schema || this.currentSchema,\n parsed.database || this.currentDatabase,\n )\n }\n\n /**\n * Drops all (old) foreign keys that exist in the tables, but do not exist in the entity metadata.\n */\n protected async dropOldForeignKeys(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n // find foreign keys that exist in the schemas but does not exist in the entity metadata\n const tableForeignKeysToDrop = table.foreignKeys.filter(\n (tableForeignKey) => {\n const metadataFK = metadata.foreignKeys.find(\n (metadataForeignKey) =>\n tableForeignKey.name === metadataForeignKey.name &&\n this.getTablePath(tableForeignKey) ===\n this.getTablePath(\n metadataForeignKey.referencedEntityMetadata,\n ),\n )\n return (\n !metadataFK ||\n (metadataFK.onDelete &&\n metadataFK.onDelete !== tableForeignKey.onDelete) ||\n (metadataFK.onUpdate &&\n metadataFK.onUpdate !== tableForeignKey.onUpdate)\n )\n },\n )\n if (tableForeignKeysToDrop.length === 0) continue\n\n this.connection.logger.logSchemaBuild(\n `dropping old foreign keys of ${\n table.name\n }: ${tableForeignKeysToDrop\n .map((dbForeignKey) => dbForeignKey.name)\n .join(\", \")}`,\n )\n\n // drop foreign keys from the database\n await this.queryRunner.dropForeignKeys(\n table,\n tableForeignKeysToDrop,\n )\n }\n }\n\n /**\n * Rename tables\n */\n protected async renameTables(): Promise {\n // for (const metadata of this.entityToSyncMetadatas) {\n // const table = this.queryRunner.loadedTables.find(table => this.getTablePath(table) === this.getTablePath(metadata));\n // }\n }\n\n /**\n * Renames columns.\n * Works if only one column per table was changed.\n * Changes only column name. If something besides name was changed, these changes will be ignored.\n */\n protected async renameColumns(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n if (metadata.columns.length !== table.columns.length) continue\n\n const renamedMetadataColumns = metadata.columns\n .filter((c) => !c.isVirtualProperty)\n .filter((column) => {\n return !table.columns.find((tableColumn) => {\n return (\n tableColumn.name === column.databaseName &&\n tableColumn.type ===\n this.connection.driver.normalizeType(column) &&\n tableColumn.isNullable === column.isNullable &&\n tableColumn.isUnique ===\n this.connection.driver.normalizeIsUnique(column)\n )\n })\n })\n\n if (\n renamedMetadataColumns.length === 0 ||\n renamedMetadataColumns.length > 1\n )\n continue\n\n const renamedTableColumns = table.columns.filter((tableColumn) => {\n return !metadata.columns.find((column) => {\n return (\n !column.isVirtualProperty &&\n column.databaseName === tableColumn.name &&\n this.connection.driver.normalizeType(column) ===\n tableColumn.type &&\n column.isNullable === tableColumn.isNullable &&\n this.connection.driver.normalizeIsUnique(column) ===\n tableColumn.isUnique\n )\n })\n })\n\n if (\n renamedTableColumns.length === 0 ||\n renamedTableColumns.length > 1\n )\n continue\n\n const renamedColumn = renamedTableColumns[0].clone()\n renamedColumn.name = renamedMetadataColumns[0].databaseName\n\n this.connection.logger.logSchemaBuild(\n `renaming column \"${renamedTableColumns[0].name}\" in \"${table.name}\" to \"${renamedColumn.name}\"`,\n )\n await this.queryRunner.renameColumn(\n table,\n renamedTableColumns[0],\n renamedColumn,\n )\n }\n }\n\n protected async dropOldIndices(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n const dropQueries = table.indices\n .filter((tableIndex) => {\n const indexMetadata = metadata.indices.find(\n (index) => index.name === tableIndex.name,\n )\n if (indexMetadata) {\n if (indexMetadata.synchronize === false) return false\n\n if (indexMetadata.isUnique !== tableIndex.isUnique)\n return true\n\n if (indexMetadata.isSpatial !== tableIndex.isSpatial)\n return true\n\n if (\n this.connection.driver.isFullTextColumnTypeSupported() &&\n indexMetadata.isFulltext !== tableIndex.isFulltext\n )\n return true\n\n if (\n indexMetadata.columns.length !==\n tableIndex.columnNames.length\n )\n return true\n\n return !indexMetadata.columns.every(\n (column) =>\n tableIndex.columnNames.indexOf(\n column.databaseName,\n ) !== -1,\n )\n }\n\n return true\n })\n .map(async (tableIndex) => {\n this.connection.logger.logSchemaBuild(\n `dropping an index: \"${tableIndex.name}\" from table ${table.name}`,\n )\n await this.queryRunner.dropIndex(table, tableIndex)\n })\n\n await Promise.all(dropQueries)\n }\n if (this.connection.options.type === \"postgres\") {\n const postgresQueryRunner: PostgresQueryRunner = <\n PostgresQueryRunner\n >this.queryRunner\n for (const metadata of this.viewEntityToSyncMetadatas) {\n const view = this.queryRunner.loadedViews.find(\n (view) =>\n this.getTablePath(view) === this.getTablePath(metadata),\n )\n if (!view) continue\n\n const dropQueries = view.indices\n .filter((tableIndex) => {\n const indexMetadata = metadata.indices.find(\n (index) => index.name === tableIndex.name,\n )\n if (indexMetadata) {\n if (indexMetadata.synchronize === false)\n return false\n\n if (indexMetadata.isUnique !== tableIndex.isUnique)\n return true\n\n if (\n indexMetadata.isSpatial !== tableIndex.isSpatial\n )\n return true\n\n if (\n this.connection.driver.isFullTextColumnTypeSupported() &&\n indexMetadata.isFulltext !==\n tableIndex.isFulltext\n )\n return true\n\n if (\n indexMetadata.columns.length !==\n tableIndex.columnNames.length\n )\n return true\n\n return !indexMetadata.columns.every(\n (column) =>\n tableIndex.columnNames.indexOf(\n column.databaseName,\n ) !== -1,\n )\n }\n\n return true\n })\n .map(async (tableIndex) => {\n this.connection.logger.logSchemaBuild(\n `dropping an index: \"${tableIndex.name}\" from view ${view.name}`,\n )\n await postgresQueryRunner.dropViewIndex(\n view,\n tableIndex,\n )\n })\n\n await Promise.all(dropQueries)\n }\n }\n }\n\n protected async dropOldChecks(): Promise {\n // Mysql does not support check constraints\n if (\n DriverUtils.isMySQLFamily(this.connection.driver) ||\n this.connection.driver.options.type === \"aurora-mysql\"\n )\n return\n\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n const oldChecks = table.checks.filter((tableCheck) => {\n return !metadata.checks.find(\n (checkMetadata) => checkMetadata.name === tableCheck.name,\n )\n })\n\n if (oldChecks.length === 0) continue\n\n this.connection.logger.logSchemaBuild(\n `dropping old check constraint: ${oldChecks\n .map((check) => `\"${check.name}\"`)\n .join(\", \")} from table \"${table.name}\"`,\n )\n await this.queryRunner.dropCheckConstraints(table, oldChecks)\n }\n }\n\n protected async dropCompositeUniqueConstraints(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n const compositeUniques = table.uniques.filter((tableUnique) => {\n return (\n tableUnique.columnNames.length > 1 &&\n !metadata.uniques.find(\n (uniqueMetadata) =>\n uniqueMetadata.name === tableUnique.name,\n )\n )\n })\n\n if (compositeUniques.length === 0) continue\n\n this.connection.logger.logSchemaBuild(\n `dropping old unique constraint: ${compositeUniques\n .map((unique) => `\"${unique.name}\"`)\n .join(\", \")} from table \"${table.name}\"`,\n )\n await this.queryRunner.dropUniqueConstraints(\n table,\n compositeUniques,\n )\n }\n }\n\n protected async dropOldExclusions(): Promise {\n // Only PostgreSQL supports exclusion constraints\n if (!(this.connection.driver.options.type === \"postgres\")) return\n\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n const oldExclusions = table.exclusions.filter((tableExclusion) => {\n return !metadata.exclusions.find(\n (exclusionMetadata) =>\n exclusionMetadata.name === tableExclusion.name,\n )\n })\n\n if (oldExclusions.length === 0) continue\n\n this.connection.logger.logSchemaBuild(\n `dropping old exclusion constraint: ${oldExclusions\n .map((exclusion) => `\"${exclusion.name}\"`)\n .join(\", \")} from table \"${table.name}\"`,\n )\n await this.queryRunner.dropExclusionConstraints(\n table,\n oldExclusions,\n )\n }\n }\n\n /**\n * change table comment\n */\n protected async changeTableComment(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n if (\n DriverUtils.isMySQLFamily(this.connection.driver) ||\n this.connection.driver.options.type === 'postgres'\n ) {\n const newComment = metadata.comment\n await this.queryRunner.changeTableComment(table, newComment)\n }\n }\n }\n\n /**\n * Creates tables that do not exist in the database yet.\n * New tables are created without foreign and primary keys.\n * Primary key only can be created in conclusion with auto generated column.\n */\n protected async createNewTables(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n // check if table does not exist yet\n const existTable = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (existTable) continue\n\n this.connection.logger.logSchemaBuild(\n `creating a new table: ${this.getTablePath(metadata)}`,\n )\n\n // create a new table and sync it in the database\n const table = Table.create(metadata, this.connection.driver)\n await this.queryRunner.createTable(table, false, false)\n this.queryRunner.loadedTables.push(table)\n }\n }\n\n protected async createViews(): Promise {\n for (const metadata of this.viewEntityToSyncMetadatas) {\n // check if view does not exist yet\n const existView = this.queryRunner.loadedViews.find((view) => {\n const viewExpression =\n typeof view.expression === \"string\"\n ? view.expression.trim()\n : view.expression(this.connection).getQuery()\n const metadataExpression =\n typeof metadata.expression === \"string\"\n ? metadata.expression.trim()\n : metadata.expression!(this.connection).getQuery()\n return (\n this.getTablePath(view) === this.getTablePath(metadata) &&\n viewExpression === metadataExpression\n )\n })\n if (existView) continue\n\n this.connection.logger.logSchemaBuild(\n `creating a new view: ${this.getTablePath(metadata)}`,\n )\n\n // create a new view and sync it in the database\n const view = View.create(metadata, this.connection.driver)\n await this.queryRunner.createView(view, true)\n this.queryRunner.loadedViews.push(view)\n }\n }\n\n protected async dropOldViews(): Promise {\n const droppedViews: Array = []\n const viewEntityToSyncMetadatas = this.viewEntityToSyncMetadatas\n // BuIld lookup cache for finding views metadata\n const viewToMetadata = new Map()\n for (const view of this.queryRunner.loadedViews) {\n const viewMetadata = viewEntityToSyncMetadatas.find((metadata) => {\n return this.getTablePath(view) === this.getTablePath(metadata)\n })\n if (viewMetadata) {\n viewToMetadata.set(view, viewMetadata)\n }\n }\n // Gather all changed view, that need a drop\n for (const view of this.queryRunner.loadedViews) {\n const viewMetadata = viewToMetadata.get(view)\n if (!viewMetadata) {\n continue\n }\n const viewExpression =\n typeof view.expression === \"string\"\n ? view.expression.trim()\n : view.expression(this.connection).getQuery()\n const metadataExpression =\n typeof viewMetadata.expression === \"string\"\n ? viewMetadata.expression.trim()\n : viewMetadata.expression!(this.connection).getQuery()\n\n if (viewExpression === metadataExpression) continue\n\n this.connection.logger.logSchemaBuild(\n `dropping an old view: ${view.name}`,\n )\n\n // Collect view to be dropped\n droppedViews.push(view)\n }\n\n // Helper function that for a given view, will recursively return list of the view and all views that depend on it\n const viewDependencyChain = (view: View): View[] => {\n // Get the view metadata\n const viewMetadata = viewToMetadata.get(view)\n let viewWithDependencies = [view]\n // If no metadata is known for the view, simply return the view itself\n if (!viewMetadata) {\n return viewWithDependencies\n }\n // Iterate over all known views\n for (const [\n currentView,\n currentMetadata,\n ] of viewToMetadata.entries()) {\n // Ignore self reference\n if (currentView === view) {\n continue\n }\n // If the currently iterated view depends on the passed in view\n if (\n currentMetadata.dependsOn &&\n (currentMetadata.dependsOn.has(viewMetadata.target) ||\n currentMetadata.dependsOn.has(viewMetadata.name))\n ) {\n // Recursively add currently iterate view and its dependents\n viewWithDependencies = viewWithDependencies.concat(\n viewDependencyChain(currentView),\n )\n }\n }\n // Return all collected views\n return viewWithDependencies\n }\n\n // Collect final list of views to be dropped in a Set so there are no duplicates\n const droppedViewsWithDependencies: Set = new Set(\n // Collect all dropped views, and their dependencies\n droppedViews\n .map((view) => viewDependencyChain(view))\n // Flattened to single Array ( can be replaced with flatMap, once supported)\n .reduce((all, segment) => {\n return all.concat(segment)\n }, [])\n // Sort the views to be dropped in creation order\n .sort((a, b) => {\n return ViewUtils.viewMetadataCmp(\n viewToMetadata.get(a),\n viewToMetadata.get(b),\n )\n })\n // reverse order to get drop order\n .reverse(),\n )\n\n // Finally emit all drop views\n for (const view of droppedViewsWithDependencies) {\n await this.queryRunner.dropView(view)\n }\n this.queryRunner.loadedViews = this.queryRunner.loadedViews.filter(\n (view) => !droppedViewsWithDependencies.has(view),\n )\n }\n\n /**\n * Drops all columns that exist in the table, but does not exist in the metadata (left old).\n * We drop their keys too, since it should be safe.\n */\n protected async dropRemovedColumns(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n // find columns that exist in the database but does not exist in the metadata\n const droppedTableColumns = table.columns.filter((tableColumn) => {\n return !metadata.columns.find(\n (columnMetadata) =>\n columnMetadata.isVirtualProperty ||\n columnMetadata.databaseName === tableColumn.name,\n )\n })\n if (droppedTableColumns.length === 0) continue\n\n this.connection.logger.logSchemaBuild(\n `columns dropped in ${table.name}: ` +\n droppedTableColumns.map((column) => column.name).join(\", \"),\n )\n\n // drop columns from the database\n await this.queryRunner.dropColumns(table, droppedTableColumns)\n }\n }\n\n /**\n * Adds columns from metadata which does not exist in the table.\n * Columns are created without keys.\n */\n protected async addNewColumns(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n // find which columns are new\n const newColumnMetadatas = metadata.columns.filter(\n (columnMetadata) => {\n return (\n !columnMetadata.isVirtualProperty &&\n !table.columns.find(\n (tableColumn) =>\n tableColumn.name ===\n columnMetadata.databaseName,\n )\n )\n },\n )\n if (newColumnMetadatas.length === 0) continue\n\n // create columns in the database\n const newTableColumnOptions =\n this.metadataColumnsToTableColumnOptions(newColumnMetadatas)\n const newTableColumns = newTableColumnOptions.map(\n (option) => new TableColumn(option),\n )\n\n if (newTableColumns.length === 0) continue\n\n this.connection.logger.logSchemaBuild(\n `new columns added: ` +\n newColumnMetadatas\n .map((column) => column.databaseName)\n .join(\", \"),\n )\n await this.queryRunner.addColumns(table, newTableColumns)\n }\n }\n\n /**\n * Updates composite primary keys.\n */\n protected async updatePrimaryKeys(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n const primaryMetadataColumns = metadata.columns.filter(\n (column) => column.isPrimary,\n )\n const primaryTableColumns = table.columns.filter(\n (column) => column.isPrimary,\n )\n if (\n primaryTableColumns.length !== primaryMetadataColumns.length &&\n primaryMetadataColumns.length > 1\n ) {\n const changedPrimaryColumns = primaryMetadataColumns.map(\n (primaryMetadataColumn) => {\n return new TableColumn(\n TableUtils.createTableColumnOptions(\n primaryMetadataColumn,\n this.connection.driver,\n ),\n )\n },\n )\n await this.queryRunner.updatePrimaryKeys(\n table,\n changedPrimaryColumns,\n )\n }\n }\n }\n\n /**\n * Update all exist columns which metadata has changed.\n * Still don't create keys. Also we don't touch foreign keys of the changed columns.\n */\n protected async updateExistColumns(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n const changedColumns = this.connection.driver.findChangedColumns(\n table.columns,\n metadata.columns,\n )\n if (changedColumns.length === 0) continue\n\n // drop all foreign keys that point to this column\n for (const changedColumn of changedColumns) {\n await this.dropColumnReferencedForeignKeys(\n this.getTablePath(metadata),\n changedColumn.databaseName,\n )\n }\n\n // drop all composite indices related to this column\n for (const changedColumn of changedColumns) {\n await this.dropColumnCompositeIndices(\n this.getTablePath(metadata),\n changedColumn.databaseName,\n )\n }\n\n // drop all composite uniques related to this column\n // Mysql does not support unique constraints.\n if (\n !(\n DriverUtils.isMySQLFamily(this.connection.driver) ||\n this.connection.driver.options.type === \"aurora-mysql\" ||\n this.connection.driver.options.type === \"spanner\"\n )\n ) {\n for (const changedColumn of changedColumns) {\n await this.dropColumnCompositeUniques(\n this.getTablePath(metadata),\n changedColumn.databaseName,\n )\n }\n }\n\n // generate a map of new/old columns\n const newAndOldTableColumns = changedColumns.map(\n (changedColumn) => {\n const oldTableColumn = table.columns.find(\n (column) => column.name === changedColumn.databaseName,\n )!\n const newTableColumnOptions =\n TableUtils.createTableColumnOptions(\n changedColumn,\n this.connection.driver,\n )\n const newTableColumn = new TableColumn(\n newTableColumnOptions,\n )\n\n return {\n oldColumn: oldTableColumn,\n newColumn: newTableColumn,\n }\n },\n )\n\n if (newAndOldTableColumns.length === 0) continue\n\n this.connection.logger.logSchemaBuild(\n `columns changed in \"${table.name}\". updating: ` +\n changedColumns\n .map((column) => column.databaseName)\n .join(\", \"),\n )\n await this.queryRunner.changeColumns(table, newAndOldTableColumns)\n }\n }\n\n /**\n * Creates composite indices which are missing in db yet.\n */\n protected async createNewIndices(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n const newIndices = metadata.indices\n .filter(\n (indexMetadata) =>\n !table.indices.find(\n (tableIndex) =>\n tableIndex.name === indexMetadata.name,\n ) && indexMetadata.synchronize === true,\n )\n .map((indexMetadata) => TableIndex.create(indexMetadata))\n\n if (newIndices.length === 0) continue\n\n this.connection.logger.logSchemaBuild(\n `adding new indices ${newIndices\n .map((index) => `\"${index.name}\"`)\n .join(\", \")} in table \"${table.name}\"`,\n )\n await this.queryRunner.createIndices(table, newIndices)\n }\n }\n\n /**\n * Creates indices for materialized views.\n */\n protected async createNewViewIndices(): Promise {\n // Only PostgreSQL supports indices for materialized views.\n if (\n this.connection.options.type !== \"postgres\" ||\n !DriverUtils.isPostgresFamily(this.connection.driver)\n ) {\n return\n }\n const postgresQueryRunner: PostgresQueryRunner = (\n this.queryRunner\n )\n for (const metadata of this.viewEntityToSyncMetadatas) {\n // check if view does not exist yet\n const view = this.queryRunner.loadedViews.find((view) => {\n const viewExpression =\n typeof view.expression === \"string\"\n ? view.expression.trim()\n : view.expression(this.connection).getQuery()\n const metadataExpression =\n typeof metadata.expression === \"string\"\n ? metadata.expression.trim()\n : metadata.expression!(this.connection).getQuery()\n return (\n this.getTablePath(view) === this.getTablePath(metadata) &&\n viewExpression === metadataExpression\n )\n })\n if (!view || !view.materialized) continue\n\n const newIndices = metadata.indices\n .filter(\n (indexMetadata) =>\n !view.indices.find(\n (tableIndex) =>\n tableIndex.name === indexMetadata.name,\n ) && indexMetadata.synchronize === true,\n )\n .map((indexMetadata) => TableIndex.create(indexMetadata))\n\n if (newIndices.length === 0) continue\n\n this.connection.logger.logSchemaBuild(\n `adding new indices ${newIndices\n .map((index) => `\"${index.name}\"`)\n .join(\", \")} in view \"${view.name}\"`,\n )\n await postgresQueryRunner.createViewIndices(view, newIndices)\n }\n }\n\n protected async createNewChecks(): Promise {\n // Mysql does not support check constraints\n if (\n DriverUtils.isMySQLFamily(this.connection.driver) ||\n this.connection.driver.options.type === \"aurora-mysql\"\n )\n return\n\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n const newChecks = metadata.checks\n .filter(\n (checkMetadata) =>\n !table.checks.find(\n (tableCheck) =>\n tableCheck.name === checkMetadata.name,\n ),\n )\n .map((checkMetadata) => TableCheck.create(checkMetadata))\n\n if (newChecks.length === 0) continue\n\n this.connection.logger.logSchemaBuild(\n `adding new check constraints: ${newChecks\n .map((index) => `\"${index.name}\"`)\n .join(\", \")} in table \"${table.name}\"`,\n )\n await this.queryRunner.createCheckConstraints(table, newChecks)\n }\n }\n\n /**\n * Creates composite uniques which are missing in db yet.\n */\n protected async createCompositeUniqueConstraints(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n const compositeUniques = metadata.uniques\n .filter(\n (uniqueMetadata) =>\n uniqueMetadata.columns.length > 1 &&\n !table.uniques.find(\n (tableUnique) =>\n tableUnique.name === uniqueMetadata.name,\n ),\n )\n .map((uniqueMetadata) => TableUnique.create(uniqueMetadata))\n\n if (compositeUniques.length === 0) continue\n\n this.connection.logger.logSchemaBuild(\n `adding new unique constraints: ${compositeUniques\n .map((unique) => `\"${unique.name}\"`)\n .join(\", \")} in table \"${table.name}\"`,\n )\n await this.queryRunner.createUniqueConstraints(\n table,\n compositeUniques,\n )\n }\n }\n\n /**\n * Creates exclusions which are missing in db yet.\n */\n protected async createNewExclusions(): Promise {\n // Only PostgreSQL supports exclusion constraints\n if (!(this.connection.driver.options.type === \"postgres\")) return\n\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n const newExclusions = metadata.exclusions\n .filter(\n (exclusionMetadata) =>\n !table.exclusions.find(\n (tableExclusion) =>\n tableExclusion.name === exclusionMetadata.name,\n ),\n )\n .map((exclusionMetadata) =>\n TableExclusion.create(exclusionMetadata),\n )\n\n if (newExclusions.length === 0) continue\n\n this.connection.logger.logSchemaBuild(\n `adding new exclusion constraints: ${newExclusions\n .map((exclusion) => `\"${exclusion.name}\"`)\n .join(\", \")} in table \"${table.name}\"`,\n )\n await this.queryRunner.createExclusionConstraints(\n table,\n newExclusions,\n )\n }\n }\n\n /**\n * Creates foreign keys which does not exist in the table yet.\n */\n protected async createForeignKeys(): Promise {\n for (const metadata of this.entityToSyncMetadatas) {\n const table = this.queryRunner.loadedTables.find(\n (table) =>\n this.getTablePath(table) === this.getTablePath(metadata),\n )\n if (!table) continue\n\n const newKeys = metadata.foreignKeys.filter((foreignKey) => {\n return !table.foreignKeys.find(\n (dbForeignKey) =>\n dbForeignKey.name === foreignKey.name &&\n this.getTablePath(dbForeignKey) ===\n this.getTablePath(\n foreignKey.referencedEntityMetadata,\n ),\n )\n })\n if (newKeys.length === 0) continue\n\n const dbForeignKeys = newKeys.map((foreignKeyMetadata) =>\n TableForeignKey.create(\n foreignKeyMetadata,\n this.connection.driver,\n ),\n )\n this.connection.logger.logSchemaBuild(\n `creating a foreign keys: ${newKeys\n .map((key) => key.name)\n .join(\", \")} on table \"${table.name}\"`,\n )\n await this.queryRunner.createForeignKeys(table, dbForeignKeys)\n }\n }\n\n /**\n * Drops all foreign keys where given column of the given table is being used.\n */\n protected async dropColumnReferencedForeignKeys(\n tablePath: string,\n columnName: string,\n ): Promise {\n const table = this.queryRunner.loadedTables.find(\n (table) => this.getTablePath(table) === tablePath,\n )\n if (!table) return\n\n const tablesWithFK: Table[] = []\n const columnForeignKey = table.foreignKeys.find(\n (foreignKey) => foreignKey.columnNames.indexOf(columnName) !== -1,\n )\n if (columnForeignKey) {\n const clonedTable = table.clone()\n clonedTable.foreignKeys = [columnForeignKey]\n tablesWithFK.push(clonedTable)\n table.removeForeignKey(columnForeignKey)\n }\n\n for (const loadedTable of this.queryRunner.loadedTables) {\n const dependForeignKeys = loadedTable.foreignKeys.filter(\n (foreignKey) => {\n return (\n this.getTablePath(foreignKey) === tablePath &&\n foreignKey.referencedColumnNames.indexOf(columnName) !==\n -1\n )\n },\n )\n\n if (dependForeignKeys.length > 0) {\n const clonedTable = loadedTable.clone()\n clonedTable.foreignKeys = dependForeignKeys\n tablesWithFK.push(clonedTable)\n dependForeignKeys.forEach((dependForeignKey) =>\n loadedTable.removeForeignKey(dependForeignKey),\n )\n }\n }\n\n if (tablesWithFK.length > 0) {\n for (const tableWithFK of tablesWithFK) {\n this.connection.logger.logSchemaBuild(\n `dropping related foreign keys of ${\n tableWithFK.name\n }: ${tableWithFK.foreignKeys\n .map((foreignKey) => foreignKey.name)\n .join(\", \")}`,\n )\n await this.queryRunner.dropForeignKeys(\n tableWithFK,\n tableWithFK.foreignKeys,\n )\n }\n }\n }\n\n /**\n * Drops all composite indices, related to given column.\n */\n protected async dropColumnCompositeIndices(\n tablePath: string,\n columnName: string,\n ): Promise {\n const table = this.queryRunner.loadedTables.find(\n (table) => this.getTablePath(table) === tablePath,\n )\n if (!table) return\n\n const relatedIndices = table.indices.filter(\n (index) =>\n index.columnNames.length > 1 &&\n index.columnNames.indexOf(columnName) !== -1,\n )\n if (relatedIndices.length === 0) return\n\n this.connection.logger.logSchemaBuild(\n `dropping related indices of \"${tablePath}\".\"${columnName}\": ${relatedIndices\n .map((index) => index.name)\n .join(\", \")}`,\n )\n await this.queryRunner.dropIndices(table, relatedIndices)\n }\n\n /**\n * Drops all composite uniques, related to given column.\n */\n protected async dropColumnCompositeUniques(\n tablePath: string,\n columnName: string,\n ): Promise {\n const table = this.queryRunner.loadedTables.find(\n (table) => this.getTablePath(table) === tablePath,\n )\n if (!table) return\n\n const relatedUniques = table.uniques.filter(\n (unique) =>\n unique.columnNames.length > 1 &&\n unique.columnNames.indexOf(columnName) !== -1,\n )\n if (relatedUniques.length === 0) return\n\n this.connection.logger.logSchemaBuild(\n `dropping related unique constraints of \"${tablePath}\".\"${columnName}\": ${relatedUniques\n .map((unique) => unique.name)\n .join(\", \")}`,\n )\n await this.queryRunner.dropUniqueConstraints(table, relatedUniques)\n }\n\n /**\n * Creates new columns from the given column metadatas.\n */\n protected metadataColumnsToTableColumnOptions(\n columns: ColumnMetadata[],\n ): TableColumnOptions[] {\n return columns.map((columnMetadata) =>\n TableUtils.createTableColumnOptions(\n columnMetadata,\n this.connection.driver,\n ),\n )\n }\n\n /**\n * Creates typeorm service table for storing user defined Views and generate columns.\n */\n protected async createTypeormMetadataTable(queryRunner: QueryRunner) {\n const schema = this.currentSchema\n const database = this.currentDatabase\n const typeormMetadataTable = this.connection.driver.buildTableName(\n this.connection.metadataTableName,\n schema,\n database,\n )\n\n // Spanner requires at least one primary key in a table.\n // Since we don't have unique column in \"typeorm_metadata\" table\n // and we should avoid breaking changes, we mark all columns as primary for Spanner driver.\n const isPrimary = this.connection.driver.options.type === \"spanner\"\n await queryRunner.createTable(\n new Table({\n database: database,\n schema: schema,\n name: typeormMetadataTable,\n columns: [\n {\n name: \"type\",\n type: this.connection.driver.normalizeType({\n type: this.connection.driver.mappedDataTypes\n .metadataType,\n }),\n isNullable: false,\n isPrimary,\n },\n {\n name: \"database\",\n type: this.connection.driver.normalizeType({\n type: this.connection.driver.mappedDataTypes\n .metadataDatabase,\n }),\n isNullable: true,\n isPrimary,\n },\n {\n name: \"schema\",\n type: this.connection.driver.normalizeType({\n type: this.connection.driver.mappedDataTypes\n .metadataSchema,\n }),\n isNullable: true,\n isPrimary,\n },\n {\n name: \"table\",\n type: this.connection.driver.normalizeType({\n type: this.connection.driver.mappedDataTypes\n .metadataTable,\n }),\n isNullable: true,\n isPrimary,\n },\n {\n name: \"name\",\n type: this.connection.driver.normalizeType({\n type: this.connection.driver.mappedDataTypes\n .metadataName,\n }),\n isNullable: true,\n isPrimary,\n },\n {\n name: \"value\",\n type: this.connection.driver.normalizeType({\n type: this.connection.driver.mappedDataTypes\n .metadataValue,\n }),\n isNullable: true,\n isPrimary,\n },\n ],\n }),\n true,\n )\n }\n}\n"],"sourceRoot":".."}