Namespace

SQL::Mysql

Public Instance Methods

change_column_type_statement(name, column) click to toggle source
    # File lib/dm-migrations/sql/mysql.rb, line 40
40:     def change_column_type_statement(name, column)
41:       "ALTER TABLE #{quote_name(name)} MODIFY COLUMN #{column.to_sql}"
42:     end
property_schema_statement(connection, schema) click to toggle source
    # File lib/dm-migrations/sql/mysql.rb, line 32
32:     def property_schema_statement(connection, schema)
33:       if supports_serial? && schema[:serial]
34:         statement = "#{schema[:quote_column_name]} SERIAL PRIMARY KEY"
35:       else
36:         super
37:       end
38:     end
recreate_database() click to toggle source
    # File lib/dm-migrations/sql/mysql.rb, line 14
14:     def recreate_database
15:       execute "DROP DATABASE #{schema_name}"
16:       execute "CREATE DATABASE #{schema_name}"
17:       execute "USE #{schema_name}"
18:     end
supports_schema_transactions?() click to toggle source
   # File lib/dm-migrations/sql/mysql.rb, line 6
6:     def supports_schema_transactions?
7:       false
8:     end
supports_serial?() click to toggle source
    # File lib/dm-migrations/sql/mysql.rb, line 20
20:     def supports_serial?
21:       true
22:     end
table(table_name) click to toggle source
    # File lib/dm-migrations/sql/mysql.rb, line 10
10:     def table(table_name)
11:       SQL::Mysql::Table.new(self, table_name)
12:     end
table_options(opts) click to toggle source
    # File lib/dm-migrations/sql/mysql.rb, line 24
24:     def table_options(opts)
25:       opt_engine    = opts[:storage_engine] || storage_engine
26:       opt_char_set  = opts[:character_set] || character_set
27:       opt_collation = opts[:collation] || collation
28: 
29:       " ENGINE = #{opt_engine} CHARACTER SET #{opt_char_set} COLLATE #{opt_collation}"
30:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.