aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorFrederick Cheung <frederick.cheung@gmail.com>2008-09-09 14:06:29 +0100
committerFrederick Cheung <frederick.cheung@gmail.com>2008-09-09 14:07:21 +0100
commitde96f92a550aa99d7a3944e14a6b71d1f19631fb (patch)
treee05cc6e48938151aea6988b7a06a82462b5f72c9 /railties
parent663bf4eea88a731fa4652bb0cefdcb5afe874391 (diff)
downloadrails-de96f92a550aa99d7a3944e14a6b71d1f19631fb.tar.gz
rails-de96f92a550aa99d7a3944e14a6b71d1f19631fb.tar.bz2
rails-de96f92a550aa99d7a3944e14a6b71d1f19631fb.zip
Add some cross links
Diffstat (limited to 'railties')
-rw-r--r--railties/doc/guides/migrations/anatomy_of_a_migration.txt2
-rw-r--r--railties/doc/guides/migrations/foreign_keys.txt2
-rw-r--r--railties/doc/guides/migrations/rakeing_around.txt2
-rw-r--r--railties/doc/guides/migrations/scheming.txt2
-rw-r--r--railties/doc/guides/migrations/writing_a_migration.txt2
5 files changed, 5 insertions, 5 deletions
diff --git a/railties/doc/guides/migrations/anatomy_of_a_migration.txt b/railties/doc/guides/migrations/anatomy_of_a_migration.txt
index 456087c1af..834521a23c 100644
--- a/railties/doc/guides/migrations/anatomy_of_a_migration.txt
+++ b/railties/doc/guides/migrations/anatomy_of_a_migration.txt
@@ -37,7 +37,7 @@ Active Record provides methods that perform common data definition tasks in a da
* `add_index`
* `remove_index`
-If you need to perform tasks specific to your database (for example create a foreign key constraint) then the `execute` function allows you to execute arbitrary SQL. A migration is just a regular ruby class so you're not limited to these functions. For example after adding a column you could
+If you need to perform tasks specific to your database (for example create a <<foreign_key,foreign key>> constraint) then the `execute` function allows you to execute arbitrary SQL. A migration is just a regular ruby class so you're not limited to these functions. For example after adding a column you could
write code to set the value of that column for existing records (if necessary using your models).
On databases that support transactions with statements that change the schema, migrations are wrapped in a transaction. If the database does not support this (for example Mysql and SQLite) then when a migration fails the parts of it that succeeded will not be rolled back. You will have to unpick the changes that were made by hand.
diff --git a/railties/doc/guides/migrations/foreign_keys.txt b/railties/doc/guides/migrations/foreign_keys.txt
index 7ac183d2da..005f62a462 100644
--- a/railties/doc/guides/migrations/foreign_keys.txt
+++ b/railties/doc/guides/migrations/foreign_keys.txt
@@ -1,5 +1,5 @@
== Active Record and Referential Integrity ==
-
+[[foreign_key]]
The Active Record way is that intelligence belongs in your models, not in the database. As such features such as triggers or foreign key constraints, which push some of that intelligence back into the database are not heavily used.
Validations such as `validates_uniqueness_of` are one way in which models can enforce data integrity. The `:dependent` option on associations allows models to automatically destroy child objects when the parent is destroyed. These cannot however guarantee referential integrity and so some people augment them with foreign key constraints.
diff --git a/railties/doc/guides/migrations/rakeing_around.txt b/railties/doc/guides/migrations/rakeing_around.txt
index 02fbecedb6..5635ff42f5 100644
--- a/railties/doc/guides/migrations/rakeing_around.txt
+++ b/railties/doc/guides/migrations/rakeing_around.txt
@@ -29,7 +29,7 @@ The `db:migrate:redo` task is a shortcut for doing a rollback and then migrating
Lastly, the `db:reset` task will drop the database, recreate it and load the current schema into it.
-NOTE: this is not the same as running all the migrations - see the section on schema.rb).
+NOTE: this is not the same as running all the migrations - see the section on <<schema,schema.rb>>).
=== Being Specific ===
diff --git a/railties/doc/guides/migrations/scheming.txt b/railties/doc/guides/migrations/scheming.txt
index f85a0df5f7..1ec423c923 100644
--- a/railties/doc/guides/migrations/scheming.txt
+++ b/railties/doc/guides/migrations/scheming.txt
@@ -1,5 +1,5 @@
== Schema dumping and you ==
-
+[[schema]]
=== What are schema files for? ===
Migrations, mighty as they may be, are not the authoritative source for your database schema. That role falls to either `schema.rb` or an sql file which Active Record generates by examining the database. They are not designed to be edited, they just represent the current state of the database.
diff --git a/railties/doc/guides/migrations/writing_a_migration.txt b/railties/doc/guides/migrations/writing_a_migration.txt
index e87838b0d2..d791658278 100644
--- a/railties/doc/guides/migrations/writing_a_migration.txt
+++ b/railties/doc/guides/migrations/writing_a_migration.txt
@@ -120,7 +120,7 @@ end
---------------------
will add an `attachment_id` column and a string `attachment_type` column with a default value of 'Photo'.
-NOTE: The `references` helper does not actually create foreign key constraints for you. You will need to use execute for that.
+NOTE: The `references` helper does not actually create <<foreign_key,foreign key>> constraints for you. You will need to use execute for that.
If the helpers provided by Active Record aren't enough you can use the `execute` function to execute arbitrary SQL.