drizzle-seed 0.3.1-fd5d1e8 → 0.3.1-fd8bfcc

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.
package/index.cjs CHANGED
@@ -133098,7 +133098,7 @@ class GeneratePoint extends AbstractGenerator {
133098
133098
  }
133099
133099
  const x = this.state.xCoordinateGen.generate();
133100
133100
  const y = this.state.yCoordinateGen.generate();
133101
- if (this.dataType === 'json') {
133101
+ if (this.dataType === 'object') {
133102
133102
  return { x, y };
133103
133103
  }
133104
133104
  else if (this.dataType === 'string') {
@@ -133135,7 +133135,7 @@ class GenerateUniquePoint extends AbstractGenerator {
133135
133135
  }
133136
133136
  const x = this.state.xCoordinateGen.generate();
133137
133137
  const y = this.state.yCoordinateGen.generate();
133138
- if (this.dataType === 'json') {
133138
+ if (this.dataType === 'object') {
133139
133139
  return { x, y };
133140
133140
  }
133141
133141
  else if (this.dataType === 'string') {
@@ -133184,7 +133184,7 @@ class GenerateLine extends AbstractGenerator {
133184
133184
  b = this.state.bCoefficientGen.generate();
133185
133185
  }
133186
133186
  const c = this.state.cCoefficientGen.generate();
133187
- if (this.dataType === 'json') {
133187
+ if (this.dataType === 'object') {
133188
133188
  return { a, b, c };
133189
133189
  }
133190
133190
  else if (this.dataType === 'string') {
@@ -133232,7 +133232,7 @@ class GenerateUniqueLine extends AbstractGenerator {
133232
133232
  b = this.state.bCoefficientGen.generate();
133233
133233
  }
133234
133234
  const c = this.state.cCoefficientGen.generate();
133235
- if (this.dataType === 'json') {
133235
+ if (this.dataType === 'object') {
133236
133236
  return { a, b, c };
133237
133237
  }
133238
133238
  else if (this.dataType === 'string') {
@@ -134946,7 +134946,7 @@ class SeedService {
134946
134946
  const generator = new generatorsMap.GenerateBoolean[0]();
134947
134947
  return generator;
134948
134948
  }
134949
- if ((col.columnType === 'integer' && col.dataType === 'date')) {
134949
+ if ((col.columnType === 'integer' && col.dataType === 'object')) {
134950
134950
  const generator = new generatorsMap.GenerateTimestamp[0]();
134951
134951
  return generator;
134952
134952
  }
@@ -135571,8 +135571,10 @@ const getPostgresInfo = (pgSchema, pgTables) => {
135571
135571
  return dbToTsColumnNamesMap;
135572
135572
  }
135573
135573
  const tableConfig = pgCore.getTableConfig(table);
135574
- for (const [tsCol, col] of Object.entries(tableConfig.columns[0].table)) {
135575
- dbToTsColumnNamesMap[col.name] = tsCol;
135574
+ for (const [tsCol, col] of Object.entries(drizzleOrm.getColumnTable(tableConfig.columns[0]))) {
135575
+ // dbToTsColumnNamesMap[col.name] = tsCol;
135576
+ if (drizzleOrm.is(col, drizzleOrm.Column))
135577
+ dbToTsColumnNamesMap[col.name] = tsCol;
135576
135578
  }
135577
135579
  dbToTsColumnNamesMapGlobal[tableName] = dbToTsColumnNamesMap;
135578
135580
  return dbToTsColumnNamesMap;
@@ -135628,10 +135630,7 @@ const getPostgresInfo = (pgSchema, pgTables) => {
135628
135630
  };
135629
135631
  for (const table of Object.values(pgTables)) {
135630
135632
  tableConfig = pgCore.getTableConfig(table);
135631
- dbToTsColumnNamesMap = {};
135632
- for (const [tsCol, col] of Object.entries(tableConfig.columns[0].table)) {
135633
- dbToTsColumnNamesMap[col.name] = tsCol;
135634
- }
135633
+ dbToTsColumnNamesMap = getDbToTsColumnNamesMap(table);
135635
135634
  // might be empty list
135636
135635
  const newRelations = tableConfig.foreignKeys.map((fk) => {
135637
135636
  const table = dbToTsTableNamesMap[tableConfig.name];
@@ -135662,8 +135661,8 @@ const getPostgresInfo = (pgSchema, pgTables) => {
135662
135661
  name: baseColumn.name,
135663
135662
  columnType: baseColumn.getSQLType(),
135664
135663
  typeParams: getTypeParams(baseColumn.getSQLType()),
135665
- dataType: baseColumn.dataType,
135666
- size: baseColumn.size,
135664
+ dataType: baseColumn.dataType.split(' ')[0],
135665
+ size: baseColumn.length,
135667
135666
  hasDefault: baseColumn.hasDefault,
135668
135667
  enumValues: baseColumn.enumValues,
135669
135668
  default: baseColumn.default,
@@ -135715,8 +135714,8 @@ const getPostgresInfo = (pgSchema, pgTables) => {
135715
135714
  name: dbToTsColumnNamesMap[column.name],
135716
135715
  columnType: column.getSQLType(),
135717
135716
  typeParams: getTypeParams(column.getSQLType()),
135718
- dataType: column.dataType,
135719
- size: column.size,
135717
+ dataType: column.dataType.split(' ')[0],
135718
+ size: column.length,
135720
135719
  hasDefault: column.hasDefault,
135721
135720
  default: column.default,
135722
135721
  enumValues: column.enumValues,
@@ -135821,8 +135820,9 @@ const getMySqlInfo = (mysqlSchema, mysqlTables) => {
135821
135820
  return dbToTsColumnNamesMap;
135822
135821
  }
135823
135822
  const tableConfig = mysqlCore.getTableConfig(table);
135824
- for (const [tsCol, col] of Object.entries(tableConfig.columns[0].table)) {
135825
- dbToTsColumnNamesMap[col.name] = tsCol;
135823
+ for (const [tsCol, col] of Object.entries(drizzleOrm.getColumnTable(tableConfig.columns[0]))) {
135824
+ if (drizzleOrm.is(col, drizzleOrm.Column))
135825
+ dbToTsColumnNamesMap[col.name] = tsCol;
135826
135826
  }
135827
135827
  dbToTsColumnNamesMapGlobal[tableName] = dbToTsColumnNamesMap;
135828
135828
  return dbToTsColumnNamesMap;
@@ -135878,10 +135878,7 @@ const getMySqlInfo = (mysqlSchema, mysqlTables) => {
135878
135878
  };
135879
135879
  for (const table of Object.values(mysqlTables)) {
135880
135880
  tableConfig = mysqlCore.getTableConfig(table);
135881
- dbToTsColumnNamesMap = {};
135882
- for (const [tsCol, col] of Object.entries(tableConfig.columns[0].table)) {
135883
- dbToTsColumnNamesMap[col.name] = tsCol;
135884
- }
135881
+ dbToTsColumnNamesMap = getDbToTsColumnNamesMap(table);
135885
135882
  const newRelations = tableConfig.foreignKeys.map((fk) => {
135886
135883
  const table = dbToTsTableNamesMap[tableConfig.name];
135887
135884
  const refTable = dbToTsTableNamesMap[drizzleOrm.getTableName(fk.reference().foreignTable)];
@@ -135936,7 +135933,7 @@ const getMySqlInfo = (mysqlSchema, mysqlTables) => {
135936
135933
  name: dbToTsColumnNamesMap[column.name],
135937
135934
  columnType: column.getSQLType(),
135938
135935
  typeParams: getTypeParams(column.getSQLType()),
135939
- dataType: column.dataType,
135936
+ dataType: column.dataType.split(' ')[0],
135940
135937
  hasDefault: column.hasDefault,
135941
135938
  default: column.default,
135942
135939
  enumValues: column.enumValues,
@@ -136007,8 +136004,9 @@ const getSqliteInfo = (sqliteSchema, sqliteTables) => {
136007
136004
  return dbToTsColumnNamesMap;
136008
136005
  }
136009
136006
  const tableConfig = sqliteCore.getTableConfig(table);
136010
- for (const [tsCol, col] of Object.entries(tableConfig.columns[0].table)) {
136011
- dbToTsColumnNamesMap[col.name] = tsCol;
136007
+ for (const [tsCol, col] of Object.entries(drizzleOrm.getColumnTable(tableConfig.columns[0]))) {
136008
+ if (drizzleOrm.is(col, drizzleOrm.Column))
136009
+ dbToTsColumnNamesMap[col.name] = tsCol;
136012
136010
  }
136013
136011
  dbToTsColumnNamesMapGlobal[tableName] = dbToTsColumnNamesMap;
136014
136012
  return dbToTsColumnNamesMap;
@@ -136063,10 +136061,7 @@ const getSqliteInfo = (sqliteSchema, sqliteTables) => {
136063
136061
  };
136064
136062
  for (const table of Object.values(sqliteTables)) {
136065
136063
  tableConfig = sqliteCore.getTableConfig(table);
136066
- dbToTsColumnNamesMap = {};
136067
- for (const [tsCol, col] of Object.entries(tableConfig.columns[0].table)) {
136068
- dbToTsColumnNamesMap[col.name] = tsCol;
136069
- }
136064
+ dbToTsColumnNamesMap = getDbToTsColumnNamesMap(table);
136070
136065
  const newRelations = tableConfig.foreignKeys.map((fk) => {
136071
136066
  const table = dbToTsTableNamesMap[tableConfig.name];
136072
136067
  const refTable = dbToTsTableNamesMap[drizzleOrm.getTableName(fk.reference().foreignTable)];
@@ -136117,7 +136112,7 @@ const getSqliteInfo = (sqliteSchema, sqliteTables) => {
136117
136112
  name: dbToTsColumnNamesMap[column.name],
136118
136113
  columnType: column.getSQLType(),
136119
136114
  typeParams: getTypeParams(column.getSQLType()),
136120
- dataType: column.dataType,
136115
+ dataType: column.dataType.split(' ')[0],
136121
136116
  hasDefault: column.hasDefault,
136122
136117
  default: column.default,
136123
136118
  enumValues: column.enumValues,