Skip to content

Instantly share code, notes, and snippets.

@mathie
Created April 22, 2016 05:15
Show Gist options
  • Save mathie/d8fb7cd1acbe235bee8489d089a64f8d to your computer and use it in GitHub Desktop.
Save mathie/d8fb7cd1acbe235bee8489d089a64f8d to your computer and use it in GitHub Desktop.
Let’s start with the migration...
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