Commit Graph

71 Commits

Author SHA1 Message Date
Luke Steensen
a2d8041737 [ci skip] remove guide section on models in migrations
Both examples given are incorrect, and no one can seem to come up with
a realistic situation where this is an actual problem. For now, it seems like
the best thing to do is just scrap the section altogether.
2014-02-26 08:35:06 -06:00
Logan Hasson
e9bfa28b1a [ci skip] Add missing 'task' to note on Running Migrations 2014-02-04 11:43:26 -05:00
Taryn East
e2c17cfb2b [ci skip] Describe precision + scale in migrations
Telling somebody that "precision sets the precision" is not very helpful.
Newbies want to know what precision is *for*, likewise with scale.

So I've added a very brief description for each.
2013-12-20 08:55:13 +11:00
Yves Senn
49245f37f7 Revert "remove_column does not take a type argument. [ci skip]. Closes #12864"
As of Rails 4.0 `remove_column` is no longer an alias for `remove_columns`.
The type is actually valid and used when issuing a rollback (new `change` method).

This reverts commit 9c9d4948e428a226a19aa92c17fa6ac5833c2fb8.
2013-11-13 09:02:11 +01:00
Yves Senn
9c9d4948e4 remove_column does not take a type argument. [ci skip]. Closes #12864 2013-11-12 15:56:52 +01:00
Jimmy Petersen
f387aa1bdd Fixed typo in migrations guide
Product model name was pluralized in example in migrations guide.
[ci skip]
2013-11-11 13:35:57 +01:00
Rafael Mendonça França
4b89734e8e Merge pull request #12387 from francisgo/patch-9
Migrations Guide: Add semicolon to sentences before code block [ci skip]
2013-09-28 17:23:37 -07:00
Francis Go
98a5169c2e Migrations Guide: Fix line length [ci skip] 2013-09-28 15:39:12 +10:00
Francis Go
b66110c036 Migrations Guide: Add semicolon to sentences before code block [ci skip] 2013-09-28 15:04:01 +10:00
Ofer Nave
de1e502429 added column type to example in section 2.3 2013-09-24 12:27:21 -04:00
Juanito Fatas
8e41af93a3 [ci skip] Add a type modifier in migrations.md. 2013-09-22 16:09:43 +08:00
Juanito Fatas
39a454d8a0 [ci skip] Improve readability of 4.3's NOTE in migration.md. 2013-09-17 00:33:14 +08:00
mogetutu
febe40a159 Added quotes when defining the precision for the decimal fields
before:

```bash
$ rails generate migration AddDetailsToProducts price:decimal{5,2} supplier:references{polymorphic}
```

after:

```bash
$ rails generate migration AddDetailsToProducts 'price:decimal{5,2}' supplier:references{polymorphic}
```
2013-09-12 12:50:11 +03:00
Carlos Antonio da Silva
3bcecf8258 Fix typos [ci skip] 2013-08-30 01:10:30 -03:00
Jay Hayes
5f08154230 Add documentation for rake db:setup task 2013-08-29 11:18:07 -05:00
Jay Hayes
d4863f30de Note functional equivalence in reset task 2013-08-29 11:12:57 -05:00
Xavier Noria
3baee0982d migrations guide: fix and edits [ci skip] 2013-08-05 16:37:08 +02:00
Daniel Dawson
e863410b58 Fix a grammatical error/typo in Active Record Migrations guide. [ci skip] 2013-07-08 22:56:09 +01:00
Shinichi Maeshima
f6b75ff377 Update 'Active Record Migrations' guide [ci skip]
Delete an unneeded line.
2013-07-08 16:44:42 +09:00
dkaplan88
a0bdf2fff5 Typo in Active Record Migrations Guide [ci skip] 2013-06-29 17:38:30 -05:00
Satoshi Ebisawa
56ddb8917d Fix documents for create_join_table 2013-06-21 17:27:55 +09:00
Vijay Dev
7663149f72 copy edits [ci skip] 2013-06-14 00:58:11 +05:30
Sunny Ripert
53607be559 Remove double spaces in guides 2013-05-28 14:38:02 +02:00
Sunny Ripert
70b302b189 Remove double spaces in code examples 2013-05-28 14:38:02 +02:00
Luka Marčetić
122e8dc1e9 Correct the assertion that join table columns have no options, mind context. 2013-05-27 03:31:13 +02:00
Mikhail Dieterle
4d88e85d98 Use new hash syntax 2013-05-14 21:04:32 +03:00
Adam Konner
d6bf62c3c6 fix grammar 2013-05-13 13:14:46 -04:00
Dana Jones
2976054f17 Fixed boolean validation example to use inclusion instead of presence on migrations guide 2013-05-10 11:29:16 -05:00
Sammy Larbi
1badf20497 Document the fact you can add_index on new columns 2013-04-17 16:16:47 -05:00
Akira Matsuda
9a5d4288c5 s/app\/model\//app\/models\//g 2013-03-24 16:00:54 +09:00
Yves Senn
b337390889 transactions can be turned off per Migration.
Closes #9483.

