@mikro-orm/knex 6.2.10-dev.35 → 6.2.10-dev.37

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.
@@ -78,7 +78,7 @@ class MySqlSchemaHelper extends SchemaHelper_1.SchemaHelper {
78
78
  nullif(table_schema, schema()) as schema_name,
79
79
  column_name as column_name,
80
80
  column_default as column_default,
81
- column_comment as column_comment,
81
+ nullif(column_comment, '') as column_comment,
82
82
  is_nullable as is_nullable,
83
83
  data_type as data_type,
84
84
  column_type as column_type,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/knex",
3
- "version": "6.2.10-dev.35",
3
+ "version": "6.2.10-dev.37",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -66,7 +66,7 @@
66
66
  "@mikro-orm/core": "^6.2.9"
67
67
  },
68
68
  "peerDependencies": {
69
- "@mikro-orm/core": "6.2.10-dev.35",
69
+ "@mikro-orm/core": "6.2.10-dev.37",
70
70
  "better-sqlite3": "*",
71
71
  "libsql": "*",
72
72
  "mariadb": "*"
@@ -171,7 +171,7 @@ class DatabaseTable {
171
171
  getEntityDeclaration(namingStrategy, schemaHelper, scalarPropertiesForRelations) {
172
172
  const { fksOnColumnProps, fksOnStandaloneProps, columnFks, fkIndexes, nullableForeignKeys, skippedColumnNames, } = this.foreignKeysToProps(namingStrategy, scalarPropertiesForRelations);
173
173
  const name = namingStrategy.getEntityName(this.name, this.schema);
174
- const schema = new core_1.EntitySchema({ name, collection: this.name, schema: this.schema });
174
+ const schema = new core_1.EntitySchema({ name, collection: this.name, schema: this.schema, comment: this.comment });
175
175
  const compositeFkIndexes = {};
176
176
  const compositeFkUniques = {};
177
177
  const potentiallyUnmappedIndexes = this.indexes.filter(index => !index.primary // Skip primary index. Whether it's in use by scalar column or FK, it's already mapped.
@@ -505,6 +505,7 @@ class DatabaseTable {
505
505
  columnOptions.length = column.length;
506
506
  columnOptions.precision = column.precision;
507
507
  columnOptions.scale = column.scale;
508
+ columnOptions.comment = column.comment;
508
509
  columnOptions.enum = !!column.enumItems?.length;
509
510
  columnOptions.items = column.enumItems;
510
511
  }
@@ -558,6 +559,7 @@ class DatabaseTable {
558
559
  length: column.length,
559
560
  precision: column.precision,
560
561
  scale: column.scale,
562
+ comment: column.comment,
561
563
  index: index ? index.keyName : undefined,
562
564
  unique: unique ? unique.keyName : undefined,
563
565
  enum: !!column.enumItems?.length,
@@ -61,8 +61,7 @@ class SchemaHelper {
61
61
  }
62
62
  async loadInformationSchema(schema, connection, tables, schemas) {
63
63
  for (const t of tables) {
64
- const table = schema.addTable(t.table_name, t.schema_name);
65
- table.comment = t.table_comment;
64
+ const table = schema.addTable(t.table_name, t.schema_name, t.table_comment);
66
65
  const cols = await this.getColumns(connection, table.name, table.schema);
67
66
  const indexes = await this.getIndexes(connection, table.name, table.schema);
68
67
  const checks = await this.getChecks(connection, table.name, table.schema, cols);