elixir-lang/ecto — pull request #132 by joshnuss (2013-12-13 00:15:50+00:00)
Title: WIP: Migration DSL

Started on a migration DSL.

Here's an example of what works so far:

```elixir
def up do
create_table :products, fn t ->
t.string :name
t.decimal :price

t.timestamps
end
end

def down do
drop_table :products
end
```

The DSL functions build up an AST, intended to be passed to the adapter.
The adapter would be responsible for generating the DDL in the dialect the DB expects.

### TODO

- [x] table functions (create_table, drop_table)
- [x] column functions (string, boolean, timestamps etc..)
- [ ] index functions (create_index, drop_index)
- [ ] alter functions (add_column, remove_column, change_column)
- [ ] execute() function
- [ ] existence functions (column_exists?, table_exists?, index_exists?)
- [ ] adapter specific DDL generator
- [ ] support string-based migrations by checking return value?