Column Comments plugin
Plugin details
Documentation
ruby script/plugin install svn://syncid.textdriven.com/svn/opensource/column_comments/trunk
Enter ColumnComments
====================
The ColumnComments plugin makes the necessary modifications to ActiveRecord to allow for an optional :comment in your table migrations. In addition, it includes the same feature provided by the AnnotateModels plugin (rake annotate_models), but also includes the database-stored comments in the auto-generated header.
Here’s an example of the output:
# Schema as of Thu Apr 27 12:07:32 MDT 2006 (schema version 10) # # id integer(11) not null # login string(255) # A user-generated login name. # # salted_password string(40) default(), not null # Encrypted using SHA1 and the "salt" column # # email string(60) default(), not null # Mandatory email address for each user
Adding Comments to the Database
==============================
There are two times when you might want to add comments to your columns: while you create a new table or after a table already exists.
While You Create a New Table
----------------------------------
def self.up create_table "users" do |t| t.column "first_name", :string, :comment => "The member's given name." t.column "last_name", :string, :comment => "The member's family name." end end
After a Table Already Exists
------------------------------
def self.up column_comment "tags", "id", "The unique ID of any tag in the system." end
Or, if you want to mass-assign comments (for example, just after you install the plugin on an already-built app):
def self.up column_comments({ :users => {:first_name => "User's given name", :last_name => "Family name"}, :tags => {:id => "Tag IDentifier"}}) end
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | Back in time (1 older version) | Last edited by: hardway, 7 months ago

