Browse Source

refactor(nocodb): lookup type

pull/5222/head
Wing-Kam Wong 2 years ago
parent
commit
ff34ffa3c4
  1. 3
      packages/nocodb/src/lib/models/LookupColumn.ts
  2. 61
      packages/nocodb/src/schema/swagger.json

3
packages/nocodb/src/lib/models/LookupColumn.ts

@ -3,8 +3,9 @@ import Column from './Column';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import NocoCache from '../cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import { extractProps } from '../meta/helpers/extractProps'; import { extractProps } from '../meta/helpers/extractProps';
import type { LookupType } from 'nocodb-sdk';
export default class LookupColumn { export default class LookupColumn implements LookupType {
fk_relation_column_id: string; fk_relation_column_id: string;
fk_lookup_column_id: string; fk_lookup_column_id: string;
fk_column_id: string; fk_column_id: string;

61
packages/nocodb/src/schema/swagger.json

@ -10332,54 +10332,46 @@
"description": "Model for Lookup", "description": "Model for Lookup",
"examples": [ "examples": [
{ {
"deleted": "string", "id": "lk_mngsu0e45njbxr",
"fk_column_id": "string", "fk_column_id": "cl_vdiy9bz7h11kdm",
"fk_lookup_column_id": "string", "fk_relation_column_id": "cl_5jestblzneb649",
"fk_relation_column_id": "string", "fk_lookup_column_id": "cl_4cm47dtjphgqkv",
"id": "string", "order": 1
"order": "string",
"type": "string",
"virtual": true
} }
], ],
"title": "Lookup Model",
"type": "object",
"properties": { "properties": {
"deleted": { "id": {
"type": "string" "$ref": "#/components/schemas/Id",
"description": "Unique ID"
}, },
"fk_column_id": { "fk_column_id": {
"$ref": "#/components/schemas/Id", "$ref": "#/components/schemas/Id",
"description": "Foreign Key to Column" "description": "Foreign Key to Column"
}, },
"fk_lookup_column_id": { "fk_lookup_column_id": {
"type": "string" "$ref": "#/components/schemas/Id",
"description": "Foreign Key to Lookup Column"
}, },
"fk_relation_column_id": { "fk_relation_column_id": {
"type": "string"
},
"id": {
"$ref": "#/components/schemas/Id", "$ref": "#/components/schemas/Id",
"description": "Unique ID" "description": "Foreign Key to Relation Column"
}, },
"order": { "order": {
"type": "string" "type": "number",
}, "description": "The order among the list",
"type": { "example": 1
"type": "string" }
},
"virtual": {
"$ref": "#/components/schemas/Bool"
} }
},
"title": "Lookup Model",
"type": "object"
}, },
"LookupColumnReq": { "LookupColumnReq": {
"description": "Model for Lookup Column Request", "description": "Model for Lookup Column Request",
"examples": [ "examples": [
{ {
"fk_lookup_column_id": "string", "fk_relation_column_id": "cl_5jestblzneb649",
"fk_relation_column_id": "string", "fk_lookup_column_id": "cl_4cm47dtjphgqkv",
"title": "string", "title": "My Lookup",
"uidt": "Lookup" "uidt": "Lookup"
} }
], ],
@ -10387,18 +10379,23 @@
"type": "object", "type": "object",
"properties": { "properties": {
"fk_lookup_column_id": { "fk_lookup_column_id": {
"$ref": "#/components/schemas/Id" "$ref": "#/components/schemas/Id",
"description": "Foreign Key to Lookup Column"
}, },
"fk_relation_column_id": { "fk_relation_column_id": {
"$ref": "#/components/schemas/Id" "$ref": "#/components/schemas/Id",
"description": "Foreign Key to Relation Column"
}, },
"title": { "title": {
"maxLength": 255, "maxLength": 255,
"type": "string" "type": "string",
"description": "Lookup Title",
"example": "My Lookup"
}, },
"uidt": { "uidt": {
"enum": ["Lookup"], "enum": ["Lookup"],
"type": "string" "type": "string",
"description": "UI DataType"
} }
} }
}, },

Loading…
Cancel
Save