Created
April 22, 2016 05:15
-
-
Save mathie/d8fb7cd1acbe235bee8489d089a64f8d to your computer and use it in GitHub Desktop.
Let’s start with the migration...
This file contains hidden or 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
class CreateNodes < ActiveRecord::Migration | |
def change | |
create_table :nodes do |t| | |
t.string :name, null: false | |
t.integer :path, null: false, array: true, default: [] | |
t.timestamps null: false | |
end | |
add_index :nodes, :path, using: 'gin' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment