File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ var dbm ;
4+ var type ;
5+ var seed ;
6+
7+ /**
8+ * We receive the dbmigrate dependency from dbmigrate initially.
9+ * This enables us to not have to rely on NODE_PATH.
10+ */
11+ exports . setup = function ( options , seedLink ) {
12+ dbm = options . dbmigrate ;
13+ type = dbm . dataType ;
14+ seed = seedLink ;
15+ } ;
16+
17+ exports . up = function ( db , callback ) {
18+ db . runSql (
19+ `CREATE TRIGGER
20+ settings_last_updated
21+ BEFORE UPDATE ON
22+ settings
23+ FOR EACH ROW EXECUTE PROCEDURE
24+ sync_lastmod();
25+
26+ CREATE TRIGGER
27+ searches_last_updated
28+ BEFORE UPDATE ON
29+ searches
30+ FOR EACH ROW EXECUTE PROCEDURE
31+ sync_lastmod();
32+ ` ,
33+ callback ,
34+ ) ;
35+ } ;
36+
37+ exports . down = function ( db , callback ) {
38+ db . runSql (
39+ `DROP TRIGGER IF EXISTS settings_last_updated ON settings;
40+
41+ DROP TRIGGER IF EXISTS searches_last_updated ON searches;
42+ ` ,
43+ callback ,
44+ ) ;
45+ } ;
46+
47+ exports . _meta = {
48+ version : 1 ,
49+ } ;
You can’t perform that action at this time.
0 commit comments