There are SQL Queries that can't run inside a transaction. Since
the Migrator used to wrap all Migrations inside a transaction there
was no way to run these queries within a migration.

This patch adds `self.disable_ddl_transaction!` to the migration to
turn transactions off when necessary.
2013-03-05 16:12:08 +01:00
Sammy Larbi
20e041579f Support creating a table migration generator
Sometimes you want to create a table without an associated model and
test, which is also not a join table. With this commit, you can now
do that.

Example:

    rails g migration create_posts title:string
or
    rails g migration CreatePosts title:string

This commit also moves the template the model generator uses for the
migration to the migration templates folder, as it seems a more
sensible place for it now that it is shared code.
2013-03-01 06:13:30 -06:00
Marc Schütz
743d15bba1 Add more documentation for create_join_table.
Explain that it doesn't create indices by default and
that it also has a block form.
2013-02-20 22:18:06 +01:00
Xavier Noria
26eb1e4e70 fixes a typo in the migrations guide 2013-02-19 18:11:10 +01:00
Lucas Caton
2b7a621e6a Replacing plugin to gem 2013-01-19 15:49:28 -02:00
Vijay Dev
dfc930b2b1 Merge branch 'master' of github.com:lifo/docrails 2013-01-01 20:29:43 +05:30
Sammy Larbi
0dad3ed4c6 Document JoinTable migration generator 2012-12-29 11:11:45 -06:00
Sammy Larbi
0b79a93daf Fix up/down column change example code formatting 2012-12-29 10:50:05 -06:00
Steve Klabnik
d9ce4fa7ac Note about migration timestamps.
We should mention that the ordering matters with regards
to timestamps, and not imply that it's just for uniqueness
purposes.

Closes #8610.
2012-12-26 15:24:22 -05:00
Marc-Andre Lafortune
a81845f268 Update Migration and 4.0 Release Guides, Changelogs [#8267] 2012-12-21 13:56:16 -05:00
Katie Oldaker
fc6336d1be Punctuation, capitalization, grammar fixes in rails guides 2012-12-07 16:32:06 -05:00
Vijay Dev
40e16121c0 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	guides/source/migrations.md
2012-12-04 22:26:16 +05:30
1334
47d95c8c3c fix some formatting 2012-12-03 14:01:27 +01:00
Steve Klabnik
4a93836291 Migration Guide: General fix-up
This introduces a bunch of editing/re-writing to the migrations guide.
There were a bunch of small changes, and a few larger ones:

* mysql does support transactions.
* Add a section about db/seeds.rb
* Largely re-wrote the first few sections
2012-12-01 10:40:41 -08:00
Steve Klabnik
d16a1b9e8b Normalize on 'After reading this guide, you will know:'
We have three or four different introduction sentences to the guides.
After this commit, we use the same one everywhere.
2012-11-29 14:25:02 -08:00
Steve Klabnik
9715d0a30a Migrations: add 'Active Record' to title
Other guides that talk about Active Record specific features include the
name of the library in the title, this one should too for consistency.
2012-11-29 05:30:31 -08:00
Steve Klabnik
6dcae8ae9c Add periods to the bullet points in guides.
Talked with @fxn about this. Bullet points should have periods at the ends.
2012-11-29 05:14:08 -08:00
Steve Klabnik
5cdb23c722 Migrations: Fix opening bullets.
The wording of these was a bit off, so I fixed them.
2012-11-29 05:07:57 -08:00
Steve Klabnik
0c294e0010 Migrations: move massive paragraph out of intro.
Most of the guides have a few simple sentences describing what they will show
you at the top. This one had a few big paragraphs. I've moved those paragraphs
down to an introductory one, and written a new smaller one for the introduction.
This makes this guide more consistent with the others.
2012-11-29 04:27:29 -08:00
Agis Anastasopoulos
6f54aac048 Switch to 1.9 hash syntax 2012-11-16 12:26:26 +02:00