mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	task: added table for requested approvers for CRs (#10159)
As part of the task to make it possible to send notifications to approvers for a CR, this PR adds a table that can link users to CRs they've been requested to make an approval for.
This commit is contained in:
		
							parent
							
								
									810890fe67
								
							
						
					
					
						commit
						ce8d49be10
					
				| @ -0,0 +1,19 @@ | ||||
| exports.up = function(db, cb) { | ||||
|   db.runSql(`CREATE TABLE change_request_requested_approvers(
 | ||||
|     change_request_id INTEGER REFERENCES change_requests(id) ON DELETE CASCADE, | ||||
|     user_id INTEGER REFERENCES users(id) ON DELETE CASCADE, | ||||
|     requested_at TIMESTAMP WITH TIME ZONE DEFAULT (now() at time zone 'utc'), | ||||
|     PRIMARY KEY (change_request_id, user_id) | ||||
|   ); | ||||
|   CREATE INDEX IF NOT EXISTS change_request_requested_approvers_cr_id_idx ON change_request_requested_approvers(change_request_id); | ||||
|   CREATE INDEX IF NOT EXISTS change_request_requested_approvers_user_id_idx ON change_request_requested_approvers(user_id); | ||||
|   `, cb)
 | ||||
| }; | ||||
| 
 | ||||
| exports.down = function(db, cb) { | ||||
|   db.runSql(`DROP TABLE IF EXISTS change_request_requested_approvers`, cb); | ||||
| }; | ||||
| 
 | ||||
| exports._meta = { | ||||
|   "version": 1 | ||||
| }; | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user