π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix: ensure stable ordering by PK or CreatedTime when duplicates exist
Pranav Ce6bf8580731c
diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.tsindex 4617d0d40a..2f067ebc9d 100644--- a/packages/nocodb/src/db/BaseModelSqlv2.ts+++ b/packages/nocodb/src/db/BaseModelSqlv2.ts@@ -557,10 +557,10 @@ class BaseModelSqlv2 implements IBaseModelSqlV2 {}// Ensure stable ordering:-// - Use auto-increment PK if available-// - Otherwise, fallback to system CreatedTime-// This avoids issues when order column has duplicates-if (this.model.primaryKey && this.model.primaryKey.ai) {+ // - Use auto-increment PK if available+ // - Otherwise, fallback to system CreatedTime+ // This avoids issues when order column has duplicates+ if (this.model.primaryKey && this.model.primaryKey.ai) {qb.orderBy(this.model.primaryKey.column_name);} else {const createdCol = this.model.columns.find(