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

sqlite CURRENT_DATE default gets inserted as a string #402

Closed
tonyeung opened this issue Mar 29, 2012 · 3 comments
Closed

sqlite CURRENT_DATE default gets inserted as a string #402

tonyeung opened this issue Mar 29, 2012 · 3 comments
Labels

Comments

@tonyeung
Copy link

Simple insert with a current_date default value in the pragma makes lithium generate this sql command below:

INSERT INTO "RecordHeaders" ("entryDate", "version","userID", "providerID") 
VALUES ('CURRENT_DATE', '1', '1', 'abc123');

the pragma:

CREATE TABLE "RecordHeaders" (
    "id" INTEGER PRIMARY KEY  NOT NULL ,
    "entryDate" DATETIME NOT NULL  DEFAULT (CURRENT_DATE) ,
    "version" INTEGER NOT NULL  DEFAULT (1) ,
    "providerID" TEXT NOT NULL, 
    "userID" INTEGER NOT NULL 
)
@greut
Copy link
Contributor

greut commented Mar 29, 2012

Please show us your PHP code or try writing a test that shows this. thanks!

@jails
Copy link
Contributor

jails commented May 25, 2012

This issue seems to be similar to #28. Maybe we can kill two birds with one stone.

@nateabele
Copy link
Member

Fixed in #492. See there for new syntax.

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

No branches or pull requests

4 participants