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

Exported SQLite Script FKs does not work #39

Open
guneysus opened this issue Jul 7, 2016 · 0 comments
Open

Exported SQLite Script FKs does not work #39

guneysus opened this issue Jul 7, 2016 · 0 comments

Comments

@guneysus
Copy link

guneysus commented Jul 7, 2016

OS: Microsoft Windows [Version 10.0.14372]
SQLite Version: 3.10.1 2016-01-13 21:41:56 254419c36766225ca542ae873ed38255e3fb8588

I had to manually edit FK sections of exported Sqlite script since it throws syntax error.

  • I splitted Column and FK definitions
  • Moved FK definitions to last lines of table definitions.

Uploaded buggy and fixed scripts as a Gist , Download as Zip with

  • Import scripts (bat and shell scripts)
  • Original and fixed sql scripts
  • With a simple diff file

Example:

I fixed manually changing this section:

CREATE TABLE "Led" (
    "id" int PRIMARY KEY,
    "oda_id" int FOREIGN KEY("oda_id") REFERENCES "Oda" ("id"),
    "status_id" int FOREIGN KEY("status_id") REFERENCES "Status" ("id")
);

To:

CREATE TABLE "Led" (
    "id" int PRIMARY KEY,
    "oda_id" int, 
    "status_id" int,
    FOREIGN KEY("oda_id") REFERENCES "Oda" ("id"),
    FOREIGN KEY("status_id") REFERENCES "Status" ("id")
);
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

1 participant