Sha256: f92c31ea943169996191f446d2d9637a3780c9ff82241d31fb3cf18e8b2e86b0
Contents?: true
Size: 1.82 KB
Versions: 3
Compression:
Stored size: 1.82 KB
Contents
describe 'Ridgepole::Client#diff -> migrate' do context 'when create fk with ignore:true' do let(:actual_dsl) do erbh(<<-ERB) create_table "child", force: :cascade do |t| t.integer "parent_id" t.index ["parent_id"], name: "par_id", <%= i cond(5.0, using: :btree) %> end create_table "parent", <%= i cond('>= 5.1',id: :integer) %>, force: :cascade do |t| end ERB end let(:expected_dsl) do erbh(actual_dsl + <<-ERB) add_foreign_key "child", "parent", name: "child_ibfk_1", ignore: true ERB end before { subject.diff(actual_dsl).migrate } subject { client } it { delta = subject.diff(expected_dsl) expect(delta.differ?).to be_falsey } end context 'when change fk with ignore:true' do let(:actual_dsl) do erbh(<<-ERB) create_table "parent", <%= i cond('>= 5.1',id: :integer) %>, force: :cascade do |t| end create_table "child", force: :cascade do |t| t.integer "parent_id" t.index ["parent_id"], name: "par_id", <%= i cond(5.0, using: :btree) %> end add_foreign_key "child", "parent", name: "child_ibfk_1", on_delete: :cascade ERB end let(:expected_dsl) do erbh(<<-ERB) create_table "child", force: :cascade do |t| t.integer "parent_id" t.index ["parent_id"], name: "par_id", <%= i cond(5.0, using: :btree) %> end create_table "parent", <%= i cond('>= 5.1',id: :integer) %>, force: :cascade do |t| end add_foreign_key "child", "parent", name: "child_ibfk_1", ignore: true ERB end before { subject.diff(actual_dsl).migrate } subject { client } it { delta = subject.diff(expected_dsl) expect(delta.differ?).to be_falsey } end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ridgepole-0.8.0.rc1 | spec/mysql/fk/migrate_ignore_fk_spec.rb |
ridgepole-0.7.7 | spec/mysql/fk/migrate_ignore_fk_spec.rb |
ridgepole-0.7.6 | spec/mysql/fk/migrate_ignore_fk_spec.rb |