Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I'm a little wary of hard-coding the order of migrations like this, but it was easier than redoing them by hand, I guess.
- Loading branch information
pletcher
committed
Jul 31, 2017
1 parent
eaffa2d
commit 5d0f8a9
Showing
8 changed files
with
188 additions
and
49 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
File renamed without changes.
7 changes: 3 additions & 4 deletions
7
db/migrate/20170728022930_create_authors.rb → db/migrate/2_create_authors.rb
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,14 +1,13 @@ | ||
class CreateAuthors < ActiveRecord::Migration[5.1] | ||
def change | ||
create_table :authors do |t| | ||
t.string :language, null: false | ||
t.string :englishname | ||
t.string :originalname, null: false | ||
# references language, see language migration | ||
t.string :name, null: false | ||
t.string :slug, null: false | ||
|
||
t.timestamps | ||
end | ||
|
||
add_index :authors, :slug, unique: true | ||
add_reference :authors, :language, foreign_key: true | ||
end | ||
end |
3 changes: 1 addition & 2 deletions
3
db/migrate/20170728024437_create_corpora.rb → db/migrate/3_create_corpora.rb
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,14 +1,13 @@ | ||
class CreateCorpora < ActiveRecord::Migration[5.1] | ||
def change | ||
create_table :corpora do |t| | ||
t.string :language, null: false | ||
t.string :link | ||
t.string :slug, null: false | ||
t.string :title, null: false | ||
|
||
t.timestamps | ||
end | ||
|
||
add_index :corpora, :slug, unique: true | ||
add_reference :corpora, :language, foreign_key: true | ||
end | ||
end |
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
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