Sha256: 36750d2f1f720b6ef483c3a8593b2759526abbf6c378624e820eaf1df4a8a6db

Contents?: true

Size: 879 Bytes

Versions: 46

Compression:

Stored size: 879 Bytes

Contents

require 'jdbc_common'
require 'db/mysql'

class Project < ActiveRecord::Migration
  def self.up
    create_table :project, :primary_key => "project_id" do |t|
      t.string      :projectType, :limit => 31
      t.boolean     :published
      t.datetime    :created_date
      t.text        :abstract, :title
    end
  end

  def self.down
    drop_table :project
  end

end

class MysqlNonstandardPrimaryKeyTest < Test::Unit::TestCase

  def setup
    Project.up
  end

  def teardown
    Project.down
  end

  def standard_dump
    stream = StringIO.new
    ActiveRecord::SchemaDumper.ignore_tables = []
    ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection, stream)
    stream.string
  end

  def test_nonstandard_primary_key
    output = standard_dump
    assert_match %r(:primary_key => "project_id"), output, "non-standard primary key not preserved"
  end

end

Version data entries

46 entries across 46 versions & 9 rubygems

Version Path
activerecord-jdbc-adapter-1.2.9.1 test/mysql_nonstandard_primary_key_test.rb
cmoran92-activerecord-jdbc-adapter-1.2.1.2 test/mysql_nonstandard_primary_key_test.rb
activerecord-jdbc-adapter-1.3.0.beta1 test/db/mysql/nonstandard_primary_key_test.rb
activerecord-jdbc-adapter-1.2.9 test/mysql_nonstandard_primary_key_test.rb
activerecord-jdbc-adapter-1.2.8 test/mysql_nonstandard_primary_key_test.rb
activerecord-jdbc-adapter-1.2.5 test/mysql_nonstandard_primary_key_test.rb
tgbyte-activerecord-jdbc-adapter-1.2.2.5 test/mysql_nonstandard_primary_key_test.rb
tgbyte-activerecord-jdbc-adapter-1.2.2.4 test/mysql_nonstandard_primary_key_test.rb
tgbyte-activerecord-jdbc-adapter-1.2.2.3 test/mysql_nonstandard_primary_key_test.rb
tgbyte-activerecord-jdbc-adapter-1.2.2.2 test/mysql_nonstandard_primary_key_test.rb
activerecord-jdbc-adapter-1.2.2.1 test/mysql_nonstandard_primary_key_test.rb
activerecord-jdbc-adapter-onsite-1.2.2 test/mysql_nonstandard_primary_key_test.rb
cmoran92-activerecord-jdbc-adapter-1.2.1.1 test/mysql_nonstandard_primary_key_test.rb
intentmedia-activerecord-jdbc-adapter-1.1.1.1 test/mysql_nonstandard_primary_key_test.rb
activerecord-jdbc-adapter-1.2.2 test/mysql_nonstandard_primary_key_test.rb
cmoran92-activerecord-jdbc-adapter-1.2.1 test/mysql_nonstandard_primary_key_test.rb
activerecord-jdbc-adapter-1.2.1 test/mysql_nonstandard_primary_key_test.rb
c3-activerecord-jdbc-adapter-1.1.3.1 test/mysql_nonstandard_primary_key_test.rb
activerecord-jdbc-adapter-1.2.0 test/mysql_nonstandard_primary_key_test.rb
c3-activerecord-jdbc-adapter-1.1.3 test/mysql_nonstandard_primary_key_test.rb