Does anyone know how to set a foreign key using the phpLiteAdmin interface? The docs for this application are lacking, and the recommended syntax for adding a column using SQLite does not appear to work. I'd like the id field from the users table to become the 'user_id' foreign key in my transactions table. Note, using the following create table statement left me with a bizarre error: ERROR: no such table: temp.users
even though the table was created and interacted with my flask website. Hence, I want to set the foreign key using the GUI interface now, if possible.
- CREATE TABLE 'transactions' ( 'tx_id' INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL, 'ticker' TEXT UNIQUE NOT NULL, 'security' TEXT UNIQUE NOT NULL, 'price' NUMERIC NOT NULL, 'shares' INTEGER NOT NULL, 'tx_type' INTEGER NOT NULL, 'date' DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, 'user_id' INTEGER NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id) );