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

User defined primary keys in sqlite3 table #47

Open
GINUGEORGE opened this issue May 21, 2015 · 3 comments
Open

User defined primary keys in sqlite3 table #47

GINUGEORGE opened this issue May 21, 2015 · 3 comments

Comments

@GINUGEORGE
Copy link

I am creating a cloud application. The application involves maintaining a database and so i have designed a table with the following schema :

create table connectioninfo
(
device_id integer primary key,
date_updated integer not null, unique(device_id)
);

The database used is sqlite3 and I am using caminte for performing database related operations. When I am trying to insert or update a record in the table, I am getting the following error :

{ [Error: SQLITE_ERROR: table connectioninfo has no column named id] errno: 1, code: 'SQLITE_ERROR' }

I don't have any field with name 'id' . Is it necessary to have a field with the name 'id' in each table ? Can't I have user defined auto increment primary keys ? If so, how ?

@huttj
Copy link
Contributor

huttj commented Jun 14, 2015

I am pretty sure caminte creates an id column for you.

You might need to migrate your schema.

@thibautrey
Copy link

I confirm Caminte creates an id column automatically

@guilhermeKodama
Copy link

i am having the same problem on postgresql. I can not save the object because i dont have an id column. Nothing is being done automatically.

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

4 participants