~emersion/sinwon

85e5c2632764f3fdacbf53d1fd8d8088abb2302a — Simon Ser 6 months ago 619a38a master
Cascade deletes in DB schema
1 files changed, 5 insertions(+), 5 deletions(-)

M schema.sql
M schema.sql => schema.sql +5 -5
@@ 9,7 9,7 @@ CREATE TABLE Client (
	id INTEGER PRIMARY KEY,
	client_id TEXT NOT NULL UNIQUE,
	client_secret_hash BLOB,
	owner INTEGER REFERENCES User(id),
	owner INTEGER REFERENCES User(id) ON DELETE CASCADE,
	redirect_uris TEXT,
	client_name TEXT,
	client_uri TEXT


@@ 18,8 18,8 @@ CREATE TABLE Client (
CREATE TABLE AccessToken (
	id INTEGER PRIMARY KEY,
	hash BLOB NOT NULL UNIQUE,
	user INTEGER NOT NULL REFERENCES User(id),
	client INTEGER REFERENCES Client(id),
	user INTEGER NOT NULL REFERENCES User(id) ON DELETE CASCADE,
	client INTEGER REFERENCES Client(id) ON DELETE CASCADE,
	scope TEXT,
	issued_at datetime NOT NULL,
	expires_at datetime NOT NULL,


@@ 31,8 31,8 @@ CREATE TABLE AuthCode (
	id INTEGER PRIMARY KEY,
	hash BLOB NOT NULL UNIQUE,
	created_at datetime NOT NULL,
	user INTEGER NOT NULL REFERENCES User(id),
	client INTEGER NOT NULL REFERENCES Client(id),
	user INTEGER NOT NULL REFERENCES User(id) ON DELETE CASCADE,
	client INTEGER NOT NULL REFERENCES Client(id) ON DELETE CASCADE,
	redirect_uri TEXT,
	scope TEXT
);