module SQL::Postgres

Public Instance Methods

property_schema_statement(connection, schema) click to toggle source
Calls superclass method
# File lib/dm-migrations/sql/postgres.rb, line 22
def property_schema_statement(connection, schema)
  if supports_serial? && schema[:serial]
    statement = "#{schema[:quote_column_name]} SERIAL PRIMARY KEY"
  else
    statement = super
    if schema.has_key?(:sequence_name)
      statement << " DEFAULT nextval('#{schema[:sequence_name]}') NOT NULL"
    end
    statement
  end
  statement
end
recreate_database() click to toggle source
# File lib/dm-migrations/sql/postgres.rb, line 12
def recreate_database
  execute 'DROP SCHEMA IF EXISTS test CASCADE'
  execute 'CREATE SCHEMA test'
  execute 'SET search_path TO test'
end
supports_schema_transactions?() click to toggle source
# File lib/dm-migrations/sql/postgres.rb, line 4
def supports_schema_transactions?
  true
end
supports_serial?() click to toggle source
# File lib/dm-migrations/sql/postgres.rb, line 18
def supports_serial?
  true
end
table(table_name) click to toggle source
# File lib/dm-migrations/sql/postgres.rb, line 8
def table(table_name)
  SQL::Postgres::Table.new(self, table_name)
end
table_options() click to toggle source
# File lib/dm-migrations/sql/postgres.rb, line 35
def table_options
  ''
end