Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
domotikad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
domotika
domotikad
Commits
5a8332f6
Commit
5a8332f6
authored
Nov 03, 2013
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
triggers are in the primary sql file.
parent
b66b5400
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
36 deletions
+0
-36
70-trigger.sql
Databases/createdb/70-trigger.sql
+0
-36
No files found.
Databases/createdb/70-trigger.sql
deleted
100644 → 0
View file @
b66b5400
DELIMITER
$$
CREATE
TRIGGER
relstatus_lastchange
BEFORE
UPDATE
ON
relstatus
FOR
EACH
ROW
BEGIN
IF
NEW
.
status
<>
OLD
.
status
OR
NEW
.
ampere
<>
OLD
.
ampere
THEN
SET
NEW
.
lastchange
=
NEW
.
lastupdate
;
END
IF
;
END
$$
CREATE
TRIGGER
inpstatus_lastchange
BEFORE
UPDATE
ON
inpstatus
FOR
EACH
ROW
BEGIN
IF
NEW
.
status
<>
OLD
.
status
THEN
SET
NEW
.
lastchange
=
NEW
.
lastupdate
;
END
IF
;
END
$$
CREATE
TRIGGER
anastatus_lastchange
BEFORE
UPDATE
ON
anastatus
FOR
EACH
ROW
BEGIN
IF
NEW
.
status
<>
OLD
.
status
THEN
SET
NEW
.
lastchange
=
NEW
.
lastupdate
;
END
IF
;
END
$$
CREATE
TRIGGER
actstatus_lastchange
BEFORE
UPDATE
ON
actstatus
FOR
EACH
ROW
BEGIN
IF
NEW
.
status
<>
OLD
.
status
OR
NEW
.
status2
<>
OLD
.
status2
THEN
SET
NEW
.
lastchange
=
NEW
.
lastupdate
;
END
IF
;
END
$$
DELIMITER
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment