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

Improve support for PDO Sqlite migrations #639

Merged
merged 3 commits into from
Mar 30, 2016

Conversation

basilfx
Copy link
Contributor

@basilfx basilfx commented Mar 30, 2016

I know PDO SQLite migrations are not fully working (due to ALTER table limitations), but the following three commits should at least improve support for running migrations (I successfully converted structure from MySQL to SQLite).

Example of issue the last commit fixes (note the file name is used as schema in the CREATE TABLE statement):

1459346099.167: CREATE TABLE "/opt/backend/app/../data/df.db"."projects" (  `ID` INTEGER NOT NULL,  `name` VARCHAR(128) NOT NULL,  `userID` INTEGER NOT NULL,  `defaultQuestionID` INTEGER,  `access` VARCHAR(512),  `metadata` TEXT NOT NULL,  `created` DATETIME NOT NULL,  `modified` DATETIME,  `deleted` DATETIME,  PRIMARY KEY ("ID"),  CONSTRAINT `projects_ibfk_1` FOREIGN KEY ("userID") REFERENCES `users`("ID"),  CONSTRAINT `projects_ibfk_2` FOREIGN KEY ("defaultQuestionID") REFERENCES `questions`("ID") )PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 unknown database "/opt/backend/app/../data/df.db"' in /opt/backend/vendor/phalcon/devtools/scripts/Phalcon/Mvc/Model/Migration.php:663

I have also a patch ready that converts the missing column types for SQLite (Blob, Double, etc). I'll contribute this to CPhalcon.

@sergeyklay
Copy link
Contributor

Thanks 👍

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

Successfully merging this pull request may close these issues.

2 participants