This repository has been archived by the owner on Aug 5, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add more migration functions/options #76
- Loading branch information
1 parent
38d6d4d
commit d288cc3
Showing
7 changed files
with
137 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/fixtures/migrations/20181003115058_create_table_with_comments.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = function() { | ||
this.createTable('with_comments', function() { | ||
this.createTable('with_comments', {comment: 'foobar table'}, function() { | ||
this.integer('foo', { comment: 'foobar' }) | ||
}) | ||
} |
5 changes: 5 additions & 0 deletions
5
test/fixtures/migrations/20181003144711_create_table_with_references.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = function() { | ||
this.createTable('with_references', function() { | ||
this.integer('post_id', { references: 'posts.id', unsigned: true }) | ||
}) | ||
} |
8 changes: 8 additions & 0 deletions
8
test/fixtures/migrations/20181003151428_create_table_with_indices.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = function() { | ||
this.createTable('with_indices', function() { | ||
this.integer('foo', { unique: true }) | ||
this.integer('bar') | ||
}) | ||
|
||
this.createIndex('with_indices', 'bar') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters