SQL::Postgres

Public Instance Methods

change_column_type_statement(name, column) click to toggle source
    # File lib/dm-migrations/sql/postgres.rb, line 39
39:     def change_column_type_statement(name, column)
40:       "ALTER TABLE #{quote_name(name)} ALTER COLUMN #{column.to_sql}"
41:     end
property_schema_statement(connection, schema) click to toggle source
    # File lib/dm-migrations/sql/postgres.rb, line 22
22:     def property_schema_statement(connection, schema)
23:       if supports_serial? && schema[:serial]
24:         statement = "#{schema[:quote_column_name]} SERIAL PRIMARY KEY"
25:       else
26:         statement = super
27:         if schema.has_key?(:sequence_name)
28:           statement << " DEFAULT nextval('#{schema[:sequence_name]}') NOT NULL"
29:         end
30:         statement
31:       end
32:       statement
33:     end
recreate_database() click to toggle source
    # File lib/dm-migrations/sql/postgres.rb, line 12
12:     def recreate_database
13:       execute 'DROP SCHEMA IF EXISTS test CASCADE'
14:       execute 'CREATE SCHEMA test'
15:       execute 'SET search_path TO test'
16:     end
supports_schema_transactions?() click to toggle source
   # File lib/dm-migrations/sql/postgres.rb, line 4
4:     def supports_schema_transactions?
5:       true
6:     end
supports_serial?() click to toggle source
    # File lib/dm-migrations/sql/postgres.rb, line 18
18:     def supports_serial?
19:       true
20:     end
table(table_name) click to toggle source
    # File lib/dm-migrations/sql/postgres.rb, line 8
 8:     def table(table_name)
 9:       SQL::Postgres::Table.new(self, table_name)
10:     end
table_options(opts) click to toggle source
    # File lib/dm-migrations/sql/postgres.rb, line 35
35:     def table_options(opts)
36:       ''
37:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.