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,
) RETURNS int(11)
NO SQL
BEGIN
DECLARE temp INT;
DECLARE vtemp INT;
IF NOT InternalIsTeacherAuthor(AuthorID, DisciplineID) THEN
RETURN -1;
END IF;
SELECT disciplines.isLocked
INTO vtemp
FROM `disciplines`
INTO temp
WHERE disciplines.ID = DisciplineID
LIMIT 1;
IF temp != 0 THEN
IF vtemp != 0 THEN
RETURN -1;
END IF;
SET temp = CountRatings(AuthorID, DisciplineID);
IF temp >= 0 THEN
RETURN temp;
SET vtemp = CountRatings(AuthorID, DisciplineID);
IF vtemp >= 0 THEN
RETURN vtemp;
END IF;
......@@ -3525,7 +3525,7 @@ BEGIN
END //
DROP FUNCTION IF EXISTS RequestDelegateDiscipline//
DROP FUNCTION IF EXISTS RequestDeleteDiscipline//
CREATE FUNCTION `RequestDeleteDiscipline` ( `AuthorID` INT,
`DisciplineID` INT
) RETURNS int(11)
......
......@@ -300,10 +300,9 @@ CREATE TABLE IF NOT EXISTS `requests` (
`Data` text NULL DEFAULT NULL,
`DataExt` text NULL DEFAULT NULL,
`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',
PRIMARY KEY (`ID`),
KEY `AccountID` (`AccountID`)
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `requests_old` (
......@@ -316,10 +315,9 @@ CREATE TABLE IF NOT EXISTS `requests_old` (
`Data` text NULL DEFAULT NULL,
`DataExt` text NULL DEFAULT NULL,
`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',
PRIMARY KEY (`ID`),
KEY `AccountID` (`AccountID`)
PRIMARY KEY (`ID`)
) 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