ridgepole 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/bin/ridgepole +6 -0
- data/lib/ridgepole/version.rb +1 -1
- data/spec/migrate/migrate_change_index3_spec.rb +52 -0
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: c176eaae904de1588223d175a7ba36e49e04a2db
         | 
| 4 | 
            +
              data.tar.gz: 2aeecdcaf4989e90ab383e8d8df9b0bfd13e98cc
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: c6f5adb0cae77d47f9ebea477a9219c87c58ca2dfd65774533ede9058a0aa86a6cd2032f67481f79c6b00746987108847682c416a3e615078d369ebae78fd841
         | 
| 7 | 
            +
              data.tar.gz: bf5a941c4e33fea0010d7ea7caab81aa10f239d3658aa8fe55f11d5f1c27563a725a44f2b8e0db9fd74d1d6f6c439b755c54aba48acad4e87649ad5642a5d42f
         | 
    
        data/README.md
    CHANGED
    
    
    
        data/bin/ridgepole
    CHANGED
    
    | @@ -80,6 +80,12 @@ ARGV.options do |opt| | |
| 80 80 | 
             
                opt.on(''  , '--log-file LOG_FILE')           {|v| options[:log_file] = v                               }
         | 
| 81 81 | 
             
                opt.on(''  , '--verbose')                     {    Ridgepole::Logger.verbose = true                     }
         | 
| 82 82 | 
             
                opt.on(''  , '--debug')                       {    options[:debug] = true                               }
         | 
| 83 | 
            +
             | 
| 84 | 
            +
                opt.on('-v', '--version') {
         | 
| 85 | 
            +
                  puts opt.ver
         | 
| 86 | 
            +
                  exit
         | 
| 87 | 
            +
                }
         | 
| 88 | 
            +
             | 
| 83 89 | 
             
                opt.parse!
         | 
| 84 90 |  | 
| 85 91 | 
             
                if not mode or ([:apply, :export].include?(mode) and not config) or  (options[:with_apply] and not config)
         | 
    
        data/lib/ridgepole/version.rb
    CHANGED
    
    
| @@ -35,6 +35,58 @@ describe 'Ridgepole::Client#diff -> migrate' do | |
| 35 35 | 
             
                }
         | 
| 36 36 | 
             
              end
         | 
| 37 37 |  | 
| 38 | 
            +
              context 'when change index without using (change)' do
         | 
| 39 | 
            +
                let(:actual_dsl) {
         | 
| 40 | 
            +
                  <<-RUBY
         | 
| 41 | 
            +
                    create_table "salaries", id: false, force: true do |t|
         | 
| 42 | 
            +
                      t.integer "emp_no",    null: false
         | 
| 43 | 
            +
                      t.integer "salary",    null: false
         | 
| 44 | 
            +
                      t.date    "from_date", null: false
         | 
| 45 | 
            +
                      t.date    "to_date",   null: false
         | 
| 46 | 
            +
                    end
         | 
| 47 | 
            +
             | 
| 48 | 
            +
                    add_index "salaries", ["emp_no"], name: "emp_no", using: :btree
         | 
| 49 | 
            +
                  RUBY
         | 
| 50 | 
            +
                }
         | 
| 51 | 
            +
             | 
| 52 | 
            +
                let(:dsl) {
         | 
| 53 | 
            +
                  <<-RUBY
         | 
| 54 | 
            +
                    create_table "salaries", id: false, force: true do |t|
         | 
| 55 | 
            +
                      t.integer "emp_no",    null: false
         | 
| 56 | 
            +
                      t.integer "salary",    null: false
         | 
| 57 | 
            +
                      t.date    "from_date", null: false
         | 
| 58 | 
            +
                      t.date    "to_date",   null: false
         | 
| 59 | 
            +
                    end
         | 
| 60 | 
            +
             | 
| 61 | 
            +
                    add_index "salaries", ["salary"], using: :hash
         | 
| 62 | 
            +
                  RUBY
         | 
| 63 | 
            +
                }
         | 
| 64 | 
            +
             | 
| 65 | 
            +
                let(:expected_dsl) {
         | 
| 66 | 
            +
                  <<-RUBY
         | 
| 67 | 
            +
                    create_table "salaries", id: false, force: true do |t|
         | 
| 68 | 
            +
                      t.integer "emp_no",    null: false
         | 
| 69 | 
            +
                      t.integer "salary",    null: false
         | 
| 70 | 
            +
                      t.date    "from_date", null: false
         | 
| 71 | 
            +
                      t.date    "to_date",   null: false
         | 
| 72 | 
            +
                    end
         | 
| 73 | 
            +
             | 
| 74 | 
            +
                    add_index "salaries", ["salary"], name: "index_salaries_on_salary", using: :hash
         | 
| 75 | 
            +
                  RUBY
         | 
| 76 | 
            +
                }
         | 
| 77 | 
            +
             | 
| 78 | 
            +
                before { subject.diff(actual_dsl).migrate }
         | 
| 79 | 
            +
                subject { client(:table_options => 'ENGINE=MEMORY') }
         | 
| 80 | 
            +
             | 
| 81 | 
            +
                it {
         | 
| 82 | 
            +
                  delta = subject.diff(dsl)
         | 
| 83 | 
            +
                  expect(delta.differ?).to be_truthy
         | 
| 84 | 
            +
                  expect(subject.dump.delete_empty_lines).to eq actual_dsl.strip_heredoc.strip.delete_empty_lines
         | 
| 85 | 
            +
                  delta.migrate
         | 
| 86 | 
            +
                  expect(subject.dump.delete_empty_lines).to eq expected_dsl.strip_heredoc.strip.delete_empty_lines
         | 
| 87 | 
            +
                }
         | 
| 88 | 
            +
              end
         | 
| 89 | 
            +
             | 
| 38 90 | 
             
              context 'when change index without name (no change)' do
         | 
| 39 91 | 
             
                let(:actual_dsl) {
         | 
| 40 92 | 
             
                  <<-RUBY
         |