Skip to content
Snippets Groups Projects
Commit 03453e9d authored by PavelBegunkov's avatar PavelBegunkov
Browse files

fix

parent 9fbb68e2
No related merge requests found
...@@ -2639,24 +2639,24 @@ CREATE FUNCTION `DeleteDiscipline` ( `AuthorID` INT, ...@@ -2639,24 +2639,24 @@ CREATE FUNCTION `DeleteDiscipline` ( `AuthorID` INT,
) RETURNS int(11) ) RETURNS int(11)
NO SQL NO SQL
BEGIN BEGIN
DECLARE temp INT; DECLARE vtemp INT;
IF NOT InternalIsTeacherAuthor(AuthorID, DisciplineID) THEN IF NOT InternalIsTeacherAuthor(AuthorID, DisciplineID) THEN
RETURN -1; RETURN -1;
END IF; END IF;
SELECT disciplines.isLocked SELECT disciplines.isLocked
INTO vtemp
FROM `disciplines` FROM `disciplines`
INTO temp
WHERE disciplines.ID = DisciplineID WHERE disciplines.ID = DisciplineID
LIMIT 1; LIMIT 1;
IF temp != 0 THEN IF vtemp != 0 THEN
RETURN -1; RETURN -1;
END IF; END IF;
SET temp = CountRatings(AuthorID, DisciplineID); SET vtemp = CountRatings(AuthorID, DisciplineID);
IF temp >= 0 THEN IF vtemp >= 0 THEN
RETURN temp; RETURN vtemp;
END IF; END IF;
...@@ -3525,7 +3525,7 @@ BEGIN ...@@ -3525,7 +3525,7 @@ BEGIN
END // END //
DROP FUNCTION IF EXISTS RequestDelegateDiscipline// DROP FUNCTION IF EXISTS RequestDeleteDiscipline//
CREATE FUNCTION `RequestDeleteDiscipline` ( `AuthorID` INT, CREATE FUNCTION `RequestDeleteDiscipline` ( `AuthorID` INT,
`DisciplineID` INT `DisciplineID` INT
) RETURNS int(11) ) RETURNS int(11)
......
...@@ -300,10 +300,9 @@ CREATE TABLE IF NOT EXISTS `requests` ( ...@@ -300,10 +300,9 @@ CREATE TABLE IF NOT EXISTS `requests` (
`Data` text NULL DEFAULT NULL, `Data` text NULL DEFAULT NULL,
`DataExt` text NULL DEFAULT NULL, `DataExt` text NULL DEFAULT NULL,
`Date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `Date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`Type` enum('delegate_discipline','delete_discipline','clear_discipline','report') `Type` enum('delegate_discipline','delete_discipline','clear_discipline','report') NOT NULL,
`Status` enum('opened','processed','closed') NOT NULL DEFAULT 'opened', `Status` enum('opened','processed','closed') NOT NULL DEFAULT 'opened',
PRIMARY KEY (`ID`), PRIMARY KEY (`ID`)
KEY `AccountID` (`AccountID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `requests_old` ( CREATE TABLE IF NOT EXISTS `requests_old` (
...@@ -316,10 +315,9 @@ CREATE TABLE IF NOT EXISTS `requests_old` ( ...@@ -316,10 +315,9 @@ CREATE TABLE IF NOT EXISTS `requests_old` (
`Data` text NULL DEFAULT NULL, `Data` text NULL DEFAULT NULL,
`DataExt` text NULL DEFAULT NULL, `DataExt` text NULL DEFAULT NULL,
`Date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `Date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`Type` enum('delegate_discipline','delete_discipline','clear_discipline','report') `Type` enum('delegate_discipline','delete_discipline','clear_discipline','report') NOT NULL,
`Status` enum('opened','processed','closed') NOT NULL DEFAULT 'opened', `Status` enum('opened','processed','closed') NOT NULL DEFAULT 'opened',
PRIMARY KEY (`ID`), PRIMARY KEY (`ID`)
KEY `AccountID` (`AccountID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- -------------------------------------------------------- -- --------------------------------------------------------
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment