Page 1 of 1

How can I change the position of DB collection column? and add auto increment data?

Posted: Fri May 02, 2014 1:33 am
by Tooba Atif

I have imported a collection from a CSV file and I want to add a new column which is indexed and should be the first column of DB. How can I do this? and I have to change some other column positions as well.
Also please let me know how can I insert the data for all 800 rows? lets say the data would be incrementing column numbers as ID of tables.


How can I change the position of DB collection column? and add auto increment data?

Posted: Fri May 02, 2014 3:48 am
by Yurii Orishchuk

Hi Atif.

Sorry but there is no ability to change order of the columns from the ui.

You can export DB to json or csv file, edit it after, and then import it to your DB.

Also there is no ability to set autoincrement field. As a workaround you can create a service that reads maximum field value, and then increment it before writing the next value to Database.

What about 800 rows - you can insert them with import collection or with server code.

See details here: http://docs.appery.io/documentation/b...

Regards.


How can I change the position of DB collection column? and add auto increment data?

Posted: Fri May 02, 2014 3:54 am
by Tooba Atif

Thanks Yurii.
Please add this feature in your future versions. It would be very helpful.
I have another DB collection of like 4000 records I cant update it manually by exporting to csv and then adding the new column and manually writing ID's and flags for all these records and then importing again.
Let me figure out something else.


How can I change the position of DB collection column? and add auto increment data?

Posted: Fri May 02, 2014 5:59 am
by Serhii Kulibaba

Hello,

As workaround you can add one more column for sorting. E.g. write 1 for first item, 2 - for second, etc.


How can I change the position of DB collection column? and add auto increment data?

Posted: Fri May 02, 2014 6:03 am
by Tooba Atif

This would take a lot of time for more data as my client has all the data in csv files and they are very large files having 25 to 50 columns and thousands of rows.


How can I change the position of DB collection column? and add auto increment data?

Posted: Fri May 02, 2014 11:33 am
by Serhii Kulibaba

You can sort csv file before uploading to appery.io. E.g. http://agencykb.activenetwork.com/Kno...


How can I change the position of DB collection column? and add auto increment data?

Posted: Mon May 05, 2014 1:35 am
by Tooba Atif

Thanks Sergiy..
I have used different options for my tables one was http://office.microsoft.com/en-au/exc...

and a few others that solved the issue :)
Thanks for your help!


How can I change the position of DB collection column? and add auto increment data?

Posted: Wed Jul 23, 2014 10:10 pm
by Alex Van Name

Image

I used this just now and it worked great, just export this as a windows csv


How can I change the position of DB collection column? and add auto increment data?

Posted: Thu Jul 24, 2014 3:13 am
by Yurii Orishchuk

Hi Alex,

Thanks for your update.

Regards.


How can I change the position of DB collection column? and add auto increment data?

Posted: Thu Jul 24, 2014 2:34 pm
by Alex Van Name

You're welcome! I will give back if I discover something helpful.