# Schema & Data

**URL:** https://community.dreamfactory.com/c/schema-data/18.md?page=1

[Latest](https://community.dreamfactory.com/latest.md) · [Categories](https://community.dreamfactory.com/categories.md) · [Tags](https://community.dreamfactory.com/tags.md)

**Page:** 2

---

## [Creating a schema with tables within tables?](https://community.dreamfactory.com/t/creating-a-schema-with-tables-within-tables/3645)

<div class="topic-metadata">

**Author:** [@Joshua\_Vannatter](https://community.dreamfactory.com/u/Joshua_Vannatter)\
**Replies:** 0\
**Last updated:** [February 14, 2017, 9:04pm UTC](https://community.dreamfactory.com/t/creating-a-schema-with-tables-within-tables/3645 "2017-02-14T21:04:19Z")

</div>

\[image\] Our group is attempting to create a schema that would result in something similar to the the table the image shows, but we're not sure if this is possible without creating multiple table…

---

## [Server error on adding a foreign key](https://community.dreamfactory.com/t/server-error-on-adding-a-foreign-key/3257)

<div class="topic-metadata">

**Author:** [@vijayst](https://community.dreamfactory.com/u/vijayst)\
**Replies:** 2\
**Last updated:** [January 17, 2017, 9:31am UTC](https://community.dreamfactory.com/t/server-error-on-adding-a-foreign-key/3257 "2017-01-17T09:31:00Z")

</div>

I am using the Schema manager to add a foreign key. While doing, I am getting a server side error which is unhelpful. strpos() expects parameter 1 to be string, array given Any ideas on how to resolve this?

---

## [Aggregation (count) for relationships](https://community.dreamfactory.com/t/aggregation-count-for-relationships/3575)

<div class="topic-metadata">

**Author:** [@manu206](https://community.dreamfactory.com/u/manu206)\
**Replies:** 0\
**Last updated:** [January 14, 2017, 8:38pm UTC](https://community.dreamfactory.com/t/aggregation-count-for-relationships/3575 "2017-01-14T20:38:26Z")

</div>

Hi, I need to get a list from one table and for all entries a count of the related entries of another table. Lets say I have a list of plans and each plan has maybe 1000 likes from users. I want to have the number of l…

---

## [User to role to app relations update upon app creation](https://community.dreamfactory.com/t/user-to-role-to-app-relations-update-upon-app-creation/3520)

<div class="topic-metadata">

**Author:** [@Vsevolod\_Gromov](https://community.dreamfactory.com/u/Vsevolod_Gromov)\
**Replies:** 0\
**Last updated:** [December 19, 2016, 2:16pm UTC](https://community.dreamfactory.com/t/user-to-role-to-app-relations-update-upon-app-creation/3520 "2016-12-19T14:16:32Z")

</div>

I use DF configuration with open registratin enabled. Each registered user got 'registered' role upon successfull registration, for each existing application. Now, assuming we have thousands of users registered, and addi…

---

## [Virtual foreign keys broken after migration to 2.4.1](https://community.dreamfactory.com/t/virtual-foreign-keys-broken-after-migration-to-2-4-1/3503)

<div class="topic-metadata">

**Author:** [@jps](https://community.dreamfactory.com/u/jps)\
**Replies:** 0\
**Last updated:** [December 13, 2016, 5:41pm UTC](https://community.dreamfactory.com/t/virtual-foreign-keys-broken-after-migration-to-2-4-1/3503 "2016-12-13T17:41:02Z")

</div>

I upgraded from 2.2.1 to 2.4.1. For some reason, virtual foreign keys were not migrated correctly: When I go to Schema, and select a table that had a virtual relationship before the upgrade, I don't see the relationsh…

---

## [Updating MySQL Schema to CASCADE on DELETE](https://community.dreamfactory.com/t/updating-mysql-schema-to-cascade-on-delete/3464)

<div class="topic-metadata">

**Author:** [@soleson](https://community.dreamfactory.com/u/soleson)\
**Replies:** 1\
**Last updated:** [November 23, 2016, 2:15pm UTC](https://community.dreamfactory.com/t/updating-mysql-schema-to-cascade-on-delete/3464 "2016-11-23T14:15:09Z")

</div>

I appreciate your help as I’m new to working with DF. I’m running into an issue where I’m unable to PATCH a table to update the foreign key relationships. I’ve been working on this for a few hours without success, so I’m…

---

## [How do you import a .json data file into DF](https://community.dreamfactory.com/t/how-do-you-import-a-json-data-file-into-df/3452)

<div class="topic-metadata">

**Author:** [@delebash](https://community.dreamfactory.com/u/delebash)\
**Replies:** 0\
**Last updated:** [November 20, 2016, 6:19pm UTC](https://community.dreamfactory.com/t/how-do-you-import-a-json-data-file-into-df/3452 "2016-11-20T18:19:22Z")

</div>

Using MySQL as the database service I am using the data.json and schema.json from your javascript-sdk-master from github. I was able to upload the schema.json with just a slight modification, but I don't know how to i…

---

## [Data Insertion main and reference tables through POST call receives error](https://community.dreamfactory.com/t/data-insertion-main-and-reference-tables-through-post-call-receives-error/3321)

<div class="topic-metadata">

**Author:** [@prateek.mishra](https://community.dreamfactory.com/u/prateek.mishra)\
**Replies:** 4\
**Last updated:** [October 17, 2016, 5:01am UTC](https://community.dreamfactory.com/t/data-insertion-main-and-reference-tables-through-post-call-receives-error/3321 "2016-10-17T05:01:05Z")

</div>

My body is this { "resource": \[ { "queueId":24, "QueueName": "queueName11", "IsIncluded": true, "users": "test@test.com", "holdtime": 234, "groupby": "1", "queue\_fields\_by\_q…

---

## [POST to a table that has a belongs\_to relationship no longer working in 2.3](https://community.dreamfactory.com/t/post-to-a-table-that-has-a-belongs-to-relationship-no-longer-working-in-2-3/3314)

<div class="topic-metadata">

**Author:** [@nvasilescu](https://community.dreamfactory.com/u/nvasilescu)\
**Replies:** 3\
**Last updated:** [October 12, 2016, 2:05pm UTC](https://community.dreamfactory.com/t/post-to-a-table-that-has-a-belongs-to-relationship-no-longer-working-in-2-3/3314 "2016-10-12T14:05:25Z")

</div>

Hello. Please help with this urgent matter. I updated to df 2.3 . In 2.1 the current schema and system worked. I have a table pictures. this table has a field user\_id . the user\_id has belongs\_to relationship to th…

---

## [Array\_key\_exists() expects parameter 2 to be array, string given](https://community.dreamfactory.com/t/array-key-exists-expects-parameter-2-to-be-array-string-given/3313)

<div class="topic-metadata">

**Author:** [@nvasilescu](https://community.dreamfactory.com/u/nvasilescu)\
**Replies:** 0\
**Last updated:** [October 8, 2016, 8:55am UTC](https://community.dreamfactory.com/t/array-key-exists-expects-parameter-2-to-be-array-string-given/3313 "2016-10-08T08:55:40Z")

</div>

After installation of 2.3 , when I select a row in a local mysql db and click delete I get "array\_key\_exists() expects parameter 2 to be array, string given" popup. If I edit that field then press the delete when I am…

---

## [Why dreamfactory allow UNDEFINED column in POST and PUT API request?](https://community.dreamfactory.com/t/why-dreamfactory-allow-undefined-column-in-post-and-put-api-request/3267)

<div class="topic-metadata">

**Author:** [@navarathinam](https://community.dreamfactory.com/u/navarathinam)\
**Replies:** 1\
**Last updated:** [September 27, 2016, 4:36am UTC](https://community.dreamfactory.com/t/why-dreamfactory-allow-undefined-column-in-post-and-put-api-request/3267 "2016-09-27T04:36:47Z")

</div>

Hi all, I have doubt in dreamfactory POST and PUT request with Undefined column. Kindly refer the attachement, In Dreamfactory: In Phpmyadmin In my scenario, i try to insert record with undefined column ‘address2…

---

## [Relationship query sql 1040 error](https://community.dreamfactory.com/t/relationship-query-sql-1040-error/3188)

<div class="topic-metadata">

**Author:** [@nvasilescu](https://community.dreamfactory.com/u/nvasilescu)\
**Replies:** 1\
**Last updated:** [September 26, 2016, 1:15pm UTC](https://community.dreamfactory.com/t/relationship-query-sql-1040-error/3188 "2016-09-26T13:15:07Z")

</div>

I'm using on an azure deployed image. Admin Application Version: 2.1.5 DreamFactory Version: 2.1.1 I have a table which has few hundred entries. Each entry has a user\_id colum. Relationship of the table : user\_…

---

## [Returning true instead of 1](https://community.dreamfactory.com/t/returning-true-instead-of-1/3183)

<div class="topic-metadata">

**Author:** [@jraiche](https://community.dreamfactory.com/u/jraiche)\
**Replies:** 2\
**Last updated:** [September 9, 2016, 1:52pm UTC](https://community.dreamfactory.com/t/returning-true-instead-of-1/3183 "2016-09-09T13:52:06Z")

</div>

When I first set up dreamfactory, I had a column with type INT(1). Every time I queried that column, it returned a boolean (true) instead of 1, so I changed the column type to INT(4) in phpmyadmin, and when that didn't w…

---

## [Postgresql database not appearing in Schema Manager or Data service](https://community.dreamfactory.com/t/postgresql-database-not-appearing-in-schema-manager-or-data-service/3099)

<div class="topic-metadata">

**Author:** [@marksim](https://community.dreamfactory.com/u/marksim)\
**Replies:** 5\
**Last updated:** [August 29, 2016, 3:22pm UTC](https://community.dreamfactory.com/t/postgresql-database-not-appearing-in-schema-manager-or-data-service/3099 "2016-08-29T15:22:15Z")

</div>

Our Postgresql database service does not appear in the interface under Schema Manager or Data service. Howerver, SQLite service does show up. Shouldn't we see the Postgres service? Using source code version of DF 2…

---

## [Where in clause](https://community.dreamfactory.com/t/where-in-clause/3039)

<div class="topic-metadata">

**Author:** [@nvasilescu](https://community.dreamfactory.com/u/nvasilescu)\
**Replies:** 3\
**Last updated:** [August 8, 2016, 7:43pm UTC](https://community.dreamfactory.com/t/where-in-clause/3039 "2016-08-08T19:43:32Z")

</div>

I need to run a custom sql query on a single table that involves the WHERE pic\_id(integer) IN {list of integer values here}. I can't find any way of doing this. Thank you

---

## [How to create a temporary table, and discard it afterwards?](https://community.dreamfactory.com/t/how-to-create-a-temporary-table-and-discard-it-afterwards/2997)

<div class="topic-metadata">

**Author:** [@Vsevolod\_Gromov](https://community.dreamfactory.com/u/Vsevolod_Gromov)\
**Replies:** 2\
**Last updated:** [July 25, 2016, 7:27pm UTC](https://community.dreamfactory.com/t/how-to-create-a-temporary-table-and-discard-it-afterwards/2997 "2016-07-25T19:27:55Z")

</div>

The thing I need to do is rather simple. Retrieve updated|new records from the application server. Updates propagate strictly from server to client. GET on scripted endpoint have an additional parameter which holds JSON …

---

## [Not able to retieve records from a Table](https://community.dreamfactory.com/t/not-able-to-retieve-records-from-a-table/2999)

<div class="topic-metadata">

**Author:** [@ft-anju](https://community.dreamfactory.com/u/ft-anju)\
**Replies:** 5\
**Last updated:** [July 20, 2016, 2:32pm UTC](https://community.dreamfactory.com/t/not-able-to-retieve-records-from-a-table/2999 "2016-07-20T14:32:39Z")

</div>

Hello, I created a simple table in MySQL and added records. I was trying to use the API docs to retrieve the table records. I could not get value for following requests: 1) get all records from a table (table name npi da…

---

## [Getting Related Data Query](https://community.dreamfactory.com/t/getting-related-data-query/500)

<div class="topic-metadata">

**Author:** [@praveen](https://community.dreamfactory.com/u/praveen)\
**Replies:** 11\
**Last updated:** [July 13, 2016, 1:32pm UTC](https://community.dreamfactory.com/t/getting-related-data-query/500 "2016-07-13T13:32:54Z")

</div>

Let's say I have the following 3 Tables:- A a\_id b\_id (Foreign Key from Table B) B b\_id c\_id (Foreign Key from Table C) C c\_id c\_name Is there a way in which while fetching the rows of Table A, I can also fetch t…

---

## [Cannot post data to multiple tables with joins](https://community.dreamfactory.com/t/cannot-post-data-to-multiple-tables-with-joins/2728)

<div class="topic-metadata">

**Author:** [@Manvir\_Singh](https://community.dreamfactory.com/u/Manvir_Singh)\
**Replies:** 1\
**Last updated:** [July 6, 2016, 5:21pm UTC](https://community.dreamfactory.com/t/cannot-post-data-to-multiple-tables-with-joins/2728 "2016-07-06T17:21:16Z")

</div>

Hi I cannot seem to get Dreamfactory to post to a multiple table which are all related. im am facing the error as per below. { "error": { "context": null, "message": "Failed to update belongs-to assignment.\\…

---

## [What is wrong with this record create](https://community.dreamfactory.com/t/what-is-wrong-with-this-record-create/2809)

<div class="topic-metadata">

**Author:** [@Vineet\_Chauhan](https://community.dreamfactory.com/u/Vineet_Chauhan)\
**Replies:** 3\
**Last updated:** [June 8, 2016, 4:29pm UTC](https://community.dreamfactory.com/t/what-is-wrong-with-this-record-create/2809 "2016-06-08T16:29:46Z")

</div>

{ "resource": \[ { "id": 0, "FirstName": "Vineet", "LastName": "Chauhan", "username": "sdsds", "Email: "sdsds.sdsd@gmail.com" } \], "ids": \[ 0 \], "filter": "string", "p…

---

## [SQL file to create tables in your dashboard](https://community.dreamfactory.com/t/sql-file-to-create-tables-in-your-dashboard/2761)

<div class="topic-metadata">

**Author:** [@Vineet\_Chauhan](https://community.dreamfactory.com/u/Vineet_Chauhan)\
**Replies:** 2\
**Last updated:** [June 6, 2016, 6:20am UTC](https://community.dreamfactory.com/t/sql-file-to-create-tables-in-your-dashboard/2761 "2016-06-06T06:20:16Z")

</div>

How do you create the tables in your account - SQLite from the SQL files I have. Is there a tool to convert the DDLs to JSON definition which can then be uploaded to create similar table in DreamFactory. ?

---

## [MongoDB aggregation operators](https://community.dreamfactory.com/t/mongodb-aggregation-operators/2736)

<div class="topic-metadata">

**Author:** [@Abraham\_Garcia](https://community.dreamfactory.com/u/Abraham_Garcia)\
**Replies:** 1\
**Last updated:** [June 2, 2016, 11:11am UTC](https://community.dreamfactory.com/t/mongodb-aggregation-operators/2736 "2016-06-02T11:11:50Z")

</div>

It would be nice if in future releases we can use aggregation operators in the custom script screen. In order to perform complex queries to our mongodb instance. Also if you can use the driver for php and a ODM to have t…

---

## [Create table in online sandbox environment](https://community.dreamfactory.com/t/create-table-in-online-sandbox-environment/1635)

<div class="topic-metadata">

**Author:** [@dailystudio](https://community.dreamfactory.com/u/dailystudio)\
**Replies:** 3\
**Last updated:** [May 31, 2016, 1:24pm UTC](https://community.dreamfactory.com/t/create-table-in-online-sandbox-environment/1635 "2016-05-31T13:24:27Z")

</div>

With some tests, I feel it is really hard for me to create a table in online sandbox. The SQLite database driver has lots of constrains. First, there is always an example\_field which could be never removed. The second, I…

---

## [Sometimes get 0 value for user\_id](https://community.dreamfactory.com/t/sometimes-get-0-value-for-user-id/2680)

<div class="topic-metadata">

**Author:** [@allensandiego](https://community.dreamfactory.com/u/allensandiego)\
**Replies:** 1\
**Last updated:** [May 13, 2016, 6:27pm UTC](https://community.dreamfactory.com/t/sometimes-get-0-value-for-user-id/2680 "2016-05-13T18:27:07Z")

</div>

Hi, I have setup a dsp in AWS and configured it to use forever sessions. I have an android app that communicates with the dsp application. All is well except sometimes, when creating records from the client, I get a ze…

---

## [How to migrate system table data to external database?](https://community.dreamfactory.com/t/how-to-migrate-system-table-data-to-external-database/2526)

<div class="topic-metadata">

**Author:** [@allensandiego](https://community.dreamfactory.com/u/allensandiego)\
**Replies:** 1\
**Last updated:** [April 18, 2016, 12:36pm UTC](https://community.dreamfactory.com/t/how-to-migrate-system-table-data-to-external-database/2526 "2016-04-18T12:36:42Z")

</div>

Hi, I currently have setup DF in AWS EC2. This includes a default MySQL database to store system data. I opted for an AWS RDS for my application data but now I want to store system data in this too. Is there a way to…

---

## [What is the quickest way to import thounsand records to a table?](https://community.dreamfactory.com/t/what-is-the-quickest-way-to-import-thounsand-records-to-a-table/2500)

<div class="topic-metadata">

**Author:** [@nampdn](https://community.dreamfactory.com/u/nampdn)\
**Replies:** 5\
**Last updated:** [April 11, 2016, 2:04pm UTC](https://community.dreamfactory.com/t/what-is-the-quickest-way-to-import-thounsand-records-to-a-table/2500 "2016-04-11T14:04:32Z")

</div>

I'm newbie in DreamFactory, I have created some schema tables, now I see that we can insert every line to our table. But what if I have thoundsand of record? I think there is a way to do this better.. (I have do some sea…

---

## [Restoring from mongodump](https://community.dreamfactory.com/t/restoring-from-mongodump/2490)

<div class="topic-metadata">

**Author:** [@m\_menon](https://community.dreamfactory.com/u/m_menon)\
**Replies:** 0\
**Last updated:** [April 6, 2016, 9:25am UTC](https://community.dreamfactory.com/t/restoring-from-mongodump/2490 "2016-04-06T09:25:44Z")

</div>

Is there a way to create a schema / table / collection from mongodump? I have a database / collection on mongolabs and wish to create a copy of that on DF local MongoDB. I have both the mongodump .bson & .json files T…

---

## [Externalise DF data for AWS autoscaling](https://community.dreamfactory.com/t/externalise-df-data-for-aws-autoscaling/2475)

<div class="topic-metadata">

**Author:** [@jnakouzi](https://community.dreamfactory.com/u/jnakouzi)\
**Replies:** 0\
**Last updated:** [April 4, 2016, 2:42pm UTC](https://community.dreamfactory.com/t/externalise-df-data-for-aws-autoscaling/2475 "2016-04-04T14:42:50Z")

</div>

I'm installing dreamfactory on an AWS instance. It's a part of an autoscaling group which also self heals by re-spawning any crashed instance. I want to make sure that all users created during the last run are still av…

---

## [MySQL Table Structure](https://community.dreamfactory.com/t/mysql-table-structure/2473)

<div class="topic-metadata">

**Author:** [@raviypujar](https://community.dreamfactory.com/u/raviypujar)\
**Replies:** 0\
**Last updated:** [April 4, 2016, 4:11am UTC](https://community.dreamfactory.com/t/mysql-table-structure/2473 "2016-04-04T04:11:55Z")

</div>

Hi, I am trying to create two tables route\_details, passenger\_details to contain data as below. I am not able to understand how the both data base schema should be. Passenger details is one more table which comes attac…

---

## [How to allow utf-8 unicode (utf8) storing on dreamfactory?](https://community.dreamfactory.com/t/how-to-allow-utf-8-unicode-utf8-storing-on-dreamfactory/672)

<div class="topic-metadata">

**Author:** [@khaled1](https://community.dreamfactory.com/u/khaled1)\
**Replies:** 7\
**Last updated:** [November 18, 2015, 5:32pm UTC](https://community.dreamfactory.com/t/how-to-allow-utf-8-unicode-utf8-storing-on-dreamfactory/672 "2015-11-18T17:32:21Z")

</div>

Any idea how can utf-8 unicode (utf8) storing be allowed on dreamfactory?

[Previous page](https://community.dreamfactory.com/c/schema-data/18.md)

[Next page](https://community.dreamfactory.com/c/schema-data/18.md?page=2)
