Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: remove order by

DarkPhoenix27040ddb479f936d
diff --git a/packages/nocodb/src/utils/migrationUtils.ts b/packages/nocodb/src/utils/migrationUtils.ts
index ad188da9b8..c03d1a69d8 100644
--- a/packages/nocodb/src/utils/migrationUtils.ts
+++ b/packages/nocodb/src/utils/migrationUtils.ts
@@ -6,7 +6,6 @@ interface MigrationOptions {
READ_BATCH_SIZE?: number;
INSERT_BATCH_SIZE?: number;
whereConditions?: (queryBuilder: Knex.QueryBuilder) => Knex.QueryBuilder;
- orderBy?: string | string[] | { column: string; order?: 'asc' | 'desc' }[];
selectColumns?: string | string[];
}
@@ -25,7 +24,6 @@ export async function migrateTableInBatches(
READ_BATCH_SIZE = 1000,
INSERT_BATCH_SIZE = 200,
whereConditions,
- orderBy = 'id',
selectColumns = '*',
} = options;
@@ -40,20 +38,6 @@ export async function migrateTableInBatches(
if (whereConditions) {
query = whereConditions(query);
}
-
- // Apply ordering and pagination
- if (Array.isArray(orderBy)) {
- orderBy.forEach((order) => {
- if (typeof order === 'string') {
- query = query.orderBy(order);
- } else {
- query = query.orderBy(order.column, order.order || 'asc');
- }
- });
- } else {
- query = query.orderBy(orderBy as string);
- }
-
const rows = await query.offset(offset).limit(READ_BATCH_SIZE + 1); // +1 to check if there are more rows
logger.log(