import { MongoSchemaBuilder } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/schema-builder/MongoSchemaBuilder.ts";
Creates complete tables schemas in the database based on the entity metadatas.
Steps how schema is being built:
- load list of all tables with complete column and keys information from the db
- drop all (old) foreign keys that exist in the table, but does not exist in the metadata
- create new tables that does not exist in the db, but exist in the metadata
- drop all columns exist (left old) in the db table, but does not exist in the metadata
- add columns from metadata which does not exist in the table
- update all exist columns which metadata has changed
- update primary keys - update old and create new primary key from changed columns
- create foreign keys which does not exist in the table yet
- create indices which are missing in db yet, and drops indices which exist in the db, but does not exist in the metadata anymore