diff options
author | rick <rick@spacemonkey.local> | 2008-05-05 23:19:21 -0700 |
---|---|---|
committer | rick <rick@spacemonkey.local> | 2008-05-05 23:19:21 -0700 |
commit | 0052938ac5b8894b27fdb9f27b1ed39f0a9ea176 (patch) | |
tree | f714643a4043d9fb73b39ec2a114d18f5deeffdd /activerecord/README | |
parent | eacb5cf0cab6447db78085c8bda6c94dd329ce6b (diff) | |
parent | 3cffe92ff066c2b35eef409547db93652c5cccfc (diff) | |
download | rails-0052938ac5b8894b27fdb9f27b1ed39f0a9ea176.tar.gz rails-0052938ac5b8894b27fdb9f27b1ed39f0a9ea176.tar.bz2 rails-0052938ac5b8894b27fdb9f27b1ed39f0a9ea176.zip |
Merge commit 'core/master'
Diffstat (limited to 'activerecord/README')
-rwxr-xr-x | activerecord/README | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/activerecord/README b/activerecord/README index 7204b44ec4..ff3f55ee8a 100755 --- a/activerecord/README +++ b/activerecord/README @@ -164,6 +164,28 @@ A short rundown of the major features: ActiveRecord::Base.logger = Log4r::Logger.new("Application Log") +* Database agnostic schema management with Migrations + + class AddSystemSettings < ActiveRecord::Migration + def self.up + create_table :system_settings do |t| + t.string :name + t.string :label + t.text :value + t.string :type + t.integer :position + end + + SystemSetting.create :name => "notice", :label => "Use notice?", :value => 1 + end + + def self.down + drop_table :system_settings + end + end + + {Learn more}[link:classes/ActiveRecord/Migration.html] + == Simple example (1/2): Defining tables and classes (using MySQL) Data definitions are specified only in the database. Active Record queries the database for |