Sha256: 8b43f14859982ba755737801febc40190bfefe32f82223772cde5442f77ddcfd

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 KB

Contents

require "cases/helper"

module ActiveRecord
  class Migration
    class TableAndIndexTest < ActiveRecord::TestCase
      def test_add_schema_info_respects_prefix_and_suffix
        conn = ActiveRecord::Base.connection

        conn.drop_table(ActiveRecord::Migrator.schema_migrations_table_name) if conn.table_exists?(ActiveRecord::Migrator.schema_migrations_table_name)
        # Use shorter prefix and suffix as in Oracle database identifier cannot be larger than 30 characters
        ActiveRecord::Base.table_name_prefix = 'p_'
        ActiveRecord::Base.table_name_suffix = '_s'
        conn.drop_table(ActiveRecord::Migrator.schema_migrations_table_name) if conn.table_exists?(ActiveRecord::Migrator.schema_migrations_table_name)

        conn.initialize_schema_migrations_table

        assert_equal "p_unique_schema_migrations_s", conn.indexes(ActiveRecord::Migrator.schema_migrations_table_name)[0][:name]
      ensure
        ActiveRecord::Base.table_name_prefix = ""
        ActiveRecord::Base.table_name_suffix = ""
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
ibm_db-3.0.4-x86-mingw32 test/cases/migration/table_and_index_test.rb
ibm_db-3.0.4 test/cases/migration/table_and_index_test.rb
ibm_db-3.0.3-x86-mingw32 test/cases/migration/table_and_index_test.rb
ibm_db-3.0.3 test/cases/migration/table_and_index_test.rb
ibm_db-3.0.2-x86-mingw32 test/cases/migration/table_and_index_test.rb
ibm_db-3.0.2 test/cases/migration/table_and_index_test.rb
activejob-lock-0.0.2 rails/activerecord/test/cases/migration/table_and_index_test.rb
ibm_db-3.0.1 test/cases/migration/table_and_index_test.rb
ibm_db-3.0.1-x86-mingw32 test/cases/migration/table_and_index_test.rb
activejob-lock-0.0.1 rails/activerecord/test/cases/migration/table_and_index_test.rb
activerecord-nuodb-adapter-1.1 test/cases/migration/table_and_index_test.rb
activerecord-nuodb-adapter-1.0.4 test/cases/migration/table_and_index_test.rb