Skip to content

Commit

Permalink
Fix README
Browse files Browse the repository at this point in the history
  • Loading branch information
Genki Sugawara committed Sep 23, 2014
1 parent 3b92ed9 commit 6d586cc
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions README.md
Expand Up @@ -118,7 +118,7 @@ Apply `Schemafile`
```

## Rename
```sh
```ruby
create_table "articles", force: true do |t|
t.string "title"
t.text "desc", renamed_from: "text"
Expand All @@ -136,8 +136,26 @@ create_table "user_comments", force: true, renamed_from: "comments" do |t|
end
```

## Foreign Key
You can use the foreign key by passing `--enable-foreigner` ([foreigner](https://github.com/matthuhiggins/foreigner) is required)

```ruby
create_table "parent", force: true do |t|
end

create_table "child", id: false, force: true do |t|
t.integer "id"
t.integer "parent_id"
end

add_index "child", ["parent_id"], name: "par_ind", using: :btree

add_foreign_key "child", "parent", name: "child_ibfk_1", dependent: :delete
```


## Execute
```sh
```ruby
create_table "authors", force: true do |t|
t.string "name", null: false
end
Expand Down

0 comments on commit 6d586cc

Please sign in to comment.