Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

No data to export when using a duplicate collection with data structure only #121

Closed
TMCautomates opened this issue Jan 27, 2020 · 2 comments
Assignees
Labels
Milestone

Comments

@TMCautomates
Copy link

I have created a 'collection' that I would like to use as a template for creating survey data, however, when I duplicate the collection and create new records within the collection and try to export the data, it shows 0 items selected and exporting all data only gives me headings. This could be when I have entered 100 lines of data in the table view. I have tried this on the Windows portable and EXE versions and they both give the same result on two different Windows machines and I have the same issue on a laptop running Ubuntu. I have created a template with 500 records, and duplicated this collection and I am able to export those 500 lines of data, but if I duplicate a record, the duplicate will not be added to the export.

@joshirio joshirio added the bug label Jan 27, 2020
@joshirio joshirio added this to the 2.6 milestone Jan 27, 2020
@joshirio
Copy link
Collaborator

Yes that's a bug, I was able to reproduce it. This affects also printing. Looks like during export/print data from the records can't be accessed.

Thanks for the report.

@joshirio
Copy link
Collaborator

joshirio commented Jan 27, 2020

Looks like the _id column inside the SQLite database remains NULL in some cases when a collection is duplicated, but it should contain an automatically incrementing number when a new record is added.

EDIT: it is related to the following issue: if all records are deleted on a collection that has been duplicated and then a new record is added, it will have the _id value NULL, happens only on duplicated collections... need to investigate this.

EDIT2: looks like deleting all records is not necessary to reproduce, it's just adding records on duplicated collections causes _id NULL even if the copied data has valid ids.

EDIT3: reason found, the created sql table is missing the PRIMARY KEY property, example: CREATE TABLE "cb92ee55f44577b584464c13f47fa3771_metadata" ("_id" INTEGER PRIMARY KEY , "key" TEXT, "value" TEXT)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants