π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix: change column index logic
Ramesh Mane0982bf0ead7c
diff --git a/packages/nocodb/src/meta/migrations/v0/nc_021_record_templates.ts b/packages/nocodb/src/meta/migrations/v0/nc_021_record_templates.tsindex 0187b97d9b..c7ca7914b4 100644--- a/packages/nocodb/src/meta/migrations/v0/nc_021_record_templates.ts+++ b/packages/nocodb/src/meta/migrations/v0/nc_021_record_templates.ts@@ -5,9 +5,9 @@ const up = async (knex: Knex) => {if (!(await knex.schema.hasTable(MetaTable.RECORD_TEMPLATES))) {await knex.schema.createTable(MetaTable.RECORD_TEMPLATES, (table) => {table.string('id', 20).notNullable();- table.string('base_id', 20).notNullable();- table.string('fk_workspace_id', 20);- table.string('source_id', 20).notNullable();+ table.string('base_id', 20).notNullable().index();+ table.string('fk_workspace_id', 20).index();+ table.string('source_id', 20).notNullable().index();table.string('title', 255).notNullable();table.text('description');table.text('template_data').notNullable();@@ -18,20 +18,6 @@ const up = async (knex: Knex) => {table.primary(['base_id', 'id']);});}-- // Use raw SQL for indexes to avoid PG transaction abort on duplicates- await knex.raw(- `CREATE INDEX IF NOT EXISTS "nc_record_templates_base_id_idx" ON "${MetaTable.RECORD_TEMPLATES}" ("base_id")`,- );- await knex.raw(- `CREATE INDEX IF NOT EXISTS "nc_record_templates_source_id_idx" ON "${MetaTable.RECORD_TEMPLATES}" ("source_id")`,- );- await knex.raw(- `CREATE INDEX IF NOT EXISTS "nc_record_templates_base_source_idx" ON "${MetaTable.RECORD_TEMPLATES}" ("base_id", "source_id")`,- );- await knex.raw(- `CREATE INDEX IF NOT EXISTS "nc_record_templates_workspace_id_idx" ON "${MetaTable.RECORD_TEMPLATES}" ("fk_workspace_id")`,- );};const down = async (knex: Knex) => {