Class: ActiveRecord::ConnectionAdapters::ColumnMethods::Table

Inherits:
Table
  • Object
show all
Includes:
ActiveRecord::ConnectionAdapters::ColumnMethods
Defined in:
lib/active_record/connection_adapters/ibm_db_adapter.rb

Overview

class Table

Instance Method Summary collapse

Methods included from ActiveRecord::ConnectionAdapters::ColumnMethods

#primary_key

Instance Method Details

#bigint(*args) ⇒ Object



547
548
549
550
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 547

def bigint(*args)
			ibm_parse_column_attributes_args('bigint',*args)
			return self
end

#char(*args) ⇒ Object Also known as: character

Method to support the new syntax of rails 2.0 migrations (short-hand definitions) for columns of type char [character]



553
554
555
556
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 553

def char(*args)
			ibm_parse_column_attributes_args('char',*args)
			return self
end

#decfloat(*args) ⇒ Object

Method to support the new syntax of rails 2.0 migrations (short-hand definitions) for columns of type decfloat



532
533
534
535
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 532

def decfloat(*args)
			ibm_parse_column_attributes_args('decfloat',*args)
			return self
end

#double(*args) ⇒ Object

Method to support the new syntax of rails 2.0 migrations (short-hand definitions) for columns of type double



526
527
528
529
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 526

def double(*args)
			ibm_parse_column_attributes_args('double',*args)
			return self
end

#graphic(*args) ⇒ Object



537
538
539
540
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 537

def graphic(*args)
			ibm_parse_column_attributes_args('graphic',*args)
			return self
end

#vargraphic(*args) ⇒ Object



542
543
544
545
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 542

def vargraphic(*args)
			ibm_parse_column_attributes_args('vargraphic',*args)
			return self
end

#xml(*args) ⇒ Object

Method to support the new syntax of rails 2.0 migrations (short-hand definitions) for columns of type xml This method is different as compared to def char (sql is being issued explicitly as compared to def char where method column(which will generate the sql is being called) in order to handle the DEFAULT and NULL option for the native XML datatype



512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 512

def xml(*args )
			options = {}
			if args.last.is_a?(Hash) 
 options = args.delete_at(args.length-1)
			end
			sql_segment = "ALTER TABLE #{@base.quote_table_name(@table_name)} ADD COLUMN "
			args.each do | name | 
 sql =  sql_segment + " #{@base.quote_column_name(name)} xml"
 @base.execute(sql,"add_xml_column")
			end  
			return self
end