· 5 years ago · May 05, 2020, 03:40 PM
1DROP TABLE IF EXISTS product_authorisation_request;
2CREATE TABLE product_authorisation_request (
3 id INT(11) NOT NULL AUTO_INCREMENT,
4 is_deleted TINYINT(1) NOT NULL,
5 created DATETIME NOT NULL,
6 created_by_user_id INT(11) DEFAULT NULL,
7 updated DATETIME NOT NULL,
8 updated_by_user_id INT(11) NOT NULL,
9 request_type_id int(11),
10 customer_id int(11) NOT NULL,
11 product_original_id int(11) NOT NULL,
12 authoriser_contact_id int(11) NOT NULL,
13 request_description VARCHAR(500),
14 request_result VARCHAR(8) DEFAULT 'pending',
15 PRIMARY KEY (id),
16 FOREIGN KEY (customer_id) REFERENCES orgs(id),
17 FOREIGN KEY (request_type_id) REFERENCES request_types(id),
18 FOREIGN KEY (product_original_id) REFERENCES products(id),
19 FOREIGN KEY (authoriser_contact_id) REFERENCES contacts(id)
20);
21
22INSERT INTO request_types
23(`status`, `created`, `created_by`, `name`)
24VALUES
25(1, NOW(), 1, "Add to favourites");
26
27INSERT INTO request_types
28(`status`, `created`, `created_by`, `name`)
29VALUES
30(1, NOW(), 1, "One off order");