0
Completed

It *looks* like you do not support SQLite foreign keys constraints in your models. However, according to this page, they are supported: https://sqlite.org/foreignkeys.html

Claudius Iacob 3 years ago updated by Michał Kołodziejski 3 years ago 1

It *looks* like you do not support SQLite foreign keys constraints in your models. However, according to this page, they are supported: https://sqlite.org/foreignkeys.html


If I'm missing something, please forgive me (and point me in the right direction).


Thank you,

Claudius Iacob  

GOOD, I'M SATISFIED
Satisfaction mark by Claudius Iacob 3 years ago
Completed

We do support foreign keys for SQLite models.

From such model:



this SQL code is generated:

-- Table: a
CREATE TABLE a (
    id integer NOT NULL CONSTRAINT a_pk PRIMARY KEY
); -- Table: b
CREATE TABLE b (
    id integer NOT NULL CONSTRAINT b_pk PRIMARY KEY,
    a_id integer NOT NULL,
    CONSTRAINT b_a FOREIGN KEY (a_id)
    REFERENCES a (id)
);

As you can see, there's a FOREIGN KEY code.

Is this what you were looking for?