Skip to content

Instantly share code, notes, and snippets.

@gpherguson
Created August 19, 2014 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gpherguson/27c1819dcb78e9a33b9a to your computer and use it in GitHub Desktop.
Save gpherguson/27c1819dcb78e9a33b9a to your computer and use it in GitHub Desktop.
create_table(:pairs) do
primary_key :id
foreign_key :left_leaf_id, :leafs, :key => :id
foreign_key :right_leaf_id, :leafs, :key => :id
String :description
FalseClass :enabled
Time :created_at, :null => false, :index => true
Time :modified_at, :null => false, :index => true
# constraint(:pair_ids_unique, Sequel.function{pairs__left_leaf_id != pairs__right_leaf_id})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment