nocodb icon indicating copy to clipboard operation
nocodb copied to clipboard

[Feature] Duplicate table

Open include opened this issue 3 years ago • 5 comments

First and foremost - thank you very much for this awesome open-source tool!

I think it would be very useful to be able to clone tables and its views. Simple as that :)

In some situations I need to have the same data replicated into a new table where I can take the old views and revamp them.

A community member came with the idea to integrate AppSmith to do this from API (clone the table) but the views might be a little bit more difficult.

Cheers, F

include avatar Jul 23 '22 17:07 include

Views Can be duplicated

o1lab avatar Jul 23 '22 18:07 o1lab

Hi @o1lab thanks for teaching me that :) the icon is so subtle that didn’t noticed it. How about cloning a table? Am I missing something? thanks.

include avatar Jul 24 '22 00:07 include

@include cloning table is currently not supported.

dstala avatar Jul 24 '22 04:07 dstala

@dstala is it something you imagine it would be possible in the future?!

include avatar Jul 24 '22 17:07 include

ya sure - this should be possible.

o1lab avatar Jul 24 '22 18:07 o1lab

Until the feature is developed and released, is there an easy way to do it manually ? Like creating the DB tables, with specific names, etc. I have a table with 30+ columns which would constantly need to be recreated. Tedious to do it by hand.

3dprogramin avatar Feb 15 '23 10:02 3dprogramin

@3dprogramin If there are no relations to this table - then it would be easy.

  • Just hover on the table name with alt key pressed - it will show the real name of table in the database.
  • And then you can go duplicate the table in database.
  • you will have to do meta sync before you can see that within the UI

o1lab avatar Feb 15 '23 10:02 o1lab

@o1lab I tried that, it worked, but the new table is not quite the same.

Original table looks like this image

New table after meta sync image2

Here are the differences:

  • column names were originally snake case, new table has them pascal case
  • the status column in original table is single select, while new table has it long text
  • I can't modify most cells, getting the error in screenshot
  • Id column was also cloned as "normal" row, not system row

Maybe there is a way to clone the project ? That would also help

3dprogramin avatar Feb 15 '23 10:02 3dprogramin

Would like a way to do this in the API even if not in the UI yet.

Charuru avatar Mar 30 '23 02:03 Charuru

Yes, that would help too.

3dprogramin avatar Mar 30 '23 06:03 3dprogramin

We added this a while ago.

o1lab avatar Aug 12 '23 11:08 o1lab