spec/mysql/migrate/migrate_same_spec.rb in ridgepole-0.8.13 vs spec/mysql/migrate/migrate_same_spec.rb in ridgepole-0.9.0.beta
- old
+ new
@@ -2,16 +2,16 @@
describe 'Ridgepole::Client#diff -> migrate' do
context 'when database and definition are same' do
let(:dsl) do
erbh(<<-ERB)
- create_table "clubs", <%= i cond('>= 5.1',{id: :integer}) + {unsigned: true, force: :cascade} %> do |t|
+ create_table "clubs", <%= i cond({ '>= 5.1, < 6.1' => { id: :integer, unsigned: true }, ">= 6.1" => { id: { type: :integer, unsigned: true } } }, { unsigned: true }) %>, force: :cascade do |t|
t.string "name", default: "", null: false
t.index ["name"], name: "idx_name", unique: true, <%= i cond(5.0, using: :btree) %>
end
- create_table "departments", primary_key: "dept_no", id: :string, limit: 4, force: :cascade do |t|
+ create_table "departments", primary_key: "dept_no", <%= i cond(">= 6.1", { id: { type: :string, limit: 4 } }, { id: :string, limit: 4 }) %>, force: :cascade do |t|
t.string "dept_name", limit: 40, null: false
t.index ["dept_name"], name: "dept_name", unique: true, <%= i cond(5.0, using: :btree) %>
end
create_table "dept_emp", primary_key: ["emp_no", "dept_no"], force: :cascade do |t|
@@ -30,10 +30,10 @@
t.date "to_date", null: false
t.index ["dept_no"], name: "dept_no", <%= i cond(5.0, using: :btree) %>
t.index ["emp_no"], name: "emp_no", <%= i cond(5.0, using: :btree) %>
end
- create_table "employee_clubs", <%= i cond('>= 5.1',{id: :integer}) + {unsigned: true, force: :cascade} %> do |t|
+ create_table "employee_clubs", <%= i cond({ '>= 5.1, < 6.1' => { id: :integer, unsigned: true }, ">= 6.1" => { id: { type: :integer, unsigned: true } } }, { unsigned: true }) %>, force: :cascade do |t|
t.integer "emp_no", null: false, unsigned: true
t.integer "club_id", null: false, unsigned: true
t.index ["emp_no", "club_id"], name: "idx_emp_no_club_id", <%= i cond(5.0, using: :btree) %>
end