Class: Ardb::Adapter::Mysql

Inherits:
Base
  • Object
show all
Defined in:
lib/ardb/adapter/mysql.rb

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#==, #connect_db, #connect_hash, #create_db, #database, #drop_db, #drop_tables, #dump_ruby_schema, #dump_schema, #dump_sql_schema, #escape_like_pattern, #initialize, #load_ruby_schema, #load_schema, #load_sql_schema, #migrate_db, #migrations_path, #ruby_schema_path, #schema_format, #sql_schema_path

Constructor Details

This class inherits a constructor from Ardb::Adapter::Base

Instance Method Details

#foreign_key_add_sqlObject



7
8
9
10
11
12
# File 'lib/ardb/adapter/mysql.rb', line 7

def foreign_key_add_sql
  "ALTER TABLE :from_table"\
  " ADD CONSTRAINT :name"\
  " FOREIGN KEY (:from_column)"\
  " REFERENCES :to_table (:to_column)"
end

#foreign_key_drop_sqlObject



14
15
16
17
# File 'lib/ardb/adapter/mysql.rb', line 14

def foreign_key_drop_sql
  "ALTER TABLE :from_table"\
  " DROP FOREIGN KEY :name"
end