File tree 2 files changed +37
-0
lines changed
2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ exports . up = function ( knex , Promise ) {
3
+ return knex . schema . createTable ( 'links' , function ( t ) {
4
+ t . increments ( 'id' ) . unsigned ( ) . primary ( ) ;
5
+ t . datetime ( 'createdAt' ) . notNull ( ) ;
6
+ t . datetime ( 'updatedAt' ) . nullable ( ) ;
7
+ t . datetime ( 'deletedAt' ) . nullable ( ) ;
8
+
9
+ t . string ( 'label' ) . notNull ( ) ;
10
+ t . string ( 'url' ) . notNull ( ) ;
11
+
12
+ t . integer ( 'order' ) . notNull ( ) ;
13
+ t . integer ( 'userId' ) . notNull ( ) . references ( 'id' ) . inTable ( 'users' ) . onDelete ( 'CASCADE' ) ;
14
+ } ) ;
15
+ } ;
16
+
17
+ exports . down = function ( knex , Promise ) {
18
+ return knex . schema . dropTable ( 'links' ) ;
19
+ } ;
Original file line number Diff line number Diff line change
1
+
2
+ exports . up = function ( knex , Promise ) {
3
+ return knex . schema . createTable ( 'images' , function ( t ) {
4
+ t . increments ( 'id' ) . unsigned ( ) . primary ( ) ;
5
+ t . datetime ( 'createdAt' ) . notNull ( ) ;
6
+ t . datetime ( 'updatedAt' ) . nullable ( ) ;
7
+ t . datetime ( 'deletedAt' ) . nullable ( ) ;
8
+
9
+ t . string ( 'originalFileName' ) . notNull ( ) ;
10
+ t . string ( 'original' ) . notNull ( ) ;
11
+ t . string ( 'medium' ) . nullable ( ) ;
12
+ t . string ( 'small' ) . nullable ( ) ;
13
+ } ) ;
14
+ } ;
15
+
16
+ exports . down = function ( knex , Promise ) {
17
+ return knex . schema . dropTable ( 'images' ) ;
18
+ } ;
You can’t perform that action at this time.
0 commit comments