Sha256: f410845c2db78462984bac3ee2becc56f2fd9037bd41e03a82c8444b5c6fcf85

Contents?: true

Size: 1.03 KB

Versions: 25

Compression:

Stored size: 1.03 KB

Contents

unless postgresql?
describe 'Ridgepole::Client#diff -> migrate' do
  context 'when create table' do
    let(:expected_dsl) {
      <<-RUBY
        create_table "employee_clubs", force: :cascade do |t|
          t.integer "emp_no",  null: false, unsigned: true
          t.integer "club_id", null: false, unsigned: true
        end

        add_index "employee_clubs", ["emp_no", "club_id"], name: "idx_emp_no_club_id", using: :btree
      RUBY
    }

    subject { client(table_options: 'ENGINE=MyISAM CHARSET=utf8') }

    it {
      delta = subject.diff(expected_dsl)
      expect(delta.differ?).to be_truthy

      expect(delta.script).to eq <<-RUBY.strip_heredoc.strip
        create_table("employee_clubs", {:options=>"ENGINE=MyISAM CHARSET=utf8"}) do |t|
          t.integer("emp_no", {:null=>false, :unsigned=>true, :limit=>4})
          t.integer("club_id", {:null=>false, :unsigned=>true, :limit=>4})
        end
        add_index("employee_clubs", ["emp_no", "club_id"], {:name=>"idx_emp_no_club_id", :using=>:btree})
      RUBY
    }
  end
end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
ridgepole-0.6.4 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.4.beta9 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.4.beta8 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.4.beta7 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.4.beta6 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.4.beta5 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.4.beta4 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.4.beta3 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.4.beta2 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.4.beta spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.3 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.3.beta5 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.3.beta4 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.3.beta3 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.3.beta2 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.3.beta spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.2 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.2.beta spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.1 spec/mysql/migrate/migrate_create_table_with_options_spec.rb
ridgepole-0.6.1.beta2 spec/mysql/migrate/migrate_create_table_with_options_spec.rb