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 . removeColumn (
19+ 'entries' ,
20+ 'ipv4' ,
21+ function ( err ) {
22+ if ( err ) return callback ( err ) ;
23+ return callback ( ) ;
24+ } ) ;
25+ db . removeColumn (
26+ 'entries' ,
27+ 'ipv6' ,
28+ function ( err ) {
29+ if ( err ) return callback ( err ) ;
30+ return callback ( ) ;
31+ } ) ;
32+ } ;
33+
34+ exports . down = function ( db , callback ) {
35+ db . addColumn (
36+ 'entries' ,
37+ 'ipv4' ,
38+ {
39+ type : 'string' ,
40+ length : 30 ,
41+ defaultValue : null ,
42+ } ,
43+ function ( err ) {
44+ if ( err ) return callback ( err ) ;
45+ return callback ( ) ;
46+ } ) ;
47+ db . addColumn (
48+ 'entries' ,
49+ 'ipv6' ,
50+ {
51+ type : 'string' ,
52+ length : 60 ,
53+ defaultValue : null ,
54+ } ,
55+ function ( err ) {
56+ if ( err ) return callback ( err ) ;
57+ return callback ( ) ;
58+ } ) ;
59+ } ;
60+
61+ exports . _meta = {
62+ 'version' : 1
63+ } ;
You can’t perform that action at this time.
0 commit comments