Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Renaming a ForeignField causes not showing the table #224

Closed
bykof opened this issue Jun 3, 2021 · 2 comments
Closed

Bug: Renaming a ForeignField causes not showing the table #224

bykof opened this issue Jun 3, 2021 · 2 comments

Comments

@bykof
Copy link

bykof commented Jun 3, 2021

Hey folks!
If I rename a ForeignField the whole table couldn't get displayed anymore.
It only shows the loading table:
Screenshot 2021-06-03 at 12 21 34

I investigated that a bit and it looks like there were some fields in the meta column of the nc_models table:
The current meta table looks like that:

{
  "tn": "xa3__contact",
  "_tn": "Contact",
  "columns": [
    {
      "validate": {
        "func": [],
        "args": [],
        "msg": []
      },
      "cn": "id",
      "_cn": "id",
      "type": "integer",
      "dt": "int4",
      "uidt": "ID",
      "uip": "",
      "uicn": "",
      "dtx": "integer",
      "ct": "int(11)",
      "nrqd": false,
      "rqd": true,
      "ck": false,
      "pk": true,
      "un": false,
      "ai": true,
      "cdf": null,
      "clen": null,
      "np": 11,
      "ns": 0,
      "dtxp": "11",
      "dtxs": "",
      "tn": "xa3__contact"
    },
    {
      "validate": {
        "func": [],
        "args": [],
        "msg": []
      },
      "cn": "created_at",
      "_cn": "created_at",
      "type": "timestamp",
      "dt": "timestamp",
      "uidt": "CreateTime",
      "uip": "",
      "uicn": "",
      "dtx": "specificType",
      "ct": "varchar(45)",
      "nrqd": true,
      "rqd": false,
      "ck": false,
      "pk": false,
      "un": false,
      "ai": false,
      "cdf": "now()",
      "clen": 45,
      "np": null,
      "ns": null,
      "dtxp": "",
      "dtxs": "",
      "default": "now()",
      "columnDefault": "now()"
    },
    {
      "validate": {
        "func": [],
        "args": [],
        "msg": []
      },
      "cn": "updated_at",
      "_cn": "updated_at",
      "type": "timestamp",
      "dt": "timestamp",
      "uidt": "LastModifiedTime",
      "uip": "",
      "uicn": "",
      "dtx": "specificType",
      "ct": "varchar(45)",
      "nrqd": true,
      "rqd": false,
      "ck": false,
      "pk": false,
      "un": false,
      "ai": false,
      "au": true,
      "cdf": "now()",
      "clen": 45,
      "np": null,
      "ns": null,
      "dtxp": "",
      "dtxs": "",
      "default": "now()",
      "columnDefault": "now()"
    },
    {
      "validate": {
        "func": [],
        "args": [],
        "msg": []
      },
      "cn": "first_name",
      "_cn": "first_name",
      "type": "string",
      "dt": "character varying",
      "uidt": "SingleLineText",
      "uip": "",
      "uicn": "",
      "dtx": "specificType",
      "ct": "integer(11)",
      "nrqd": true,
      "rqd": true,
      "ck": false,
      "pk": false,
      "un": false,
      "ai": false,
      "cdf": null,
      "clen": 45,
      "np": null,
      "ns": null,
      "cno": "title4",
      "tn": "xa3__contact"
    },
    {
      "validate": {
        "func": [],
        "args": [],
        "msg": []
      },
      "cn": "last_name",
      "_cn": "last_name",
      "type": "string",
      "dt": "character varying",
      "uidt": "SingleLineText",
      "uip": "",
      "uicn": "",
      "dtx": "specificType",
      "ct": "integer(11)",
      "nrqd": true,
      "rqd": false,
      "ck": false,
      "pk": false,
      "un": false,
      "ai": false,
      "cdf": null,
      "clen": 45,
      "np": null,
      "ns": null,
      "cno": "title5",
      "tn": "xa3__contact"
    },
    {
      "validate": {
        "func": [],
        "args": [],
        "msg": []
      },
      "cn": "company",
      "_cn": "company",
      "type": "integer",
      "dt": "int4",
      "uidt": "ForeignKey",
      "uip": "",
      "uicn": "",
      "dtx": "specificType",
      "ct": "integer(11)",
      "nrqd": true,
      "rqd": false,
      "ck": false,
      "pk": false,
      "un": false,
      "ai": false,
      "cdf": null,
      "clen": 45,
      "np": null,
      "ns": null,
      "dtxp": "11",
      "dtxs": "",
      "cno": "company",
      "tn": "xa3__contact"
    }
  ],
  "pks": [],
  "hasMany": [
    {
      "ur": "CASCADE",
      "tn": "xa3__address",
      "_tn": "Address",
      "cn": "contact",
      "_cn": null,
      "rtn": "xa3__contact",
      "rcn": "id",
      "_rcn": null,
      "_rtn": "Contact",
      "type": "real",
      "db_type": "pg",
      "dr": "CASCADE"
    },
    {
      "ur": "CASCADE",
      "tn": "xa3__email_address",
      "_tn": "EmailAddress",
      "cn": "contact",
      "_cn": null,
      "rtn": "xa3__contact",
      "rcn": "id",
      "_rcn": null,
      "_rtn": "Contact",
      "type": "real",
      "db_type": "pg",
      "dr": "CASCADE"
    }
  ],
  "belongsTo": [
    {
      "ur": "CASCADE",
      "tn": "xa3__contact",
      "_tn": "Contact",
      "cn": "company",
      "_cn": null,
      "rtn": "xa3__company",
      "rcn": "id",
      "_rcn": null,
      "_rtn": "Company",
      "type": "real",
      "db_type": "pg",
      "dr": "CASCADE"
    }
  ],
  "dbType": "pg",
  "type": "table"
}

I tested it by renaming the field company to compana and it looks like there are some fields, which do not get renamed.
I hope it helps :)

@o1lab
Copy link
Member

o1lab commented Jun 3, 2021

Will see how we did previously, we weren't allowing editing of foreign keys but rename has an issue which is spilling over to this. Thanks for report.

@pranavxc
Copy link
Member

pranavxc commented Jun 3, 2021

Fixed in nocodb@0.9.23

akbarpasha pushed a commit to akbarpasha/nocodb that referenced this issue Nov 15, 2021
Update column name in metadata relations list

fix nocodb#224

Signed-off-by: Pranav C Balan <pranavxc@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants