Skip to content

Exported SQLite Script FKs does not work #39

@guneysus

Description

@guneysus

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")
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions