Sql schema now has requested_by as a foreign key for user_name and on delete set null clause.
This commit is contained in:
@@ -36,12 +36,13 @@ CREATE TABLE IF NOT EXISTS requests(
|
|||||||
year NUMBER,
|
year NUMBER,
|
||||||
poster_path TEXT DEFAULT NULL,
|
poster_path TEXT DEFAULT NULL,
|
||||||
background_path TEXT DEFAULT NULL,
|
background_path TEXT DEFAULT NULL,
|
||||||
requested_by TEXT,
|
requested_by varchar(127) DEFAULT NULL,
|
||||||
ip TEXT,
|
ip TEXT,
|
||||||
date DATE DEFAULT CURRENT_TIMESTAMP,
|
date DATE DEFAULT CURRENT_TIMESTAMP,
|
||||||
status CHAR(25) DEFAULT 'requested' NOT NULL,
|
status CHAR(25) DEFAULT 'requested' NOT NULL,
|
||||||
user_agent CHAR(255) DEFAULT NULL,
|
user_agent CHAR(255) DEFAULT NULL,
|
||||||
type CHAR(50) DEFAULT 'movie'
|
type CHAR(50) DEFAULT 'movie',
|
||||||
|
foreign key(requested_by) REFERENCES user(user_name) ON DELETE SET NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS request(
|
CREATE TABLE IF NOT EXISTS request(
|
||||||
|
|||||||
Reference in New Issue
Block a user