File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,113 +5,136 @@ var type;
55var seed ;
66
77/**
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 ;
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 ;
1515} ;
1616
17- exports . up = function ( db , callback ) {
18- db . createTable ( 'entries' , {
19- id : {
20- type : 'int' ,
21- unsigned : true ,
22- notNull : true ,
23- primaryKey : true ,
24- autoIncrement : true ,
25- length : 11
26- } ,
27- firstname : {
28- type : 'string' ,
29- length : 255 ,
30- notNull : true ,
31- } ,
32- lastname : {
33- type : 'string' ,
34- length : 255 ,
35- defaultValue : null ,
36- } ,
37- email : {
38- type : 'string' ,
39- length : 320 ,
40- notNull : true ,
41- } ,
42- country : {
43- type : 'char' ,
44- length : 2 ,
45- defaultValue : null ,
46- } ,
47- message : {
48- type : 'text' ,
49- notNull : true ,
50- } ,
51- anon : {
52- type : 'int' ,
53- length : 1 ,
54- defaultValue : 0 ,
55- } ,
56- ipv4 : {
57- type : 'string' ,
58- length : 40 ,
59- defaultValue : null ,
60- } ,
61- image : {
62- type : 'string' ,
63- length : 255 ,
64- defaultValue : null ,
65- } ,
66- created_at : {
67- type : 'string' ,
68- length : 15 ,
69- defaultValue : null ,
70- } ,
71- updated_at : {
72- type : 'string' ,
73- length : 15 ,
74- defaultValue : null ,
75- } ,
76- confirm_key : {
77- type : 'string' ,
78- length : 75 ,
79- defaultValue : null ,
80- } ,
81- beta : {
82- type : 'int' ,
83- length : 1 ,
84- defaultValue : 0 ,
85- } ,
86- newsletter : {
87- type : 'int' ,
88- length : 1 ,
89- defaultValue : 0 ,
90- } ,
91- pax : {
92- type : 'int' ,
93- length : 1 ,
94- defaultValue : 0 ,
95- } ,
96- email_confirmed : {
97- type : 'int' ,
98- length : 1 ,
99- defaultValue : 0 ,
100- } ,
101- status : {
102- type : 'int' ,
103- length : 1 ,
104- defaultValue : 0 ,
105- } ,
106- } , function ( err ) {
107- if ( err ) return callback ( err ) ;
108- return callback ( ) ;
109- } ) ;
17+ exports . up = function ( db , callback ) {
18+ db . createTable ( 'entries' , {
19+ id : {
20+ type : 'bigint' ,
21+ unsigned : true ,
22+ notNull : true ,
23+ primaryKey : true ,
24+ autoIncrement : true ,
25+ unique : true ,
26+ length : 20
27+ } ,
28+ email : {
29+ type : 'string' ,
30+ length : 255 ,
31+ notNull : true ,
32+ } ,
33+ firstname : {
34+ type : 'string' ,
35+ length : 255 ,
36+ notNull : true ,
37+ } ,
38+ lastname : {
39+ type : 'string' ,
40+ length : 255 ,
41+ defaultValue : null ,
42+ } ,
43+ message : {
44+ type : 'text' ,
45+ notNull : true ,
46+ } ,
47+ country : {
48+ type : 'string' ,
49+ length : 4 ,
50+ defaultValue : null ,
51+ } ,
52+ image : {
53+ type : 'string' ,
54+ length : 255 ,
55+ notNull : true ,
56+ } ,
57+ ipv4 : {
58+ type : 'string' ,
59+ length : 30 ,
60+ defaultValue : null ,
61+ } ,
62+ ipv6 : {
63+ type : 'string' ,
64+ length : 60 ,
65+ defaultValue : null ,
66+ } ,
67+ email_confirmed : {
68+ type : 'smallint' ,
69+ length : 1 ,
70+ unsigned : true ,
71+ notNull : true ,
72+ defaultValue : '0' ,
73+ } ,
74+ confirm_key : {
75+ type : 'string' ,
76+ length : 255 ,
77+ defaultValue : null ,
78+ } ,
79+ status : {
80+ type : 'smallint' ,
81+ length : 1 ,
82+ unsigned : true ,
83+ notNull : true ,
84+ defaultValue : '0' ,
85+ } ,
86+ anon : {
87+ type : 'smallint' ,
88+ length : 1 ,
89+ unsigned : true ,
90+ notNull : true ,
91+ defaultValue : '0' ,
92+ } ,
93+ created_at : {
94+ type : 'bigint' ,
95+ length : 20 ,
96+ unsigned : true ,
97+ defaultValue : null ,
98+ } ,
99+ updated_at : {
100+ type : 'bigint' ,
101+ length : 20 ,
102+ unsigned : true ,
103+ defaultValue : null ,
104+ } ,
105+ confirmed_at : {
106+ type : 'bigint' ,
107+ length : 20 ,
108+ unsigned : true ,
109+ defaultValue : null ,
110+ } ,
111+ beta : {
112+ type : 'smallint' ,
113+ length : 1 ,
114+ notNull : true ,
115+ defaultValue : '0' ,
116+ } ,
117+ newsletter : {
118+ type : 'smallint' ,
119+ length : 1 ,
120+ notNull : true ,
121+ defaultValue : '0' ,
122+ } ,
123+ pax : {
124+ type : 'smallint' ,
125+ length : 1 ,
126+ notNull : true ,
127+ defaultValue : '0' ,
128+ } ,
129+ } , function ( err ) {
130+ if ( err ) return callback ( err ) ;
131+ return callback ( ) ;
132+ } ) ;
110133} ;
111- exports . down = function ( db , callback ) {
112- db . dropTable ( 'entries' , callback ) ;
134+ exports . down = function ( db , callback ) {
135+ db . dropTable ( 'entries' , callback ) ;
113136} ;
114137
115138exports . _meta = {
116- " version" : 1
139+ ' version' : 1
117140} ;
Original file line number Diff line number Diff line change @@ -5,37 +5,64 @@ var type;
55var seed ;
66
77/**
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 ;
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 ;
1515} ;
1616
17- exports . up = function ( db , callback ) {
18- db . createTable ( 'apikeys' , {
19- secret : {
20- type : 'string' ,
21- length : 100 ,
22- unique : true ,
23- notNull : true ,
24- } ,
25- valid : {
26- type : 'int' ,
27- length : 1 ,
28- default : 0
29- } ,
30- } , function ( err ) {
31- if ( err ) return callback ( err ) ;
32- return callback ( ) ;
33- } ) ;
17+ exports . up = function ( db , callback ) {
18+ db . createTable ( 'apikeys' , {
19+ id : {
20+ type : 'bigint' ,
21+ unsigned : true ,
22+ notNull : true ,
23+ primaryKey : true ,
24+ autoIncrement : true ,
25+ length : 64
26+ } ,
27+ secret : {
28+ type : 'string' ,
29+ length : 64 ,
30+ unique : true ,
31+ notNull : true ,
32+ } ,
33+ valid : {
34+ type : 'smallint' ,
35+ length : 1 ,
36+ unsigned : true ,
37+ notNull : true ,
38+ defaultValue : '0'
39+ } ,
40+ expire_at : {
41+ type : 'bigint' ,
42+ length : 64 ,
43+ notNull : true ,
44+ } ,
45+ created_at : {
46+ type : 'bigint' ,
47+ length : 64 ,
48+ unsigned : true ,
49+ notNull : true ,
50+ } ,
51+ updated_at : {
52+ type : 'bigint' ,
53+ length : 64 ,
54+ unsigned : true ,
55+ notNull : true ,
56+ } ,
57+ } , function ( err ) {
58+ if ( err ) return callback ( err ) ;
59+ return callback ( ) ;
60+ } ) ;
3461} ;
35- exports . down = function ( db , callback ) {
36- db . dropTable ( 'apikeys' , callback ) ;
62+ exports . down = function ( db , callback ) {
63+ db . dropTable ( 'apikeys' , callback ) ;
3764} ;
3865
3966exports . _meta = {
40- " version" : 1
67+ ' version' : 1
4168} ;
You can’t perform that action at this time.
0 commit comments