```sql CREATE TABLE user ( id TEXT NOT NULL PRIMARY KEY, username TEXT NOT NULL,

CREATE TABLE
    user (
        id TEXT NOT NULL PRIMARY KEY,
        username TEXT NOT NULL,
        email TEXT NOT NULL,
        password_hash TEXT NOT NULL,
        created_at INTEGER NOT NULL,
        updated_at INTEGER NOT NULL
    );

CREATE TABLE
    session (
        id TEXT NOT NULL PRIMARY KEY,
        expires_at INTEGER NOT NULL,
        user_id TEXT NOT NULL,
        FOREIGN KEY (user_id) REFERENCES user (id)
    );


i used the above schema and created users + sessions in my app. i then tried deleting both tables which wouldnt work. i had to delete the sessions table first and then the users.
would be nice if the error at least said which table caused the issue. πŸ˜…
Was this page helpful?